libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
225 stars 82 forks source link

Crashed in IOS #43

Closed panhaozi closed 9 years ago

panhaozi commented 9 years ago

When I made a purchase, the last output was "Purchasing product my product ...", then the game crashed.This situation was random, but once it appear, it appear every time after that moment. The crash log was:

Incident Identifier: F38A4409-CA2E-4615-9FE6-6EB1F8400A4E CrashReporter Key: c31979bcee3754c5758b99fee7e241707111909f Hardware Model: iPhone5,2 Process: xmjwz [10752] Path: /private/var/mobile/Containers/Bundle/Application/1F97A1A6-441D-46C4-A9E2-6F556487E73F/xmjwz.app/xmjwz Identifier: me.gall.zumafighter Version: 1506021500 (1.0.2) Code Type: ARM (Native) Parent Process: launchd [1]

Date/Time: 2015-06-03 10:19:13.944 +0800 Launch Time: 2015-06-03 10:18:40.694 +0800 OS Version: iOS 8.0.2 (12A405) Report Version: 105

Exception Type: EXC_BAD_ACCESS (SIGABRT) Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000 Triggered by Thread: 0

Last Exception Backtrace: 0 CoreFoundation 0x27851e3a exceptionPreprocess + 122 1 libobjc.A.dylib 0x34effc86 objc_exception_throw + 34 2 CoreFoundation 0x27851d80 +[NSException raise:format:] + 108 3 xmjwz 0x00292a1c 0x9a000 + 2066972 4 libsystem_platform.dylib 0x355bf86e _sigtramp + 30 5 xmjwz 0x00600f84 0x9a000 + 5664644 6 xmjwz 0x0046ebfc 0x9a000 + 4017148 7 xmjwz 0x0046e174 0x9a000 + 4014452 8 StoreKit 0x2ac70094 NotifyObserverAboutChanges + 80 9 CoreFoundation 0x27764088 CFArrayApplyFunction + 32 10 StoreKit 0x2ac70030 -[SKPaymentQueue _notifyObserversAboutChanges:sendUpdatedDownloads:] + 124 11 StoreKit 0x2ac70942 -[SKPaymentQueue _processUpdates:trimUnmatched:sendUpdatedDownloads:] + 1070 12 StoreKit 0x2ac71028 -[SKPaymentQueue _setTransactionsWithReply:] + 124 13 StoreKit 0x2ac6fbc8 __38-[SKPaymentQueue _establishConnection]_block_invoke_2 + 56 14 libdispatch.dylib 0x3545f8c6 _dispatch_call_block_and_release + 6 15 libdispatch.dylib 0x3545f8b2 _dispatch_client_callout + 18 16 libdispatch.dylib 0x354630ba _dispatch_main_queue_callback_4CF + 718 17 CoreFoundation 0x27817be4 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 4 18 CoreFoundation 0x278162e4 __CFRunLoopRun + 1508 19 CoreFoundation 0x2776461c CFRunLoopRunSpecific + 472 20 CoreFoundation 0x2776442e CFRunLoopRunInMode + 102 21 GraphicsServices 0x2eb130a4 GSEventRunModal + 132 22 UIKit 0x2ad4f354 UIApplicationMain + 1436 23 xmjwz 0x00a93d14 0x9a000 + 10460436 24 xmjwz 0x00a93376 0x9a000 + 10457974 25 xmjwz 0x00a92a72 0x9a000 + 10455666 26 xmjwz 0x00799d52 0x9a000 + 7339346 27 xmjwz 0x00be433e 0x9a000 + 11838270 28 xmjwz 0x00bdce5e 0x9a000 + 11808350 29 xmjwz 0x00bde912 0x9a000 + 11815186 30 xmjwz 0x00bde968 0x9a000 + 11815272 31 xmjwz 0x00bd8c76 0x9a000 + 11791478 32 xmjwz 0x00bd1184 0x9a000 + 11760004 33 xmjwz 0x002c3714 0x9a000 + 2266900

And my code:

        PurchaseManagerConfig config = new PurchaseManagerConfig();
        config.addOffer(new Offer().setType(OfferType.CONSUMABLE).setIdentifier("my product"));
        PurchaseSystem.install(new PurchaseObserver()
        {

            @Override
            public void handleRestoreError(Throwable e)
            {
                // TODO Auto-generated method stub
            }

            @Override
            public void handleRestore(Transaction[] transactions)
            {
                // TODO Auto-generated method stub

            }

            @Override
            public void handlePurchaseError(Throwable e)
            {
                e.printStackTrace();
                PurchaseSystem.dispose();
            }

            @Override
            public void handlePurchaseCanceled()
            {
                PurchaseSystem.dispose();
            }

            @Override
            public void handlePurchase(Transaction transaction)
            {
                System.out.println(transaction.getIdentifier());
                PurchaseSystem.dispose();
            }

            @Override
            public void handleInstallError(Throwable e)
            {
                e.printStackTrace();
                PurchaseSystem.dispose();
            }

            @Override
            public void handleInstall()
            {
                PurchaseSystem.purchase("my product");
            }
        }, config);

libgdx:1.5.6 gdx-pay:0.5.0-SNAPSHOT robovm:1.3.0