java - How do I set a relative path for an .SO file? -
this error:
06-29 16:52:37.729 24144-24144/com.my.app e/androidruntime﹕ fatal exception: main process: com.my.app, pid: 24144 java.lang.unsatisfiedlinkerror: dlopen failed: not load library "build/obj/local/armeabi/libavformat.so" needed "libffmpegwrapper.so"; caused library "build/obj/local/armeabi/libavformat.so" not found
build/obj/local/armeabi/libavformat.so looks wrong me. code worked earlier build of ffmpeg - suspect it's way build ffmpeg.
the libavformat.so file in apk i'd expect be.
this build script ffmpeg:
#!/bin/bash ndk=/users/eran/downloads/android-ndk-r10e prebuilt=$ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 platform=$ndk/platforms/android-12/arch-arm prefix=/usr/local function build_one { ./configure --target-os=android --prefix=$prefix \ --pkg-config=./fake-pkg-config \ --enable-cross-compile \ --cpu=armv7-a \ --enable-shared \ --disable-static \ --disable-asm \ --arch=arm \ --cc=$prebuilt/bin/arm-linux-androideabi-gcc \ --cross-prefix=$prebuilt/bin/arm-linux-androideabi- \ --disable-stripping \ --nm=$prebuilt/bin/arm-linux-androideabi-nm \ --sysroot=$platform \ --disable-nonfree \ --disable-version3 \ --disable-everything \ --enable-gpl \ --disable-doc \ --enable-avresample \ --disable-demuxer=rtsp \ --disable-muxer=rtsp \ --disable-ffplay \ --disable-ffserver \ --enable-ffmpeg \ --disable-ffprobe \ --enable-libx264 \ --enable-encoder=libx264 \ --enable-decoder=h264 \ --disable-protocol=rtp \ --enable-hwaccels \ --enable-zlib \ --disable-devices \ --disable-avdevice \ --extra-cflags="-i/usr/local/include -fpic -dandroid -wno-deprecated -mfloat-abi=softfp -mfpu=neon -march=armv7-a" \ --extra-ldflags="-l/usr/local/lib -wl,--fix-cortex-a8" \ --extra-cxxflags='-wno-multichar -fno-exceptions -fno-rtti' make -j4 install } build_one
solved loading required libraries rather letting system try , find them itself.
system.loadlibrary("x264"); system.loadlibrary("avutil"); system.loadlibrary("avcodec"); system.loadlibrary("avformat"); system.loadlibrary("swresample"); system.loadlibrary("swscale"); system.loadlibrary("ffmpegwrapper");
Comments
Post a Comment