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 guess you all use this file)
I get this error message:
Gradle: error: cannot find symbol class IInAppBillingService
Gradle: error: package IInAppBillingService does not exist
So, following some tutorials, I move this file from com.mypackage.billing to src/main/aidl (see this reference)
But as soon, as I do that, I get this message:
Gradle: Execution failed for task ':xxxxxxxxxxx:compileDebugAidl'.
Failed to run command: (...) C:\Users\xxxx\AndroidStudioProjects\xxxxxxProject\xxxxxxx\src\main\aidl\IInAppBillingService.aidl:45 interface IInAppBillingService should be declared in a file called com\xxxxxxxx\billing\IInAppBillingService.aidl.
The message is clearly a contradiction with the post from the Google bug page I linked above.
Anyone suceeded to make this aidl file to work and can help me?
Just to inform, some links I followed:
Warning: AIDL is now deprecated and will be removed in a future release. To implement billing-related features, use the Google Play Billing Library. You can use an Android Interface Definition Language (AIDL) interface to implement some features of Google Play's billing system.
AIDL has support for the following data types: string. charSequence. List.
'Stub' is a class that implements the remote interface in a way that you can use it as if it were a local one. It handles data marashalling/unmarshalling and sending/receiving to/from the remote service.
Adding this as an answer since it seemed to help quite a few people.
Note: Make sure you include the necessary import if your reference isn't working
import com.android.vending.billing.IInAppBillingService;
https://issuetracker.google.com/issues/36973270
Edit From Comment
After I did this, the references to IInAppBillingService in my code were still highlighted as errors, but after rebuilding the app, the class was recognized
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/
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With