Je construis un projet Android NDK avec Android Studio 3.3 Canady 11, lors de la construction du projet, j'ai eu cette erreur:
La commande de génération a échoué. Erreur lors de l'exécution du processus/home/ndqa/opt/Android-SDK/ndk-bundle/ndk-build avec l'argument {NDK_PROJECT_PATH = null APP_BUILD_SCRIPT =/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp /Android.mk NDK_APPLICATION_MK =/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/Application.mk APP_ABI = armeabi-v7a NDK_ALL_ABIS = armeabi-v7a NDK_DEBUG = 1 APP_PLATFORM = Android-23 NDK_OUT =/home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT =/home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib APP_PLATFORM = Android-21 -j10 APP_SHORT_COMMANDS = false LOCAL_SHORT_COMMANDS = false -B -n}
/home/ndqa/opt/Android-SDK/ndk-bundle/build/core/add-application.mk:178: *** Android NDK: APP_STL gnustl_shared n'est plus pris en charge. Veuillez basculez vers c ++ _ statique ou c ++ _ partagé. Voir https://developer.Android.com/ndk/guides/cpp-support.html pour plus d'informations.. Stop.
Ma machine est Ubuntu 18 et elle a Android SDK, NDK plein. Veuillez m'aider à résoudre ce problème. Merci à tous!
Mise à jour Si j'ai remplacé gnustl_shared par c ++ _ statique ou c ++ _ partagé, cela montre plus d'erreur:
Build command failed.
Error while executing process /home/ndqa/opt/Android-SDK/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/Android.mk NDK_APPLICATION_MK=/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=Android-23 NDK_OUT=/home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib APP_PLATFORM=Android-21 -j10 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/protobuf-3.6.1
rm -f /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib/armeabi-v7a/*
rm -f /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib/armeabi-v7a/gdbserver
rm -f /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib/armeabi-v7a/gdb.setup
mkdir -p /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib/armeabi-v7a
echo [armeabi-v7a] "Gdbserver ": "[arm-linux-androideabi] /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib/armeabi-v7a/gdbserver"
install -p /home/ndqa/opt/Android-SDK/ndk-bundle/prebuilt/Android-arm/gdbserver/gdbserver /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib/armeabi-v7a/gdbserver
echo [armeabi-v7a] "Gdbsetup ": "/home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib/armeabi-v7a/gdb.setup"
echo "set solib-search-path /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a" > /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib/armeabi-v7a/gdb.setup
echo "directory /home/ndqa/opt/Android-SDK/ndk-bundle/sysroot /home/ndqa/opt/Android-SDK/ndk-bundle/sources/Android/support /home/ndqa/opt/Android-SDK/ndk-bundle/sources/cxx-stl/llvm-libc++ /home/ndqa/opt/Android-SDK/ndk-bundle/sources/cxx-stl/llvm-libc++abi/include /home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/protobuf-3.6.1/src/ /home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/include /home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/protobuf-3.6.1/Android/include /home/ndqa/opt/Android-SDK/ndk-bundle/sources/cxx-stl/llvm-libc++/include" >> /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/lib/armeabi-v7a/gdb.setup
mkdir -p /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-debug/main
echo [armeabi-v7a] "Compile++ arm ": "main <= AndroidJni.cpp"
/home/ndqa/opt/Android-SDK/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -MMD -MP -MF /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-debug/main/AndroidJni.o.d -target armv7-none-linux-androideabi21 -ffunction-sections -fdata-sections -funwind-tables -no-canonical-prefixes -g -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -fno-exceptions -fno-rtti -gcc-toolchain /home/ndqa/opt/Android-SDK/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fpic -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -O0 -UNDEBUG -fno-limit-debug-info -I/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/protobuf-3.6.1/src/ -I/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/include -I/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/protobuf-3.6.1/Android/include -I/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/protobuf-3.6.1/src -I/home/ndqa/opt/Android-SDK/ndk-bundle/sources/cxx-stl/llvm-libc++/include -I/home/ndqa/opt/Android-SDK/ndk-bundle/sources/cxx-stl/llvm-libc++abi/include -I/home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp -std=c++11 -DANDROID -D GOOGLE_PROTOBUF_NO_RTTI=1 -D GOOGLE_PROTOBUF_NO_RTTI=1 -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -std=c++11 -std=c++11 -std=gnu++11 --sysroot /home/ndqa/opt/Android-SDK/ndk-bundle/sysroot -isystem /home/ndqa/opt/Android-SDK/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -c /home/ndqa/Documents/PROJ/code/MyProj/app/src/main/cpp/AndroidJni.cpp -o /home/ndqa/Documents/PROJ/code/MyProj/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-debug/main/AndroidJni.o
APP_STL := gnustl_static
soit c++_static
ou c++_shared
dans le fichier Application.mk
APP_STL: = c ++ _ statique
Pour ndk-build, supprimez les lignes définissant NDK_TOOLCHAIN ou NDK_TOOLCHAIN_VERSION.
Pour cmake, supprimez les lignes définissant Android_TOOLCHAIN.
Pour les chaînes d'outils autonomes, utilisez les binaires clang/clang ++ au lieu de gcc/g ++.
Pour les autres systèmes de build, demandez aux propriétaires de ce système de build.
voir plus de détails: