SempaiGames / haxe-ga

GoogleAnalytics Client API port to Haxe
Other
60 stars 23 forks source link

Strange JNI exception on android #19

Closed grapefrukt closed 11 months ago

grapefrukt commented 9 years ago

I'm trying to integrate this library into a game I'm working on and it's all fine and dandy on Flash and native Windows builds (haven't tested OS X or iOS yet), but on Android I get this exception on startup:

E/HXCPP   (17136): Called from *::closure extension/locale/Locale.hx line 7
E/HXCPP   (17136): Called from openfl._legacy.utils.JNI::createStaticMethod openfl/_legacy/utils/JNI.hx line 123
E/HXCPP   (17136): Called from extern::cffi C:/files/tools/sdks/haxe/haxe/lib/hxcpp/3,2,102/src/hx/Lib.cpp line 159
E/Exception(17136): JNI Exception

I have tried using the provided sample code in a separate project and that does indeed work, both for legacy and "next" builds both with the provided example tracking id and my own.

The issue with my project persists even when I disable everything but the bare skeleton of the app calling (or simply mentioning) your library still causes the exception. Nor does it help removing the entire build directory to get a fresh rebuild.

I'm currently trying to figure out exactly why this is happening, but figured I'd make this issue here in case you have any bright ideas.

grapefrukt commented 9 years ago

Disabling the JNI call on line 7 in Locale.hx (https://github.com/SempaiGames/extension-locale/blob/master/extension/locale/Locale.hx#L7) and letting it simply return en fixes the crash and as best I can tell the logging still works.

DanielUranga commented 9 years ago

Does the test project of extension-locale work for you? https://github.com/SempaiGames/extension-locale/tree/master/test