title: Crash in relation to in-app purchasing
body: <p>I have an app just launched on the market which employs in-app purchasing which was cobbled together from other people's example code which I barely understand. The code does appear to work most of the time, but I have one device on which it crashes every time. It appears to crash within some "generated java files" in the gen directory and I traced the last few steps just before the crash as follows:</p>
  
  <pre><code>protected static boolean isBillingSupported()
  {
      if (amIDead())
      {
          return false;
      }
      Bundle request = makeRequestBundle("CHECK_BILLING_SUPPORTED");
  
      if (mService != null &amp;&amp; request != null)
      {
          try
          {
              Bundle response = mService.sendBillingRequest(request);
  </code></pre>
  
  <p>then I step into this method and the following lines get executed... (see comments)</p>
  
  <pre><code>public android.os.Bundle sendBillingRequest(android.os.Bundle bundle) throws android.os.RemoteException
  {
      android.os.Parcel _data = android.os.Parcel.obtain();
      android.os.Parcel _reply = android.os.Parcel.obtain();
      android.os.Bundle _result;
      try 
      {
          _data.writeInterfaceToken(DESCRIPTOR); // DESCRIPTOR was "com.android.vending.billing.IMarketBillingService"
          if ((bundle!=null))
          {
              _data.writeInt(1); // GOT HERE OK
              bundle.writeToParcel(_data, 0);
          }
          else 
          {
              _data.writeInt(0);
          }
          mRemote.transact(Stub.TRANSACTION_sendBillingRequest, _data, _reply, 0); // GOT HERE OK
          _reply.readException(); // GOT HERE OK  ... BUT THEN JUMPS TO XXXX
          if ((0!=_reply.readInt())) // WE NEVER REACH THIS LINE!
          {
              _result = android.os.Bundle.CREATOR.createFromParcel(_reply);
          }
          else
          {
              _result = null;
          }
      }
      finally // XXXX
      {
          _reply.recycle(); // THIS GETS EXECUTED
          _data.recycle(); // THIS GETS EXECUTED
      }
      return _result; // WE REACH HERE, BUT THAT'S THE LAST LINE I SEE BEFORE THE EXCEPTION APPEARS IN THE LOG OUTPUT
  }
  </code></pre>
  
  <p>The Log file shows the following:</p>
  
  <pre><code>01-10 22:54:00.730: W/dalvikvm(1292): threadid=1: thread exiting with uncaught exception (group=0x401cb760)
  01-10 22:54:00.740: E/AndroidRuntime(1292): FATAL EXCEPTION: main
  01-10 22:54:00.740: E/AndroidRuntime(1292): java.lang.NullPointerException
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at android.os.Parcel.readException(Parcel.java:1327)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at android.os.Parcel.readException(Parcel.java:1275)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at com.android.vending.billing.IMarketBillingService$Stub$Proxy.sendBillingRequest(IMarketBillingService.java:100)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at com.mycompany.mygame.BillingHelper.isBillingSupported(BillingHelper.java:64)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at com.mycompany.mygame.Shop.onClick(Shop.java:174)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at android.view.View.performClick(View.java:3122)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at android.view.View$PerformClick.run(View.java:11942)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at android.os.Handler.handleCallback(Handler.java:587)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at android.os.Handler.dispatchMessage(Handler.java:92)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at android.os.Looper.loop(Looper.java:132)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at android.app.ActivityThread.main(ActivityThread.java:4028)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at java.lang.reflect.Method.invokeNative(Native Method)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at java.lang.reflect.Method.invoke(Method.java:491)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
  01-10 22:54:00.740: E/AndroidRuntime(1292):     at dalvik.system.NativeStart.main(Native Method)
  01-10 22:54:02.770: I/dalvikvm(1292): threadid=4: reacting to signal 3
  01-10 22:54:02.770: I/dalvikvm(1292): Wrote stack traces to '/data/anr/traces.txt'
  </code></pre>
  
  <p>I'm not sure where to go from here as I am completely confused as to what is going on. I am baffled as to how or why this code even got be be "generated"... presumably even if I saw a bug here I could not edit it anyway! Is this code part of the Android OS? Perhaps the real error is within the passed bundle?.. all hints welcome.</p>