barsoosayque / libgdx-oboe

🎶 libGDX audio replacement for Android (API 16+) built on top of Oboe.
MIT License
54 stars 10 forks source link

Crashes on Google pre-paunch report #15

Closed yarnee closed 1 year ago

yarnee commented 1 year ago

First of all i would like to thank you for this repo & implementation! I hope to be able to avoid any glitches i have in our currently developing audio app, which only occur on android devices. So i did include libgdx-oboe im my libGDX project, everything run perfectly with the debug aar. After trying releasing it i had to add some dependancies ( do not use kotlin, just pure Java, in my case org.jetbrains.kotlin:kotlin-stdlib-jdk7 was missing, this may be something you could add in the docs)

Anyway, i was actually able to deploy the release version on my devices, test it successfully and decided to upload on google store. Google runs after the upload some tests on the application and in my case there were for 2 test devices the following issue:

Exception java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "iconv_open" referenced by "/data/app/com.xxxx.yyyy-PpC-eyYveCd_4D3q4iVarg==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libavcodec.so"... at java.lang.Runtime.loadLibrary0 (Runtime.java:1016) at java.lang.System.loadLibrary (System.java:1657) at barsoosayque.libgdxoboe.OboeAudio.<init> (OboeAudio.java) at com.immons.trace.AndroidLauncher.createAudio (AndroidLauncher.java) at com.badlogic.gdx.backends.android.AndroidApplication.init (AndroidApplication.java) at com.badlogic.gdx.backends.android.AndroidApplication.initialize (AndroidApplication.java) at com.immons.trace.AndroidLauncher.onCreate (AndroidLauncher.java) at android.app.Activity.performCreate (Activity.java:7174) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2908) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3030) at android.app.ActivityThread.-wrap11 (ActivityThread.java) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1696) at android.os.Handler.dispatchMessage (Handler.java:105) at android.os.Looper.loop (Looper.java:164) at android.app.ActivityThread.main (ActivityThread.java:6938) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

The affected devices were "samsung SM-G960U1" (Android 8.0 (SDK 26) - arm64-v8a) and Nokia Nokia 1 (SDK 27 but armeabi, which we will exclude because do not support this ABI). I would be very grateful for any suggestion and possible solution to this problem. Regards, Yarnee

barsoosayque commented 1 year ago

Have you tried building master branch ? Seems like an obscure NDK error, which I updated several weeks ago. I also updated the batch of native libraries and SDK version, might help too.

As for kotlin dependency, since I don't write java code, I was pretty much comfortable with koltin. Didn't know it would require end users to also have a dependency on kotlin. I would gladly merge PR which would change kotlin to java in library sources.

yarnee commented 1 year ago

I will give it a try and update the status here & will exchange the *.so libraries and build the aar lib-files again !

yarnee commented 1 year ago

Hello again, i did try the following: a) did not rebuild the dependencies, do run on a mac and not on a unix machine, so i couldn't build them. b)So i did build again the library, which created 2 files, a debug and a release one, c) copied the *.so files in my natives libs dir, and d) finally i copied the generated aar libs in my lib file and generated my signed bundle ! Unfortunately, the issue is still there, so the decision is to exclude some devices which do not much our criteria (everything after Android 9, RAM with more than 500k etc.) But in case you do have any other suggestions, please feel free ! ps: forgot to mention that i also updated the kotlin lib for JDK8 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20) Find attached the whole logcat excerpt of the prelaunch report of the failed device [Uploading logcat.txt…]

barsoosayque commented 1 year ago

Hmmm. Doesn't seem right. You don't have to build ffmpeg manually, it's prebuilt and located in library/libs. Those *.so files should be inside AAR after the build, as far as I remember you can inspect AAR in Android Studio (just to make sure). Anyways, it seems to be unrelated, since from the crash log it looks like a linkage error or some sort of build error. I'll try to fiddle with cmake to get around this issue (hopefully).

barsoosayque commented 1 year ago

Ah. Seems like one of the ffmpeg libraries didn't disable iconv even though it should be autodetected to "no". And according to android ndk's sources, iconv is available for SDK 28+, so probably that's why those devices produced a crash. Can you try building the master once again ? I've updated ffmpeg libraries in 46f4da5

yarnee commented 1 year ago

Thanks a lot @barsoosayque , thanks a lot for the fast service
The pre-launch report does not show any issues after the last update of the release libs.

barsoosayque commented 1 year ago

Great ! Glad I could resolve this issue, even though it were abysmal NDK insides again