Android nd4j not work?

Hi,I’m here again. I’m working on Android ,using ND4J and DL4J.However the Nd4j not work,here are the exception stack.

E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
W/System.err: Warning: Version of org.bytedeco:openblas could not be found.
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/linker: normalize_path - invalid input: "lib/", the input path should be absolute
W/linker: Warning: unable to normalize "lib/" (ignoring)
E/AndroidRuntime: FATAL EXCEPTION: Thread-2
    Process: com.qq12cvhj.karaoke, PID: 12394
    java.lang.ExceptionInInitializerError
        at org.nd4j.nativeblas.NativeOpsHolder.getInstance(NativeOpsHolder.java:119)
        at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:86)
        at java.lang.Class.newInstance(Native Method)
        at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5178)
        at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5092)
        at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:270)
        at org.nd4j.linalg.factory.Nd4j.createFromArray(Nd4j.java:5995)
        at com.dkzy.extractor.Extractor.extractorInternal(Extractor.java:37)
        at com.dkzy.extractor.Extractor.extract(Extractor.java:83)
        at com.qq12cvhj.karaoke.MainActivity.pretreatAudioFile(MainActivity.java:101)
        at com.qq12cvhj.karaoke.MainActivity.access$100(MainActivity.java:34)
        at com.qq12cvhj.karaoke.MainActivity$2.run(MainActivity.java:117)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.lang.RuntimeException: ND4J is probably missing dependencies. For more information, please refer to: https://deeplearning4j.konduit.ai/nd4j/backend
        at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:112)
        at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:35)
        at org.nd4j.nativeblas.NativeOpsHolder.getInstance(NativeOpsHolder.java:119) 
        at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:86) 
        at java.lang.Class.newInstance(Native Method) 
        at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5178) 
        at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5092) 
        at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:270) 
        at org.nd4j.linalg.factory.Nd4j.createFromArray(Nd4j.java:5995) 
        at com.dkzy.extractor.Extractor.extractorInternal(Extractor.java:37) 
        at com.dkzy.extractor.Extractor.extract(Extractor.java:83) 
        at com.qq12cvhj.karaoke.MainActivity.pretreatAudioFile(MainActivity.java:101) 
        at com.qq12cvhj.karaoke.MainActivity.access$100(MainActivity.java:34) 
        at com.qq12cvhj.karaoke.MainActivity$2.run(MainActivity.java:117) 
        at java.lang.Thread.run(Thread.java:764) 
     Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found
        at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
        at java.lang.System.loadLibrary(System.java:1669)
        at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1631)
        at org.bytedeco.javacpp.Loader.load(Loader.java:1265)
        at org.bytedeco.javacpp.Loader.load(Loader.java:1109)
        at org.nd4j.nativeblas.Nd4jCpu.<clinit>(Nd4jCpu.java:14)
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:453)
        at java.lang.Class.forName(Class.java:378)
        at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:85)
        at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:35) 
        at org.nd4j.nativeblas.NativeOpsHolder.getInstance(NativeOpsHolder.java:119) 
        at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:86) 
        at java.lang.Class.newInstance(Native Method) 
        at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5178) 
        at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5092) 
        at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:270) 
        at org.nd4j.linalg.factory.Nd4j.createFromArray(Nd4j.java:5995) 
        at com.dkzy.extractor.Extractor.extractorInternal(Extractor.java:37) 
        at com.dkzy.extractor.Extractor.extract(Extractor.java:83) 
        at com.qq12cvhj.karaoke.MainActivity.pretreatAudioFile(MainActivity.java:101) 
        at com.qq12cvhj.karaoke.MainActivity.access$100(MainActivity.java:34) 
        at com.qq12cvhj.karaoke.MainActivity$2.run(MainActivity.java:117) 
        at java.lang.Thread.run(Thread.java:764) 
     Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found
        at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
        at java.lang.System.loadLibrary(System.java:1669)
        at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1631)
        at org.bytedeco.javacpp.Loader.load(Loader.java:1213)
        at org.bytedeco.javacpp.Loader.load(Loader.java:1109) 
        at org.nd4j.nativeblas.Nd4jCpu.<clinit>(Nd4jCpu.java:14) 
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:453) 
        at java.lang.Class.forName(Class.java:378) 
        at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:85) 
        at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:35) 
        at org.nd4j.nativeblas.NativeOpsHolder.getInstance(NativeOpsHolder.java:119) 
        at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:86) 
        at java.lang.Class.newInstance(Native Method) 
        at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5178) 
        at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5092) 
        at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:270) 
        at org.nd4j.linalg.factory.Nd4j.createFromArray(Nd4j.java:5995) 
        at com.dkzy.extractor.Extractor.extractorInternal(Extractor.java:37) 
        at com.dkzy.extractor.Extractor.extract(Extractor.java:83) 
        at com.qq12cvhj.karaoke.MainActivity.pretreatAudioFile(MainActivity.java:101) 
        at com.qq12cvhj.karaoke.MainActivity.access$100(MainActivity.java:34) 
        at com.qq12cvhj.karaoke.MainActivity$2.run(MainActivity.java:117) 
        at java.lang.Thread.run(Thread.java:764) 
I/Process: Sending signal. PID: 12394 SIG: 9

Oh,and there’s just one line code:

INDArray wav = Nd4j.createFromArray(wavData);

I’m working on Android,the gradle config is the same as here.

Did this problem solved?

It looks like @agibsonccc was a bit over enthusiastic when reverting a change he made.

Because of a bug in beta7, Android requires a snapshot version.

The build.grade file should have these versions instead: deeplearning4j-examples/build.gradle at 2bdc1c180986a45cfe83ddccbb226857d4c44c42 · eclipse/deeplearning4j-examples · GitHub

Ah thanks for flagging @treo let me get that fixed. Thanks!

I got this,

Could not resolve all files for configuration ‘:BgmExtractor:debugCompileClasspath’.

Could not find nd4j-native-1.0.0-SNAPSHOT-android-arm.jar (org.nd4j:nd4j-native:1.0.0-SNAPSHOT:20210503.021213-21458).
Searched in the following locations:
https://oss.sonatype.org/content/repositories/snapshots/org/nd4j/nd4j-native/1.0.0-SNAPSHOT/nd4j-native-1.0.0-20210503.021213-21458-android-arm.jar
Could not find nd4j-native-1.0.0-SNAPSHOT-android-arm64.jar (org.nd4j:nd4j-native:1.0.0-SNAPSHOT:20210503.021213-21458).
Searched in the following locations:
https://oss.sonatype.org/content/repositories/snapshots/org/nd4j/nd4j-native/1.0.0-SNAPSHOT/nd4j-native-1.0.0-20210503.021213-21458-android-arm64.jar
Could not find nd4j-native-1.0.0-SNAPSHOT-android-x86.jar (org.nd4j:nd4j-native:1.0.0-SNAPSHOT:20210503.021213-21458).
Searched in the following locations:
https://oss.sonatype.org/content/repositories/snapshots/org/nd4j/nd4j-native/1.0.0-SNAPSHOT/nd4j-native-1.0.0-20210503.021213-21458-android-x86.jar
Could not find nd4j-native-1.0.0-SNAPSHOT-android-x86_64.jar (org.nd4j:nd4j-native:1.0.0-SNAPSHOT:20210503.021213-21458).
Searched in the following locations:
https://oss.sonatype.org/content/repositories/snapshots/org/nd4j/nd4j-native/1.0.0-SNAPSHOT/nd4j-native-1.0.0-20210503.021213-21458-android-x86_64.jar

Is these native related jars available?Can I just replace these nonexistance jars with the version of 1.0.0-beta7?

@qq12cvhj using nd4j-native wait rot this build to complete: Merge pull request #9283 from eclipse/ag_cuda_version_test_dynamic · eclipse/deeplearning4j@939344a · GitHub
Here’s how to configure snapshots:
Snapshots - Deeplearning4j