Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In App Purchaes with Android Studio unable to find IInAppBillingService

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

Screenshot of project structure and error

like image 300
Boardy Avatar asked Dec 28 '13 16:12

Boardy


4 Answers

as per info here: aidl files

Aidl files are supposed to be in src/main/aidl: per the tools docs at: tools doc

like image 175
Fred Grott Avatar answered Nov 04 '22 23:11

Fred Grott


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

like image 20
Zohab Ali Avatar answered Nov 05 '22 01:11

Zohab Ali


In my case I just manually added import (after Gradle build):

import com.android.vending.billing.IInAppBillingService;
like image 5
Andy Mac Avatar answered Nov 05 '22 01:11

Andy Mac


2018

app/build.gradle:

sourceSets {
  main {
    aidl.srcDirs = ['src/main/aidl']
  }
}

for IInAppBillingService.aidl

like image 4
Alexander Lubyagin Avatar answered Nov 05 '22 00:11

Alexander Lubyagin