I am working on android project and I am using In App Purchases. It was all working in Eclipe but I saw Android Studio had another update which fixed a lot of issues related to library dependencies which does seem to be the case except for one problem. I am unable to use the IAP service as it keeps stating that it cannot be resolved to a symbol.
I have followed the instructions that someone posted here but unfortunately has not worked. Below are the links I have looked at
how can I add the aidl file to Android studio (from the in-app billing example)
https://code.google.com/p/android/issues/detail?id=56755
Below is a screenshot of my project structure and the error
as per info here: aidl files
Aidl files are supposed to be in src/main/aidl: per the tools docs at: tools doc
I was getting this error even though I placed the file in right directory and was importing it in right way. Then I just did Build
> Clean Project
and this solved the problem.
(As far as I can guess, not sure) I think when we add .aidl file at that time android studio doesn't know about it unless we compile our project at-least once
In my case I just manually added import (after Gradle build):
import com.android.vending.billing.IInAppBillingService;
2018
app/build.gradle:
sourceSets {
main {
aidl.srcDirs = ['src/main/aidl']
}
}
for IInAppBillingService.aidl
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