Error in Adding the In-app Billing Library

前端 未结 9 524
轻奢々
轻奢々 2021-01-31 08:38

I was doing this following these steps as mentioned in the link.

  1. Copy the IInAppBillingService.aidl file to your Android project.

    (1) If you are
相关标签:
9条回答
  • 2021-01-31 09:07

    right click on the head of the project and create a new PACKAGE ... call the package com.android.vending.billing ....drop the aidl file in there to quiet the error.

    Some food for thought: for those with an interest - when using someone's aidl file, the package name for both apps must be the same. google used com.android.vending.billing as their package name for their billing aidl interface, so you MUST also use the same package name in your app. This is the rule when using aidl.

    0 讨论(0)
  • 2021-01-31 09:09

    Check that you have added billing library in your build.gladle under dependencies

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    
    implementation 'com.android.billingclient:billing:1.1'
    }
    

    See the last line in the above code. Implementing 'com.android.billingclient:billing:1.1' solved same problem for me

    0 讨论(0)
  • 2021-01-31 09:10

    For android studio users, this should be the structure:

    enter image description here

    Worked for me, according to this answer.

    0 讨论(0)
提交回复
热议问题