AOF-Dev / MCinaBox

MCinaBox - A Minecraft: Java Edition Launcher for Android. An Encapsulation of [CosineMath's BoatApp](https://github.com/AOF-Dev/BoatApp).
GNU General Public License v3.0
1.27k stars 179 forks source link

Crashing when starting the game #532

Open iscle opened 4 years ago

iscle commented 4 years ago

When trying to start any version of the game, the app crashes.

Upon closer inspection, logcat shows the following:

Error while loading /data/user/0/com.aof.mcinabox/files/runtime/boat/j2re-image/lib/aarch64/libfreetype.so.6: dlopen failed: library "libpng16.so.16" not found.

It seems like libpng16.so.16 is not available, and a library for Java can't be dlopened. Then, the following error appears: E/libEGL: call to OpenGL ES API with no current context (logged once per thread)

If I try to launch it again, it crashes the entire app like this:

2020-10-14 17:49:59.323 22318-22318/com.aof.mcinabox E/Boat: onNativeWindowCreated: 0x74210bf010 2020-10-14 17:49:59.326 22318-29315/com.aof.mcinabox E/loadme: Error while loading /data/user/0/com.aof.mcinabox/files/runtime/boat/j2re-image/lib/aarch64/libfreetype.so.6: dlopen failed: library "libpng16.so.16" not found. 2020-10-14 17:49:59.359 22318-22318/com.aof.mcinabox A/libc: FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x7510ff1110) 2020-10-14 17:49:59.360 22318-28874/com.aof.mcinabox A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4 in tid 28874 (RenderThread), pid 22318 (om.aof.mcinabox)

I have been looking at the native code but could not find any mutex lock. I'll keep looking.

iscle commented 4 years ago

I was using a custom build I set to compile version 30, but now, after reverting to the project defaults, I'm having this error: 2020-10-14 18:04:08.795 23965-31797/com.aof.mcinabox E/linker: library "/data/user/0/com.aof.mcinabox/files/runtime/boat/libglfw.so" ("/data/data/com.aof.mcinabox/files/runtime/boat/libglfw.so") needed or dlopened by "(unknown)" is not accessible for the namespace: [name="(anonymous)", ld_library_paths="", default_library_paths="/data/app/com.aof.mcinabox-WrNfSQMnzuQ2atXInFOlIA==/lib/arm64:/data/app/com.aof.mcinabox-WrNfSQMnzuQ2atXInFOlIA==/base.apk!/lib/arm64-v8a", permitted_paths=""]

Strange...

Edit: I think this is because I'm on Android 10.

iscle commented 4 years ago

Okay, is there anywhere in the runtime libs that you are requesting a dlopen of "libglfw.so"?

Since those are precompiled binaries I can't check it. How are those files built?

longjunyu2 commented 4 years ago

@Iscle Hi. We use Android NDK n10e with target api 21 to build the libglfw.so This is a strange exception which only occours on aarch64. If you want to get the source ,
https://github.com/CosineMath/glfw-boat-old

iscle commented 4 years ago

Thanks! I will look into it.

I'm also working on refactoring the android java code for the launcher/app, since it's quite messy and uses weird methods to manage the UI, as well as static methods which are not encouraged in OOP. It's going to be quite a big change, so I don't know how to do it so that it can get merged. Can we talk via Telegram or some other chat?

I'm also translating the chinese code comments to english, so that everyone can understand them.