Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android modules are unusable #6590

Closed
WalasPrime opened this issue Sep 23, 2016 · 9 comments
Closed

Android modules are unusable #6590

WalasPrime opened this issue Sep 23, 2016 · 9 comments

Comments

@WalasPrime
Copy link
Contributor

WalasPrime commented Sep 23, 2016

Windows 10, current master

I've tried to test an Ad module for Godot, but I've ran into issues where the app crashes (on a physical device). I thought it's the module's fault, so I've created my own minimalistic android module for testing. Throws the same error in adb logcat:

D/GODOT   ( 4511): ** GODOT ACTIVITY CREATED HERE ***
D/ActivityManager(  374): getContentProviderImpl  return 6. result = android.app.IActivityManager$ContentProviderHolder@4374df50
D/Settings/Provide(  374): lookupValue table secure cache contains Key android_id value = Bundle[{value=af838e39ea9bc551}]
V/Provider/Setting( 4511): from db cache, name = android_id value = af838e39ea9bc551
W/dalvikvm( 4511): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/godotengine/godot/GodotLib;
D/AndroidRuntime( 4511): Shutting down VM
W/dalvikvm( 4511): threadid=1: thread exiting with uncaught exception (group=0x41e79908)
E/AndroidRuntime( 4511): FATAL EXCEPTION: main
E/AndroidRuntime( 4511): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 4511):        at org.godotengine.godot.Godot.initializeGodot(Godot.java:377)
E/AndroidRuntime( 4511):        at org.godotengine.godot.Godot.onCreate(Godot.java:563)
E/AndroidRuntime( 4511):        at android.app.Activity.performCreate(Activity.java:5020)
E/AndroidRuntime( 4511):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
E/AndroidRuntime( 4511):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
E/AndroidRuntime( 4511):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
E/AndroidRuntime( 4511):        at android.app.ActivityThread.access$600(ActivityThread.java:181)
E/AndroidRuntime( 4511):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1332)
E/AndroidRuntime( 4511):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 4511):        at android.os.Looper.loop(Looper.java:153)
E/AndroidRuntime( 4511):        at android.app.ActivityThread.main(ActivityThread.java:5042)
E/AndroidRuntime( 4511):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4511):        at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 4511):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
E/AndroidRuntime( 4511):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
E/AndroidRuntime( 4511):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 4511): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load godot_android: findLibrary returned null
E/AndroidRuntime( 4511):        at java.lang.Runtime.loadLibrary(Runtime.java:365)
E/AndroidRuntime( 4511):        at java.lang.System.loadLibrary(System.java:535)
E/AndroidRuntime( 4511):        at org.godotengine.godot.GodotLib.<clinit>(GodotLib.java:39)
E/AndroidRuntime( 4511):        ... 16 more
V/Provider/Setting(  374): from settings cache , name = dropbox:data_app_crash value = disabled
D/dalvikvm(  374): create interp thread : stack size=32KB
D/dalvikvm(  374): create new thread
D/dalvikvm(  374): update thread list
D/dalvikvm(  374): threadid=77: interp stack at 0x54025000
D/dalvikvm(  374): threadid=77: created from interp
D/dalvikvm(  374): start new thread
V/Provider/Setting(  374): from settings cache , name = send_action_app_error value = 1
W/ActivityManager(  374):   Force finishing activity org.godotengine.androidmoduletest/org.godotengine.godot.Godot

I've checked the godot_android file existance. It's path is "\platform\android\java\libs\release\armeabi-v7a\libgodot_android.so". Compiling fresh apk's and exe's from current master do not cause a crash (often the screen blinks, godot restarts 10 times/sec, but that's another issue I guess 😄 ).

You can lookup the module here (2 newest commits): https://github.com/WalasPrime/godot/commits/android_module_test

@volzhs
Copy link
Member

volzhs commented Sep 23, 2016

I made and tested several modules for android personally, but I have not faced this.

@WalasPrime
Copy link
Contributor Author

WalasPrime commented Sep 23, 2016

Tried this on another phone, same exception. I've tried compiling on Linux, so far same results, but haven't tested everything just yet. I guess it would be helpful if someone tried to compile (and run the test project) in that android_module_test branch on their side.

@WalasPrime
Copy link
Contributor Author

Just noticed, resulting android_debug.apk size is 617 Kb with a custom android module (13,2 Mb without). Seems like something is going wrong during the compilation, but there are no errors, even after cleaning the whole repository with git clean -xf. I've also tried gradlew clean, still the resulting _debug.apk is small (_release has approximately the same size as without the custom module).

@punto-
Copy link
Contributor

punto- commented Sep 28, 2016

looks like it's not including the .so with the engine. Can you unzip the
apk and look in lib/ ?

On 28 September 2016 at 14:12, Karol Walasek notifications@github.com
wrote:

Just noticed, resulting android_debug.apk size is 617 Kb with a custom
android module (13,2 Mb without). Seems like something is going wrong
during the compilation, but there are no errors, even after cleaning the
whole repository with git clean -xf. I've also tried gradlew clean, still
the resulting _debug.apk is small (_release has approximately the same size
as without the custom module).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#6590 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGVmPXXxscuOw1dcJ1XyLzci0uQG4Dyaks5quqAXgaJpZM4KE36z
.

@WalasPrime
Copy link
Contributor Author

I've switched to target=release and suddenly everything compiles properly, even the test module works. It produces both _debug and _release apk's, which is odd... I think there was an undocumented change in the android buildsystem. I'll continue to look for the cause of my issues, I'll close this thread as soon as I find anything specific to be fixed.

@kubecz3k
Copy link
Member

@WalasPrime from your last message I'm assuming everything is fine with this issue at this point, so I will close it, please let us know if there are still any issues and I will reopen it :)

@kubecz3k kubecz3k added archived and removed bug labels Jan 25, 2017
@divineslight
Copy link

It produces both _debug and _release apk's, which is odd... I think there was an undocumented change in the android buildsystem

@WalasPrime so any more info on this? do we just build platform tools for android both debug and release by passing target=release?

@WalasPrime
Copy link
Contributor Author

I no longer have an android dev setup so I can't check the current branches. Keep in mind this case is specific to using custom modules. I believe the buildsystem changed quite a lot since then, this issue might not be valid anymore.

If you happen to stumble upon this bug please create a new issue, or if you can confirm that this no longer applies please leave a proper comment.

@divineslight
Copy link

@WalasPrime building with target=release still builds fake/buggy debug release .apk
Running it again with target=release_debug fixes the debug apk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants