NDK開發趟坑之旅
Build command failed.
Error while executing process /Users/fenglei/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /Users/fenglei/AndroidStudioProjects/FFmpegNdkDemo/app/.cxx/cmake/debug/armeabi-v7a native-lib}
ninja: Entering directory `/Users/fenglei/AndroidStudioProjects/FFmpegNdkDemo/app/.cxx/cmake/debug/armeabi-v7a'
[1/2] Building CXX object CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o
clang++: warning: argument unused during compilation: '-L/Users/fenglei/AndroidStudioProjects/FFmpegNdkDemo/app/libs/armeabi-v7a' [-Wunused-command-line-argument]
[2/2] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so
FAILED: ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so
: && /Users/fenglei/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi21 --gcc-toolchain=/Users/fenglei/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/fenglei/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -std=c++11 -L/Users/fenglei/AndroidStudioProjects/FFmpegNdkDemo/app/libs/armeabi-v7a -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--fatal-warnings -Wl,--exclude-libs,libunwind.a -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libnative-lib.so -o ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o -lavcodec -lavfilter -lavformat -lavutil -lswresample -lswscale -llog -latomic -lm && :
/Users/fenglei/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lavcodec
/Users/fenglei/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lavfilter
/Users/fenglei/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lavformat
/Users/fenglei/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lavutil
/Users/fenglei/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lswresample
/Users/fenglei/Library/Android/sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lswscale
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
這個報錯原因在於FFmpeg的so庫編譯後是帶有數字的,如下圖所示,
第一次編譯的時候把數字和-刪掉就沒有這個報錯了,然後你以為結束了,naive~,然後在安裝啟動的時候會接著報錯
是的,你沒有看錯,應用會接著找libavcodec-58.so,所以我們把剛剛改過名字的so再改回去,再次編譯安裝,就沒有問題了~
相關文章
- 小程式開發入坑之旅
- Andorid Studio NDK開發-使用NDK庫
- Andorid Studio NDK 開發 – NDK 開發利器 gradle-experimentalGradle
- Android NDK開發(二) 使用ndk-build構建工具進行NDK開發AndroidUI
- NDK學習筆記-NDK開發流程筆記
- Ndk 初步開發 In AndroidAndroid
- android studio配置ndk開發Android
- Android Studio中NDK開發Android
- android 開發淺談(JDK && NDK)AndroidJDK
- React Native填坑之旅--開啟TurboModule(Android)React NativeAndroid
- vuepress爬坑之旅Vue
- Android NDK開發之JNI基礎Android
- Android Studio NDK開發-環境配置Android
- Android NDK開發Crash錯誤定位Android
- NDK探究之旅《二》——C語言的基本認識C語言
- Mac之Android Studio開發NDK入門MacAndroid
- Android Studio NDK開發-JNI呼叫Java方法AndroidJava
- Android Studio3.0 NDK配置與開發Android
- 你是否真的適合搞NDK開發?
- Vue踩坑之旅——methodsVue
- Vue踩坑之旅——VuexVue
- 開始Go開發之旅Go
- 微信小程式自動化,記錄趟過的坑!微信小程式
- 【爬坑】一次OOM爬坑之旅OOM
- React Native填坑之旅 -- 從Native發事件給JSReact Native事件JS
- Andorid Studio NDK 開發 – 編譯 OpenSSL 類庫編譯
- Android NDK 開發之 CMake 必知必會Android
- vue系列之踩坑之旅Vue
- FLUTTER混合工程踩坑之旅Flutter
- laradock-的踩坑之旅
- mpvue小程式踩坑之旅Vue
- React Native填坑之旅--GraphQLReact Native
- 年薪50萬的Java程式設計師,都趟過哪些坑?Java程式設計師
- jni開發探索之旅
- Web 開發的安全之旅Web
- Android之NDK開發錯誤 error: unknown type name 'JNIEXPORT'AndroidErrorExport
- Android NDK開發之引入第三方庫Android
- React Native填坑之旅 -- What's nextReact Native