I am currently migrating an Eclipse app to Android Studio. This app was using the in app billing.
My main problem is to compile the project and the aidl file (I gues
The rest of posts here didn't work for me till I created a new folder like shown here.
Add this code in build.gradle
android {
sourceSets {
main {
aidl.srcDirs = ['src']
}
}
}
Rebuild and import aidl class
Just as the error message says, you need to put IInAppBillingService.aidl in the correct directory dictated by it's package (com.android.vending.billing).
Within the src/main/aidl/ folder you already have, put the .aidl file in com/android/vending/billing/.
src/main called aidlaidl, select new->add packageEnter Name of the package com.android.vending.billing
Copy IInAppBillingService.aidl from the directory Android/Sdk/extras/google/play_billing to the directory App_name/app/src/main/aidl/com/android/vending/billing
can not resolve symbol IInAppBillingXXXXXXBuild from android studio menu , click on Rebuild Project. This will generate IInAppBillingService.java file inside App_Name/app/build/generated/source/aidl/debug/com/android/vending/billing. This will solve the issue.restarting Android Studio worked for me
a second silly thing that took me a while. I dropped the code on Android Studio to allow him create the file, but he created a .java (as expected) instead a .aidl Jiji, stupid of me
We need to add
create folder - src/main/aidl/packagename and place aidl file under this.
In the aidl file - mention the package name. package packagename
Now clean the project, rebuild the project - We can the corresponding java file for the aidl generated in app\build\generated\source\aidl\debug\packagename\youraidl.java