我的项目在之前的flutter版本中工作得很好,但是在flutter更新之后,我的项目没有运行,并且得到了构建失败的异常。控制台中的错误是
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
Error while executing process /home/murali/Android/Sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /home/murali/myproject/android/app/.cxx/cmake/debug/armeabi-v7a --target api_util}
[1/2] Building CXX object 'CMakeFiles/api_util.dir/home/murali/myproject/ios/Classes/api_util.cpp.o'
FAILED: /home/murali/Android/Sdk/ndk/23.0.7599858/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi21 --gcc-toolchain=/home/murali/Android/Sdk/ndk/23.0.7599858/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/murali/Android/Sdk/ndk/23.0.7599858/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Dapi_util_EXPORTS -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 -O0 -fno-limit-debug-info -fPIC -MD -MT 'CMakeFiles/api_util.dir/home/murali/myproject/ios/Classes/api_util.cpp.o' -MF CMakeFiles/api_util.dir/home/murali/myproject/ios/Classes/api_util.cpp.o.d -o 'CMakeFiles/api_util.dir/home/murali/myproject/ios/Classes/api_util.cpp.o' -c "/home/murali/myproject/ios/Classes/api_util.cpp"
/bin/sh: 1: Syntax error: "(" unexpected
ninja: build stopped: subcommand failed.
* 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
BUILD FAILED in 18s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)发布于 2021-10-08 11:16:57
通过在SDK Manger中添加Android NDK 20.1.5948944并取消勾选所有其他NDK,解决了此问题
https://stackoverflow.com/questions/69494269
复制相似问题