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

AGDK Mainloop crashes with 'couldn't find "libmain.so"' #177

Open
pasimko opened this issue Dec 28, 2024 · 1 comment
Open

AGDK Mainloop crashes with 'couldn't find "libmain.so"' #177

pasimko opened this issue Dec 28, 2024 · 1 comment

Comments

@pasimko
Copy link

pasimko commented Dec 28, 2024

I'm compiling for a Kyocera Dura, so it's possible something is weird here. Not familiar with Android (or rust), so let me know if there's other information to include.

logcat
12-27 22:56:21.599  1103   645 I ActivityTaskManager: START u0 {flg=0x14000000 pkg=co.realfit.agdkmainloop cmp=co.realfit.agdkmainloop/.MainActivity} from uid 10045
12-27 22:56:21.602   369   369 I hwservicemanager: getTransport: Cannot find entry [email protected]::IIop/default in either framework or device manifest.
12-27 22:56:21.610  1103   645 D CompatibilityInfo: mCompatibilityFlags - 4
12-27 22:56:21.610  1103   645 D CompatibilityInfo: applicationDensity - 120
12-27 22:56:21.610  1103   645 D CompatibilityInfo: applicationScale - 1.0
12-27 22:56:21.611  1103   645 D ActivityTrigger: ActivityTrigger activityPauseTrigger 
12-27 22:56:21.626  2886  2886 D MainMenuGridActivity: onResume start.
12-27 22:56:21.627  2886  2886 D MainMenuGridActivity: onResume end.
12-27 22:56:21.655   485   485 D Zygote  : Forked child process 1993
12-27 22:56:21.661  1103  1300 I ActivityManager: Start proc 1993:co.realfit.agdkmainloop/u0a110 for activity {co.realfit.agdkmainloop/co.realfit.agdkmainloop.MainActivity}
12-27 22:56:21.671  1993  1993 I it.agdkmainloo: Late-enabling -Xcheck:jni
12-27 22:56:21.732  1993  1993 E it.agdkmainloo: Unknown bits set in runtime_flags: 0x8000
12-27 22:56:21.764  1103  2429 D CompatibilityInfo: mCompatibilityFlags - 4
12-27 22:56:21.765  1103  2429 D CompatibilityInfo: applicationDensity - 120
12-27 22:56:21.765  1103  2429 D CompatibilityInfo: applicationScale - 1.0
12-27 22:56:21.769  1103  2429 D CompatibilityInfo: mCompatibilityFlags - 4
12-27 22:56:21.769  1103  2429 D CompatibilityInfo: applicationDensity - 120
12-27 22:56:21.769  1103  2429 D CompatibilityInfo: applicationScale - 1.0
12-27 22:56:21.785  1764  1764 D ImageWallpaper: wallpaper visibility changes to: true
12-27 22:56:21.788   369   369 I hwservicemanager: getTransport: Cannot find entry [email protected]::IIop/default in either framework or device manifest.
12-27 22:56:21.789  1103  1297 I ActivityTaskManager: Displayed co.realfit.agdkmainloop/.MainActivity: +85ms
12-27 22:56:21.790   369   369 I hwservicemanager: getTransport: Cannot find entry [email protected]::IIop/default in either framework or device manifest.
12-27 22:56:21.815  1764  1764 D ImageWallpaper: wallpaper visibility changes to: false
12-27 22:56:22.178  1993  1993 I Perf    : Connecting to perf service.
12-27 22:56:22.226   369   369 I hwservicemanager: getTransport: Cannot find entry [email protected]::IIop/default in either framework or device manifest.
12-27 22:56:22.227   823   869 E ANDR-IOP: IIop:: Iop HAL Service is not available.
12-27 22:56:22.236  1993  2044 I it.agdkmainloo: Starting a blocking GC Alloc
12-27 22:56:22.236  1993  2044 I it.agdkmainloo: Starting a blocking GC Alloc
12-27 22:56:22.239  1993  1993 I it.agdkmainloo: Waiting for a blocking GC Alloc
12-27 22:56:22.260  1993  1993 I it.agdkmainloo: WaitForGcToComplete blocked Alloc on ClassLinker for 20.858ms
12-27 22:56:22.260  1993  1993 I it.agdkmainloo: Starting a blocking GC Alloc
12-27 22:56:22.292  1993  1993 D AndroidRuntime: Shutting down VM
12-27 22:56:22.297  1993  1993 E AndroidRuntime: FATAL EXCEPTION: main
12-27 22:56:22.297  1993  1993 E AndroidRuntime: Process: co.realfit.agdkmainloop, PID: 1993
12-27 22:56:22.297  1993  1993 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/co.realfit.agdkmainloop-aBzrePH9QmLIN6ZlkMTEIw==/base.apk"],nativeLibraryDirectories=[/data/app/co.realfit.agdkmainloop-aBzrePH9QmLIN6ZlkMTEIw==/lib/arm, /system/lib, /product/lib]]] couldn't find "libmain.so"
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at java.lang.System.loadLibrary(System.java:1667)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at co.realfit.agdkmainloop.MainActivity.<clinit>(MainActivity.java:32)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at java.lang.Class.newInstance(Native Method)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.app.Instrumentation.newActivity(Instrumentation.java:1251)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3183)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:107)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:214)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7397)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
12-27 22:56:22.297  1993  1993 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
12-27 22:56:22.304  1103  2047 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
12-27 22:56:22.305  1103   645 I android_os_HwBinder: HwBinder: Starting thread pool for getting: [email protected]::IQalog/default
12-27 22:56:22.306  1103   645 I ActivityManager: IQalog set call. rescue party crash info : java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/co.realfit.agdkmainloop-aBzrePH9QmLIN6ZlkMTEIw==/base.apk"],nativeLibraryDirectories=[/data/app/co.realfit.agdkmainloop-aBzrePH9QmLIN6ZlkMTEIw==/lib/arm, /system/lib, /product/lib]]] couldn't find "libmain.so"
12-27 22:56:22.306  1103   645 I ActivityManager: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at java.lang.System.loadLibrary(System.java:1667)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at co.realfit.agdkmainloop.MainActivity.<clinit>(MainActivity.java:32)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at java.lang.Class.newInstance(Native Method)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.app.Instrumentation.newActivity(Instrumentation.java:1251)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3183)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.os.Handler.dispatchMessage(Handler.java:107)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.os.Looper.loop(Looper.java:214)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at android.app.ActivityThread.main(ActivityThread.java:7397)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at java.lang.reflect.Method.invoke(Native Method)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
12-27 22:56:22.306  1103   645 I ActivityManager: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
12-27 22:56:22.308  1103   645 W ActivityTaskManager:   Force finishing activity co.realfit.agdkmainloop/.MainActivity
12-27 22:56:22.315  1103   645 D ActivityTrigger: ActivityTrigger activityPauseTrigger 
12-27 22:56:22.320  1993  1993 I Process : Sending signal. PID: 1993 SIG: 9
12-27 22:56:22.405  1103   645 I ActivityManager: Process co.realfit.agdkmainloop (pid 1993) has died: fore TOP 
12-27 22:56:22.406  1103  1301 I libprocessgroup: Successfully killed process cgroup uid 10110 pid 1993 in 0ms
12-27 22:56:22.406   485   485 I Zygote  : Process 1993 exited due to signal 9 (Killed)
12-27 22:56:22.407   369   369 I hwservicemanager: getTransport: Cannot find entry [email protected]::IServicetracker/default in either framework or device manifest.
12-27 22:56:22.414   369   369 I hwservicemanager: getTransport: Cannot find entry [email protected]::IIop/default in either framework or device manifest.
12-27 22:56:22.426  1103  1290 W WindowManager: Failed looking up window callers=com.android.server.wm.WindowManagerService.windowForClientLocked:5404 com.android.server.wm.WindowManagerService.removeWindow:1797 com.android.server.wm.Session.remove:176 
12-27 22:56:22.442   369   369 I hwservicemanager: getTransport: Cannot find entry [email protected]::IIop/default in either framework or device manifest.
12-27 22:56:22.446  1103  1561 E ANDR-PERF-JNI: UXEngine Trigger - Returning null

This is armeabi-v7a, and it looks like the libmain.so is there, so I'm not sure what to do next.

$ tree app/src/main/
app/src/main/
├── AndroidManifest.xml
├── java
│   └── co
│       └── realfit
│           └── agdkmainloop
│               └── MainActivity.java
├── jnilibs
│   └── armeabi-v7a
│       └── libmain.so
└── res

Tangentially, how do I set RUST_BACKTRACE=1 on the device? Figure that will be necessary at some point, and I haven't been able to figure out how. Thanks!

@ibaryshnikov
Copy link

Depending on the device architecture, it might be a target mismatch. I had the same issue, figured out that my device was arm64-v8a. In this case adding other targets might help

cargo ndk -t x86_64 -t armeabi-v7a -t arm64-v8a -o app/src/main/jniLibs/  build

Also lib name must be the same across all of the following:

AndroidManifest.xml

<meta-data android:name="android.app.lib_name" android:value="example" />

MainActivity.java

System.loadLibrary("example");

Cargo.toml

[lib]
name = "example"

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

No branches or pull requests

2 participants