1

I've built iperf after downloading it. And then, I pushed iperf executable file built at Android project as like app/src/main/jniLibs (including arm64-v8a, armeabi-v7a, x86, and x86_64). I've tried to rename that executable file as like 'libiperf.so'. I've written down the following codes at click event.

String[] path = {getApplicationInfo().nativeLibraryDir + "/libiperf.so", "-v"};
process = Runtime.getRuntime().exec(path); 

But Android Studio emit the exception as like "Cannot run program "/data/app/com.example.iperf-RP_dMVQlcYeU-n_xznRvhQ==/lib/x86/libiperf.so": error=2, No such file or directory" to me.

There is a weird thing. If I look /data/app/package**/lib/x86 folder through Device File Explorer of emulator at Android Studio, there is no file at that folder. My real Samsung phone has same problem. The more weird thing is that apk file built by Android Studio has 'libiperf.so' file to run

I can't resolve this error. Please, help me. Thanks in advance.

Dennis
  • 130
  • 10
  • You'll have to nest the files as per https://stackoverflow.com/questions/17340240/jni-folder-in-android-studio. Currently, the different build targets are `arm64-v8a`, `armeabi-v7a`, `x86`, and `x86_64`. – msbit Jun 25 '21 at 07:37
  • Thanks your comment, but of course although I put `arm64-v8a`, `armeabi-v7a`, `x86`, `x86_64` under app/src/main/jniLibs, I got error message as like upper – Dennis Jun 26 '21 at 01:04

1 Answers1

0

Add android:extractNativeLibs="true" in your Manifest.