finagolfin / swift-android-sdk

Android SDKs for Swift
Apache License 2.0
151 stars 15 forks source link

Android flexible page size #165

Closed marcprux closed 2 months ago

marcprux commented 2 months ago
08-09 01:03:36.496  9671  9671 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~do_xtELX_PnCY5pj59WGfA==/demo.droid.app-SNy-6TDammHKyRAAG-mPpg==/base.apk!/lib/arm64-v8a/libdispatch.so" (new hash type from the future?)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at java.lang.Runtime.loadLibrary0(Runtime.java:1082)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at java.lang.Runtime.loadLibrary0(Runtime.java:1003)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at java.lang.System.loadLibrary(System.java:1661)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at demo.droid.AndroidAppMain.onCreate(Main.kt:34)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6998)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:205)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:294)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:8177)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
08-09 01:03:36.496  9671  9671 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
marcprux commented 2 months ago

Turns out the "empty/missing DT_HASH/DT_GNU_HASH" error is a red herring. The problem seems to just stem from the stripping of libdispatch.so, which can be avoided with the build.gradle.kts declaration:

android {
    packaging {
        jniLibs.keepDebugSymbols.add("**/libdispatch.so")
    }
}