title: Android In App Billing SecurityException "Binder invocation to an incorrect interface"
body: <p>I am trying to get the google In App Billing services to work.</p>
  
  <p>I've got so far that the service is bound and connected, but once I try to fetch some data from the service it crashes with the log:
  <code><pre>
  04-02 10:36:32.795  10569-10651/my.app.package E/IAP﹕ java.lang.SecurityException: Binder invocation to an incorrect interface
              at android.os.Parcel.readException(Parcel.java:1425)
              at android.os.Parcel.readException(Parcel.java:1379)
              at billing.IInAppBillingService$Stub$Proxy.getSkuDetails(IInAppBillingService.java:251)
              at my.app.package.libs.clientbackend.iap.IAPHelper$FetchItemsCallable.call(IAPHelper.java:102)
              at my.app.package.libs.clientbackend.iap.IAPHelper$FetchItemsCallable.call(IAPHelper.java:89)
              at java.util.concurrent.FutureTask.run(FutureTask.java:234)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
              at java.util.concurrent.FutureTask.run(FutureTask.java:234)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
              at java.lang.Thread.run(Thread.java:856)
  </pre></code></p>
  
  <p>This is my code so far:</p>
  
  <p>The activity that shows the Purchases:</p>
  
  <pre><code>Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
  serviceIntent.setPackage("com.android.vending");
  bindService(serviceIntent, this, Context.BIND_AUTO_CREATE);
  </code></pre>
  
  <p>The IAB calls once the service has connected:</p>
  
  <pre><code>Bundle itemBundle = new Bundle();
  itemBundle.putStringArrayList("ITEM_ID_LIST", new ArrayList&lt;&gt;(Arrays.asList(itemIds)));
  Bundle detailsBundle = service
          .getSkuDetails(3, context.getPackageName(), "inapp", itemBundle);
  </code></pre>
  
  <p>It fails on the last line <code>...getSkuDetails(...</code> with the error posted above.</p>
  
  <hr>
  
  <p>I did some research on this matter and found our that it might be caused by wrong package names. I've included the <code>IInAppBillingService.aidl</code> like it's described on google's documentation but I am still getting a wrong package on import:</p>
  
  <p>The file is at: <code>src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl</code> </p>
  
  <p>But when I am importing the generated class Android Studio uses this import path:</p>
  
  <pre><code>import billing.IInAppBillingService;
  </code></pre>
  
  <p>According to the documentation this should actually be:</p>
  
  <pre><code>import com.android.vending.billing.IInAppBillingService;
  </code></pre>
  
  <p>Is there still something wrong with my project setup or does anyone know the cause of this error?</p>
  
  <p>Much thanks in advance,
  McFarlane</p>