2
FATAL EXCEPTION: main
java.lang.NullPointerException
    at android.os.Parcel.readException(Parcel.java:1328)
    at android.os.Parcel.readException(Parcel.java:1276)
    at com.android.vending.billing.IMarketBillingService$Stub$Proxy.sendBillingRequest(IMarketBillingService.java:100)
    at kr.my.dungeons.BillingService$CheckBillingSupported.run(BillingService.java:209)
    at kr.my.dungeons.BillingService$BillingRequest.runIfConnected(BillingService.java:127)
    at kr.my.dungeons.BillingService.runPendingRequests(BillingService.java:609)
    at kr.my.dungeons.BillingService.onServiceConnected(BillingService.java:654)
    at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1049)
    at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1066)
    at android.os.Handler.handleCallback(Handler.java:587)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:126)
    at android.app.ActivityThread.main(ActivityThread.java:4002)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:491)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
    at dalvik.system.NativeStart.main(Native Method)

それはエラー構文です。

  1. SDK からサンプル ソースを取得します。

  2. google market から Security.java に「公開鍵」を入れます。

  3. 私のソース パスは「src/kr/my/」で、aidl ファイルのパスは「src/com/android/vending/billing/」です。

  4. AndroidManifest.xml を確認しました。

  5. apk を Google マーケットにアップロードします。(未公開)

  6. google market に 'sword_001', 'potion_001' を追加(公開)

  7. デバイスに同じapkをインストールしました。

( https://github.com/robotmedia/AndroidBillingLibraryからのサンプル ソースの同じエラー)

私は何を間違えましたか?

4

4 に答える 4

4

これは、ユーザーがマーケットの EULA に同意していない場合に発生します

したがって、EULAを起動します

 try {
    CALL BILLING CODE HERE .....
  } catch (NullPointerException e) {
    initialiseMarket();
  }

private void initialiseMarket() {
  new AlertDialog.Builder(this).
    setTitle("Android Market").
    setNeutralButton("CLOSE"), new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int which) {
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search"));
        startActivity(intent);
      }
    }).
    setMessage("Android Market not initialised. Please accept EULA and restart.").
    show();
}

ここから撮影

于 2011-11-14T09:14:14.447 に答える
0

私はここでこれを修正することに取り組んでいます https://github.com/drewjw81/AndroidBillingLibrary

このバージョンは、Play に正しくバインドできない場合にアラートを表示する必要があります。

使用する場合は、まだいくつかの作業が必要であることを忘れないでください。テストしてください。また、エラーが引き続き発生する場合は、マイページにバグレポートを提出してください。

于 2012-04-06T11:55:27.687 に答える
0

ここで私の答えを読んでください:

Android アプリ内課金 - restoreTransactionInformation

多くのユーザー (私を含む) がこのスタック トレースを見ているため、トランザクションを復元しようとしたと思います。

このエラーは、restoreTransactions を呼び出すときに返される CONFIRM_TRANSACTIONS 要求に null フィールド (「notification_id」フィールド) が追加されているために発生します。

于 2012-04-24T00:42:24.197 に答える
0

これは、こちらで報告されているアプリ内課金の既知のバグのようです。

これが発生した場合、私はAndroidBillingLibrarycatchに aを追加しました。

于 2012-04-22T15:55:33.497 に答える