- 编译的时候ndk报找不到错误
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
解决:
先查看local.properties里的,比如我的在:
ndk.dir=D\:\\AndroidSDK\\Sdk\\ndk-bundle
那么去路径下找toolchains,的确是没有 arm-linux-androideabi。但有 arm-linux-androideabi-4.9,那么做个符号连接来试试处理:
windows没有ln,使用mklink:
mklink /j arm-linux-androideabi arm-linux-androideabi-4.9
- ndk编译项目提示
gnu错误
gnustl_shared is no longer supported. Please switch to either c++_shared
在cmake配置用到了gnustl
cmake {
cFlags "-D_EXAMPLE_C_FLAG1", "-D_EXAMPLE_C_FLAG2"
cppFlags "-frtti -fexceptions", "-std=c++11 -pthread"
arguments "-DANDROID_STL=gnustl_shared", '-DANDROID_PLATFORM=android-24', "-DANDROID_TOOLCHAIN=clang"
abiFilters 'armeabi', 'armeabi-v7a'
}
解决:当前的build是3.0.1。改为3.2.1可以
- ndk使用的时候没有C++提示
根据AndroidStudio软件版本也有关系,我是AndroidStudio Artic fox,在原老软件是build 3.2.1,gradle版本4.6 ,打死都没有提示,但能正常编译出so。
解决:
- 更新build到较新一点:3.5.3
- gradle到6.8