You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unzip this aar file, extract jni/arm64-v8a/libtensorflowlite_jni.so
cd jni/arm64-v8a
cp libtensorflowlite_jni.so libxxxxtensorflowlite.so
patchelf-win64-0.18.0.exe --set-soname libxxxxtensorflowlite.so libxxxxtensorflowlite.so
Create a new Native project using Android Studio,
Modify the CMakeLists.txt,
target_link_libraries(${CMAKE_PROJECT_NAME}
# List libraries link to the target library
android
..../libtensorflowlite_jni.so
..../libxxxxtensorflowlite.so
log)
Remember to only build arm64 version (change gradle).
Run the app in android machine, will crash.
16:09:05.009 E FATAL EXCEPTION: main
Process: com.example.myapplication, PID: 3889
java.lang.UnsatisfiedLinkError: dlopen failed: cannot find "alizedOrThrow" from verneed[0] in DT_NEEDED list for "/data/app/~~vfaTCJFVfTxMw5UuEsnC6g==/com.example.myapplication-YOMgEdBU7xuzUrYWu0oSVw==/base.apk!/lib/arm64-v8a/libxxxxtensorflowlite.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1082)
at java.lang.Runtime.loadLibrary0(Runtime.java:1003)
at java.lang.System.loadLibrary(System.java:1661)
at com.example.myapplication.MainActivity.<clinit>(MainActivity.java:14)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
at android.app.Instrumentation.newActivity(Instrumentation.java:1339)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4053)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4340)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2584)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Expected behavior
dlopen success.
only link original so is work.
only link modified so is not work.
Describe the bug
After modifying SONAME, dlopen failed with an error message "alizedOrThrow", while original .so is good.
Steps To Reproduce
Need android environment.
Create a new Native project using Android Studio,
Modify the CMakeLists.txt,
Remember to only build arm64 version (change gradle).
Run the app in android machine, will crash.
Expected behavior
dlopen success.
only link original so is work.
only link modified so is not work.
patchelf --version
outputpatchelf-win64-0.18.0.exe --version
patchelf 0.18.0
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: