I've created an Android app using RenderScript, it works on a wide variety of systems but it seems to not run on specifically the Pixel 5.
I have tried to debug it with a real device but I cannot find the source of the issue.
I get the following errors (yuv420888.so is my RS file):
Failed loading RS driver: dlopen failed: library "libRSDriver_adreno.so
Failed to load runtime libRSDriver_adreno.so, loading default
...
Unable to open shared library (/data/user_de/0/com.example.app/code_cache/com.android.renderscript.cache/librs.yuv420888.so): (null)
And then I get a larger stack of errors about some unimplemented method:
2022-01-26 11:49:30.190 4366-4972/com.example.app E/CameraCaptureSession: Session 0: Exception while stopping repeating:
android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): cancelRequest:459: Camera 0: Error clearing streaming request: Function not implemented (-38)
at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:1009)
at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRequest(ICameraDeviceUserWrapper.java:99)
at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1251)
at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:578)
at android.hardware.camera2.impl.CameraCaptureSessionImpl$2.onDisconnected(CameraCaptureSessionImpl.java:789)
at android.hardware.camera2.impl.CameraDeviceImpl$7.run(CameraDeviceImpl.java:245)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: android.os.ServiceSpecificException: cancelRequest:459: Camera 0: Error clearing streaming request: Function not implemented (-38) (code 10)
at android.os.Parcel.createExceptionOrNull(Parcel.java:2387)
at android.os.Parcel.createException(Parcel.java:2357)
at android.os.Parcel.readException(Parcel.java:2340)
at android.os.Parcel.readException(Parcel.java:2282)
at android.hardware.camera2.ICameraDeviceUser$Stub$Proxy.cancelRequest(ICameraDeviceUser.java:732)
at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRequest(ICameraDeviceUserWrapper.java:97)
For info:
Here are some random interesting settings from my gradle files:
classpath 'com.android.tools.build:gradle:3.3.3'
classpath 'com.google.gms:google-services:4.1.0'
...
multiDexEnabled
renderscriptTargetApi 23
renderscriptSupportModeEnabled false
...
ndkVersion '20.1.5948944'
...
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
moduleName "my_lib"
ldLibs "log"
}
What could be the issue?
I'm trying to install ffmpeg-kit-react-native into my app, but the app crash when I start it on my device.
The error log:
2022-01-04 11:02:19.754 6679-6728/com.indivibookvideo E/AndroidRuntime: FATAL EXCEPTION: create_react_context
Process: com.indivibookvideo, PID: 6679
java.lang.Error: FFmpegKit failed to start on brand: Redmi, model: M2103K19G, device: camellian, api level: 30, abis: arm64-v8a armeabi-v7a armeabi, 32bit abis: armeabi-v7a armeabi, 64bit abis: arm64-v8a.
at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:50)
at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:189)
at com.arthenica.ffmpegkit.FFmpegKitConfig.<clinit>(FFmpegKitConfig.java:145)
at com.arthenica.ffmpegkit.FFmpegKitConfig.enableFFmpegSessionCompleteCallback(FFmpegKitConfig.java:864)
at com.arthenica.ffmpegkit.reactnative.FFmpegKitReactNativeModule.registerGlobalCallbacks(FFmpegKitReactNativeModule.java:168)
at com.arthenica.ffmpegkit.reactnative.FFmpegKitReactNativeModule.<init>(FFmpegKitReactNativeModule.java:135)
at com.arthenica.ffmpegkit.reactnative.FFmpegKitReactNativePackage.createNativeModules(FFmpegKitReactNativePackage.java:37)
at com.facebook.react.ReactPackageHelper.getNativeModuleIterator(ReactPackageHelper.java:42)
at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:42)
at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1347)
at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1318)
at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1240)
at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:131)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1023)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "av_log_default_callback" referenced by "/data/app/~~ND_-wXIgMVuMMF9lccD4sg==/com.indivibookvideo--UwQec7E4IjmttOF7QiG9A==/lib/arm64/libffmpegkit.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
at java.lang.System.loadLibrary(System.java:1664)
at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:48)
at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:189)
at com.arthenica.ffmpegkit.FFmpegKitConfig.<clinit>(FFmpegKitConfig.java:145)
at com.arthenica.ffmpegkit.FFmpegKitConfig.enableFFmpegSessionCompleteCallback(FFmpegKitConfig.java:864)
at com.arthenica.ffmpegkit.reactnative.FFmpegKitReactNativeModule.registerGlobalCallbacks(FFmpegKitReactNativeModule.java:168)
at com.arthenica.ffmpegkit.reactnative.FFmpegKitReactNativeModule.<init>(FFmpegKitReactNativeModule.java:135)
at com.arthenica.ffmpegkit.reactnative.FFmpegKitReactNativePackage.createNativeModules(FFmpegKitReactNativePackage.java:37)
at com.facebook.react.ReactPackageHelper.getNativeModuleIterator(ReactPackageHelper.java:42)
at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:42)
at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1347)
at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1318)
at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1240)
at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:131)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1023)
at java.lang.Thread.run(Thread.java:923)
2022-01-04 11:02:19.770 6679-6724/com.indivibookvideo E/ion: ioctl c0044901 failed with code -1: Invalid argument
2022-01-04 11:02:19.853 6679-6679/com.indivibookvideo E/SensorManager: Qcd unregisterListenerImpl, by:com.facebook.react.common.ShakeDetector
I am using Unity in combination with a custom NDK-Library, inside my app.
My problem is that if I try to start the Activity hosting Unity, the process always crashes with the message:
E/Unity: Unable to find main
and a alertBox from Unity:
Title:Failure to initialize!
Message: Your hardware doesn't support this Application
After some trying arround, I got the solution that I have to add the following into my gradle File:
android{
...
defaultConfig{
...
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
}
...
}
after doing this Unity runs without Errors, but when I start an Activity housing my own NDK-Library it crashes with the Error.
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/de.biosign.daimlerhrv-2/base.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_dependencies_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_0_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_1_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_2_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_3_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_4_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_5_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_6_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_7_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_8_apk.apk", zip file "/data/app/de.biosign.daimlerhrv-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/de.biosign.daimlerhrv-2/lib/arm64, /system/lib64, /vendor/lib64, /system/vendor/lib64]]] couldn't find "libMyLib.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:972)
at java.lang.System.loadLibrary(System.java:1530)
at de.biosign.sessioncomponents.session.RunningSession.<clinit>(RunningSession.java:34)
at de.biosign.mvc.session.sessionController.SessionController.<init>(SessionController.java:63)
at de.biosign.biofeedbackunity.BiofeedbackUnity.onCreate(BiofeedbackUnity.java:109)
at android.app.Activity.performCreate(Activity.java:6666)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
Has anyone got a solution for this problem and can give me a Hint.
Thanks
According to your error logs
Caused by: java.lang.UnsatisfiedLinkError: ...... /system/lib64, /vendor/lib64, /system/vendor/lib64
It looks your device is 64-bit. But your abiFilters 'armeabi-v7a', 'x86' is only for 32-bit.
So, the possible solution to your problems may be as below adding 64-bit ABIs into the abiFilters:
abiFilters 'armeabi-v7a', 'x86', 'arm64-v8a', 'x86_64'
Cross check:
Android NDK - Using libraries compiled with a different API level
How do we identify libraries build with NDK is 64-bit supported?
The solution for me was to add the following to my Android.mk:
(See also at https://developer.android.com/ndk/guides/android_mk)
TARGET_ARCH : armeabi-v7a x86
so my libs became, generated for this architecture, it runs again beside Unity,
According to some posts newer Versions of above 2017.4 Unity already support 64 bits, but for my work am using 5.6, so can use this.
For others using 2017.4 or above there is the link:
https://developer.android.com/distribute/best-practices/develop/64-bit#unity_developers
I succesfully compiled PJSIP library for Android. Sample project works without any problems when I build for default architecture armeabi. Now I tried to compile library for arch such as armeabi-v7a and arm64-v8a. Unfortunately when I add libraries to project in appropriate folders (jnLibs/armeabi-v7a and jniLibs/arm64-v8a) application is not starting...
To setup build for different archs I use this command:
NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags
I have this error on app launch:
07-04 12:28:46.079 15317-15317/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.futuremind.omili, PID: 15317
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "getifaddrs" referenced by "/data/app/com.futuremind.omili-1/lib/arm/libpjsua2.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at com.futuremind.omili.MyApp.<clinit>(MyApp.java:293)
at com.futuremind.omili.MainActivity.onCreate(MainActivity.java:87)
at android.app.Activity.performCreate(Activity.java:6289)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2405)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2535)
at android.app.ActivityThread.access$900(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5497)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Thanks for any help! :)
I was able to fix this error by updating the AndroidManifest.xml in "pjsip-apps/src/swig/java/android/app/src/main" to match my android target -- in my case to "23". Then "make clean" and another "make" in "pjsip-apps/src/swig", and rebuilding my app.
I have an app using old so library compiled only for armeabi, But I have to write some new native code in C file NativeCode.c and compile it with app.
Old library is running correctly only when I set in the build.gradle
ndk {
moduleName "NativeCode"
abiFilters "armeabi"
}
But when I run app on arm64-v8a phone always get an error:
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.app.module, PID: 4199
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.app.module-2/base.apk"],nativeLibraryDirectories=[/data/app/com.app.module-2/lib/arm64, /data/app/com.app.module-2/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libnativecode.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.app.module.util.NativeCode.<clinit>(NativeCode.java:25)
Is there any way to tell android studio to build native code only for armeabi ?