Tag Archives: #Android error

[Solved] java.lang.UnsatisfiedLinkError: dlopen failed: /lib/arm64/libc++_shared.so not found

java.lang.UnsatisfiedLinkError: dlopen failed: /lib/arm64/libc++_shared.so not found

1. Error description

When using other so libraries, sometimes you may encounter libc++_shared.so library cannot be found:

java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.niuba.demo-t5NvrZc62MoQOW2PzC1Rvw==/lib/arm64/libc++_shared.so" not found

 

2. Cause of error

The so library used depends on the libc++_shared.so library file

3. Solutions

Go to any ndk version directory in the ndk directory, there are various versions in the llvm-libc++\libs directory

For example:

ndk\23.1.7779620\sources\cxx-stl\llvm-libc++\libs

 

[Solved] open failed: ENOENT (No such file or directory)

open failed: ENOENT (No such file or directory)

1. Error description

The following error occurred while writing the file to sdcard:

open failed: ENOENT (No such file or directory)

2. Error analysis

At first, I thought I forgot to add read-write permission, which was checked.

Finally, when I think of android10 onwards, in addition to the dynamic application of permissions, you must add in the Application node of AndroidManifest.xml of the main application.

android:requestLegacyExternalStorage="true"

3. Solution

Add the following codes in the Application node of AndroidManifest.xml of the main application:

android:requestLegacyExternalStorage="true"

 

[Solved] JNI Error: ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)

1. Error description

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)

What went wrong:
Execution failed for task ‘:app:externalNativeBuildDebug’.

Build command failed.
Error while executing process D:\ProgramFiles\Android\sdk\cmake\3.6.4111459\bin\cmake.exe with arguments

2. Cause of error

When developing JNI, this error occurs during compilation. It may be that the path of NDK is not set

3. Solutions

Add the path to the NDK in local.properties in the project directory
eg:

ndk.dir=D\:\\ProgramFiles\\Android\\sdk\\ndk\\21.3.6528147