-
Notifications
You must be signed in to change notification settings - Fork 1
Android crash when the Java code is calling a c++ callback #216
Comments
Comment by kiroukou: +1 Quite bloking at the moment since most of our apps are extension based... Would be really great if you can have a look Joshua ! :) Le vendredi 9 mai 2014, Johann Martinache notifications@github.com a
|
Comment by paala: Openfl 2.0 has in release notes :.. |
Comment by kiroukou: Hi team. It has been almost 2 months from the moment Shoebox reported that issue. This seems a little bit too low level for me to debug, and I have just no idea of what has been changed. @jgranick do you have any idea ? Please just leave a word to let us know if that could be fixed soon or not, that we can plan what to do here :) |
Comment by hughsando: Looks like you need to attach/detach the calling thread from the hxcpp runtime. |
Comment by hughsando: Also note that you will need to be careful about which thread is used - if you call back from the ui thread, the haxe developer may not expect this - eg, they should not do any DisplayObject manipulation from anything other than the main haxe thread. |
Comment by shoebox: I already tried previously to add the attach / detach thread, but it still crash |
Comment by hughsando: So this: |
Comment by shoebox: Need more tests, but the AutoHaxe seems to fix it ! That's the kind a breaking changes than we shoudl be notified (even if it's not that easy when it's so low level) 2 month of wait solved in 2hours :) 👍 |
Comment by hughsando: You have to pester me if I miss your first request - sometimes I zone out On Thu, Jul 3, 2014 at 7:55 PM, Johann Martinache notifications@github.com
|
Comment by shoebox: Is there any thing of the sort to do on the iOS side ? |
Comment by kiroukou: Will try this fix Hugh ! |
Comment by hughsando: IOS is much simpler because it all runs in the same thread. On Thu, Jul 3, 2014 at 8:57 PM, kiroukou notifications@github.com wrote:
|
Comment by shoebox: I had to remove the : I just kept: After that is seems to work on the iOS too. |
Comment by jgranick: Is this a modification to OpenFL/NME somewhere, or is this in your extension? Thank you! |
Comment by shoebox: It's on the extension side. |
Comment by paala: So, what needs to be modified on your extensions in order to work with latest openFL? |
Comment by kiroukou: I confirm that using AutoHaxe structure is working for us as well ! 2014-07-07 9:33 GMT+02:00 paala notifications@github.com:
|
#216 Issue by shoebox,
Hi Joshua,
Like we talked earlier i still have problems with native extensions & OpenFL 1.4 on Android targets.
I have reported the bug here, because i'm not sure if it's a openfl or hxcpp or NME bug...
I've setup a demo extension here: https://github.com/shoebox/demo-extension/ and a demo app who use the extension in the "demo" folder.
That extension first is passing to CPP the haxe callback method:
https://github.com/shoebox/demo-extension/blob/master/project/common/ExternalInterface.cpp#L36
Then after a delay, the java class call the CPP method, to dispatch a event back to haxe by calling the previously saved callback reference with a argument. (https://github.com/shoebox/demo-extension/blob/master/dependencies/android/src/org/haxe/extension/DemoJavaClass.java#L64) by using that cpp jni method: https://github.com/shoebox/demo-extension/blob/master/project/common/ExternalInterface.cpp#L47
And it crash:
Those calls where working fine previously (more reliable than HaxeObject).
I tried to make the call from another thread, or the ui thread, but it still crash.
Thanks for your help,
Johann //
The text was updated successfully, but these errors were encountered: