HaxeExtension / extension-iap

Support for In-App Purchase
Other
70 stars 46 forks source link

App crashes initializing #38

Open fierysquirrel opened 8 years ago

fierysquirrel commented 8 years ago

Hi,

I'm using the extention in my game (mobile), tested everything, worked well and when I sent to Apple for review, it crashed. The only new thing I added between the previous update and the new one is this extension so I think something is probably happening with it.

The crash log says the following:

Thread 2 name: Dispatch queue: com.apple.NSXPCConnection.user.1057 Thread 2 Crashed: 0 GAME 0x000000010070276c alloc_empty_object + 60 1 GAME 0x000000010070275c alloc_empty_object + 44 2 GAME 0x00000001001b3944 external_handler(nme::Event&, void*) + 64 3 GAME 0x00000001001a42f4 nme::Stage::HandleEvent(nme::Event&) + 1236 4 GAME 0x000000010016eec8 -[UIStageViewController shouldAutorotateToInterfaceOrientation:] + 160 5 GAME 0x000000010016ef10 -[UIStageViewController supportedInterfaceOrientations] + 44 6 UIKit 0x000000018669c87c 0x186610000 + 575612 7 UIKit 0x00000001866a5f64 0x186610000 + 614244 8 UIKit 0x000000018691a360 0x186610000 + 3187552 9 UIKit 0x000000018691a2c4 0x186610000 + 3187396 10 UIKit 0x000000018669da40 0x186610000 + 580160 11 UIKit 0x00000001866257c0 0x186610000 + 88000 12 UIKit 0x00000001867adecc 0x186610000 + 1695436 13 CoreFoundation 0x0000000181937430 0x18180c000 + 1225776 14 CoreFoundation 0x0000000181834eb4 0x18180c000 + 167604 15 Foundation 0x00000001823da0a4 0x182200000 + 1941668 16 Foundation 0x000000018227f88c 0x182200000 + 522380 17 Foundation 0x0000000182208230 0x182200000 + 33328 18 libxpc.dylib 0x00000001815cd358 0x1815c8000 + 21336 19 libxpc.dylib 0x00000001815cb100 0x1815c8000 + 12544 20 libdispatch.dylib 0x00000001813856ec 0x181384000 + 5868 21 libdispatch.dylib 0x00000001813899d8 0x181384000 + 23000 22 libdispatch.dylib 0x0000000181391808 0x181384000 + 55304 23 libdispatch.dylib 0x0000000181388aec 0x181384000 + 19180 24 libdispatch.dylib 0x0000000181391808 0x181384000 + 55304 25 libdispatch.dylib 0x00000001813890f4 0x181384000 + 20724 26 libdispatch.dylib 0x00000001813855f0 0x181384000 + 5616 27 libdispatch.dylib 0x0000000181393a88 0x181384000 + 64136 28 libdispatch.dylib 0x0000000181393224 0x181384000 + 61988 29 libsystem_pthread.dylib 0x0000000181599470 0x181598000 + 5232 30 libsystem_pthread.dylib 0x0000000181599020 0x181598000 + 4128

At least this is the relevant part where the crash is.

I'm not completely sure but I think the problem is here:

0 GAME 0x000000010070276c alloc_empty_object + 60

with "alloc_empty_object", on the haxe side I'm using this function:

IAP.initialize(IAP_KEY); //For iOS IAP_KEY is ""

which I understand is connected to this file:

ExternalInterface.cpp

which contains the function that is triggering the error.

I'm not really sure about this, that's why I wanted to ask you, in my devices the app doesn't crash but apparently in some devices it's not working.

They tested with an iPad and an iPhone, both with iOS 9.2.

Please if you have a clue or something to fix this bug let me know, I can test and do whatever I have to do to fix it.

I also contacted Apple to request more details about the devices they were using.

Thanks in advance.

fierysquirrel commented 8 years ago

I added the whole crash log here in case you want to take a look at it:

http://pastebin.com/YZnbU9yq

thomasuster commented 8 years ago

@fierysquirrel I took a look above and at the full log. Nothing stands out to me. I'm also not sure this is related to IAP. I don't get how you know that it's tied to IAP.initialize for example. I think your strategy of getting a device where the crash can be reproduced is a great idea.

fierysquirrel commented 8 years ago

@thomasuster thank you for your reply, sorry for the delay.

The main reason I believe that the error was triggered by the extension is that is the only new thing I added. Besides this, I think that if you look at the thread that crashed (thread 2) it shows that the last function that was called before crashing was "alloc_empty_object".

Probably I'm not understanding it correctly, I'm not sure.

Anyway, I tested the game in many different devices with same features that Apple mentioned, different OS versions as well and there is no error. I wrote to Apple's team, recompiled, sent the build again and I'm just waiting.

I really think it's a weird crash and was looking for help, didn't know if it happened to you or anyone that has used the extension before.

Still haven't been able to reproduce the error here. Do you think it's better to close the issue or have anything in mind that could probably cause it?

Thank you again for your support.

thomasuster commented 8 years ago

Try this...

1) Make sure your device has internet 2) Open the app 3) Wait a few seconds (so the IAP has a chance to connect successfully) 4) Disable your mobile internet 5) Try to make a purchase

If it crashes, then my PR that's waiting review might fix it.

https://github.com/openfl/extension-iap/pull/35

fierysquirrel commented 8 years ago

Hi,

I think this is not the issue, this is fine.

I'm still waiting for Apple's response on the game's review, once I know I will let you know but once again, we tested many times in different devices and everything went well. There is an issue if you try to make a purchase twice in a row but that can be fixed in my code, I guess you don't need to do anything.

Once again thank you for the support, will keep you updated.

thomasuster commented 8 years ago

:+1: