I am trying to run vsomeip Java API example from https://github.com/lixiaolia/ndk-someiplib.
Build is successful but while launching the hello world service I am getting below error.
2022-11-12 21:23:15.966 3598-3598 MainActivity com.example.vsomeiphelloworld D vsomeipBaseDir: /data/user/0/com.example.vsomeiphelloworld/cache/vsomeip
2022-11-12 21:23:15.966 3598-3598 MainActivity com.example.vsomeiphelloworld D Os.getenv("VSOMEIP_BASE_PATH"): /data/user/0/com.example.vsomeiphelloworld/cache/vsomeip/
2022-11-12 21:23:16.024 3598-3598 ServiceVso...rldService com.example.vsomeiphelloworld D onCreate()
2022-11-12 21:23:16.024 3598-3598 ServiceVso...rldService com.example.vsomeiphelloworld D onStartCommand()
2022-11-12 21:23:16.051 3598-3598 AndroidRuntime com.example.vsomeiphelloworld D Shutting down VM
2022-11-12 21:23:16.052 3598-3598 AndroidRuntime com.example.vsomeiphelloworld E FATAL EXCEPTION: main
Process: com.example.vsomeiphelloworld, PID: 3598
java.lang.UnsatisfiedLinkError: dlopen failed: library "libvsomeip3.so" not found: needed by /data/app/~~flBAHgGOZ1GR2qSnIduRoQ==/com.example.vsomeiphelloworld-a_eINFrhrnN_QujTru-l2w==/base.apk!/lib/x86_64/libServiceVsomeipHelloWorldServiceJNI.so in namespace classloader-namespace
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.example.vsomeiphelloworld.ServiceVsomeipHelloWorldService.onStartCommand(ServiceVsomeipHelloWorldService.java:39)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4320)
at android.app.ActivityThread.access$1800(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1951)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7664)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
---------------------------- PROCESS ENDED (3598) for package com.example.vsomeiphelloworld ----------------------------
I have not yet built the Java app since the C++ library itself is being deleted as soon as the Task :app:buildCMakeDebug[x86_64] is over. The cmake file is as below. Strangely the other .so files remain till end of the build - libvsomeip3-cfg, libvsomeip3-e2e, libvsomeip3-sd. Top level Cmake file is as below.
cmake_minimum_required(VERSION 3.4.1)
project(vsomeip-hello-world)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
add_subdirectory(external/boost-cmake)
add_subdirectory(external/vsomeip)
add_subdirectory(external/vsomeip/examples/hello_world)
#add_subdirectory(app/src/main/cpp)
Note: If I uncomment the last line I get "missing libvsomeip3-cfg.so" which is a separate question.
build.gradle file is as below
plugins {
id 'com.android.application'
}
android {
namespace 'com.example.vsomeiphelloworld'
compileSdk 33
defaultConfig {
applicationId "com.example.vsomeiphelloworld"
minSdk 30
targetSdk 33
versionCode 1
versionName "1.0"
ndk {
abiFilters 'x86_64'
}
}
externalNativeBuild {
cmake {
path file('../CMakeLists.txt')
version '3.18.1'
}
}
ndkVersion '22.1.7171670'
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
AGP: 7.2.0
Gradle version: 7.5
NDK version: 22.1.7171670
Android Studio version: 2021.3.1 Patch 1
CMake version: 3.18.1
SDK version: 33
Someone kindly help me understand the issue. A quick fix is also welcome given my project timeline.
We are developing an AR application with google-sceneform sdk, the app is getting crashed on Android 11 (Real Device) after the successful launch. we are able to identify the plane and place an object but after some time it will crash.
So we are trying it on emulator sdk-30. But after running the application it shows Failed to create AR Session.
I have followed the whole steps provided by Google in this Link but it didn't work.
Tried all the steps with android studio 4.1 and SDK-30 with emulator version 30.2.6 which is not worked.
The normal hand sign for scanning the surface is also not shown.
But with SDK-27 it worked. We need the sdk-30 to be worked.
Q1: is the emulator failing issue is a known issue? did anyone faced this before?
This is the log for Emulator.
2020-12-28 16:38:58.742 7153-7153/com.quintar.myapplication E/StandardArFragment: Error: Failed to create AR session
com.google.ar.core.exceptions.UnavailableException
at com.google.ar.sceneform.ux.BaseArFragment.initializeSession(BaseArFragment.java:391)
at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:338)
#### SKIPPING SOME LINES HERE ####
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: com.google.ar.core.exceptions.FatalException: Failed to launch installer.
at com.google.ar.core.p.b(InstallService.java:53)
at com.google.ar.core.p.a(InstallService.java:40)
at com.google.ar.core.InstallActivity.startInstaller(InstallActivity.java:116)
at com.google.ar.core.InstallActivity.access$200(InstallActivity.java:125)
at com.google.ar.core.k.onClick(InstallActivity.java:3)
#### SKIPPING SOME LINES HERE ####
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.ar.core }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2067)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1727)
Q2: it is very much appreciatable if anyone can help me to fix the on Android 11 crash issue.
this is crash log on Android 11 (Real device)
2020-12-21 14:19:01.868 14629-14629/? A/DEBUG: Abort message: 'Scudo ERROR: invalid chunk state when
deallocating address 0x0073944b2ea0
'
2020-12-21 14:19:02.415 14629-14629/? A/DEBUG: #03 pc 00000000000431bc
/apex/com.android.runtime/lib64/bionic/libc.so
(scudo::reportInvalidChunkState(scudo::AllocatorAction, void*)+76) (BuildId:
95f68a34fdf7b31f42d3f811d5d88f58)
2020-12-21 14:19:03.665 1091-6178/? E/AudioSystem: invalid attributes { Content type:
AUDIO_CONTENT_TYPE_UNKNOWN Usage: AUDIO_USAGE_UNKNOWN Source: -1 Flags: 0x800 Tags: } when
converting to stream
2020-12-21 14:19:06.839 895-1615/? E/soundtrigger: audio_extn_sound_trigger_update_stream_status:
invalid input device 0x0, for event 2
In file 'YourProject/app/build.gradle' set the next dependecies for Android Target API 30 with the last of AR Sceneform Library:
android {
defaultConfig {
...
targetSdkVersion 30
...
}
}
dependencies {
...
api "com.google.ar.sceneform:core:1.17.1"
api "com.google.ar.sceneform.ux:sceneform-ux:1.17.1"
api "com.google.ar:core:1.22.0"
...
}
I released my app BUNDLE on Google Play, and it crash at beginning. If I install manually the APK it runs correctly.
This is the error I got:
2020-07-31 13:13:29.944 25035-25086/? E/AndroidRuntime: FATAL EXCEPTION: create_react_context
Process: com.xxxxxxx.xxxxxxx, PID: 25035
java.lang.RuntimeException: Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(Unknown Source:2)
at com.facebook.react.bridge.JSBundleLoader$1.loadScript(Unknown Source:10)
at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(Unknown Source:18)
at com.facebook.react.q.a(Unknown Source:180)
at com.facebook.react.q.a(Unknown Source:0)
at com.facebook.react.q$e.run(Unknown Source:68)
at java.lang.Thread.run(Thread.java:764)
React Native version: 0.62.2
Android gradle plugin version: 3.5.2
Gradle version: 6.0.1
I recently changed the build version:
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
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 am using react native 0.41 and my app crashes with the exception provided below. I unzipped the react native aar but did not found libjsc.so under jni/ folder. How can I provide the libjsc.so?
12-22 17:31:44.103 2273-2273/com.example.sampleapp.photos E/art: dlopen("/data/app/com.example.sampleapp.photos-1/lib/x86/libreactnativejni.so", RTLD_LAZY) failed: dlopen failed: library "libjsc.so" not found
12-22 17:31:44.181 2009-2657/com.google.android.gms E/MDM: [171] wvj.run: Couldn't connect to Google API client: ksj{statusCode=API_UNAVAILABLE, resolution=null, message=null}
12-22 17:31:44.214 2273-2273/com.example.sampleapp.photos E/AndroidRuntime:
FATAL EXCEPTION: main
Process: com.example.sampleapp.photos, PID: 2273
java.lang.UnsatisfiedLinkError: dlopen failed: library "libjsc.so" not found
at java.lang.Runtime.load(Runtime.java:331)
at java.lang.System.load(System.java:981)
at com.facebook.soloader.SoLoader$1.load(SoLoader.java:279)
at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:69)
at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:40)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:427)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:367)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:332)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:24)
at com.facebook.react.bridge.ReactBridge.<clinit>(ReactBridge.java:20)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:24)
at com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:22)
at com.facebook.react.JSCConfig$1.getConfigMap(JSCConfig.java:14)
at com.facebook.react.XReactInstanceManagerImpl.recreateReactContextInBackgroundFromBundleLoader(XReactInstanceManagerImpl.java:431)
at com.facebook.react.XReactInstanceManagerImpl.recreateReactContextInBackgroundInner(XReactInstanceManagerImpl.java:426)
at com.facebook.react.XReactInstanceManagerImpl.createReactContextInBackground(XReactInstanceManagerImpl.java:370)
at com.facebook.react.ReactRootView.startReactApplication(ReactRootView.java:215)
at com.example.reactnative.ReactActivity.runReactComponent(ReactActivity.java:107)
at com.example.reactnative.ReactActivity.createReactComponentView(ReactActivity.java:120)
at com.example.reactnative.ReactActivity.onCreate(ReactActivity.java:49)
Try these things
locating the gradle.properties file in the root project, and add
Android.useDeprecatedNdk=true
and in build.gradle add this
android {
...
defaultConfig {
...
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
}