Issue
After updating Android Studio to 2.3.3 and updating ndk bundles,my project fails to build. What does the error mean? It should be a bug of the IDE. How to fix the issue or how to go back to prior Android Studio/ndk versions?
Error:注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: /home/noob/code/greatcompany/ExcellentApk/app/src/main/java/com/greatcompanyx/ExcellentApk/yjzb/CtrlNetTool.java使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:externalNativeBuildRelease'.
> Build command failed.
Error while executing process /home/noob/Android/Sdk/cmake/3.6.3155560/bin/cmake with arguments {--build /home/noob/code/greatcompany/ExcellentApk/app/.externalNativeBuild/cmake/release/armeabi-v7a --target greatcompany-foot}
[1/1] Re-running CMake...
-- Configuring done
使用Android编译设置
-- Generating done
-- Build files have been written to: /home/noob/code/greatcompany/ExcellentApk/app/.externalNativeBuild/cmake/release/armeabi-v7a
[1/17] Building CXX object src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/Buffer.cpp.o
[2/17] Building CXX object src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/aec/aec.cpp.o
[3/17] Building CXX object src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/beamforming/delaysum.cpp.o
[4/17] Building CXX object src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_kws.cpp.o
[5/17] Building CXX object src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_posthandler.cpp.o
[6/17] Building CXX object src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_feature_extractor.cpp.o
FAILED: /home/noob/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/home/noob/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/noob/Android/Sdk/ndk-bundle/sysroot -DANDROID -DNDEBUG -Dgreatcompany_foot_EXPORTS -I../../../../src/main/cpp/greatcompany-foot/src -I../../../../src/main/cpp/greatcompany-foot/src/3rdparty/eigen3 -I../../../../src/main/cpp/greatcompany-foot/src/utils -I../../../../src/main/cpp/greatcompany-foot/src/modules/beamforming -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -O3 -mfpu=neon -mfloat-abi=softfp -march=armv7-a -Wno-parentheses -Os -DNDEBUG -fPIC -std=gnu++11 -MD -MT src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_posthandler.cpp.o -MF src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_posthandler.cpp.o.d -o src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_posthandler.cpp.o -c /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/kws/sentence/Sentence_posthandler.cpp
In file included from /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/kws/sentence/Sentence_posthandler.cpp:5:
In file included from ../../../../src/main/cpp/greatcompany-foot/src/utils/json/json.h:50:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/stdlib.h:36:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/malloc.h:22:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/stdio.h:42:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/sys/types.h:36:
/home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
1 error generated.
FAILED: /home/noob/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/home/noob/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/noob/Android/Sdk/ndk-bundle/sysroot -DANDROID -DNDEBUG -Dgreatcompany_foot_EXPORTS -I../../../../src/main/cpp/greatcompany-foot/src -I../../../../src/main/cpp/greatcompany-foot/src/3rdparty/eigen3 -I../../../../src/main/cpp/greatcompany-foot/src/utils -I../../../../src/main/cpp/greatcompany-foot/src/modules/beamforming -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -O3 -mfpu=neon -mfloat-abi=softfp -march=armv7-a -Wno-parentheses -Os -DNDEBUG -fPIC -std=gnu++11 -MD -MT src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_feature_extractor.cpp.o -MF src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_feature_extractor.cpp.o.d -o src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_feature_extractor.cpp.o -c /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/kws/sentence/Sentence_feature_extractor.cpp
In file included from /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/kws/sentence/Sentence_feature_extractor.cpp:5:
In file included from /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/kws/sentence/Sentence_feature_extractor.h:18:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/stdlib.h:36:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/malloc.h:22:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/stdio.h:42:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/sys/types.h:36:
/home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
1 error generated.
FAILED: /home/noob/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/home/noob/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/noob/Android/Sdk/ndk-bundle/sysroot -DANDROID -DNDEBUG -Dgreatcompany_foot_EXPORTS -I../../../../src/main/cpp/greatcompany-foot/src -I../../../../src/main/cpp/greatcompany-foot/src/3rdparty/eigen3 -I../../../../src/main/cpp/greatcompany-foot/src/utils -I../../../../src/main/cpp/greatcompany-foot/src/modules/beamforming -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -O3 -mfpu=neon -mfloat-abi=softfp -march=armv7-a -Wno-parentheses -Os -DNDEBUG -fPIC -std=gnu++11 -MD -MT src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/aec/aec.cpp.o -MF src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/aec/aec.cpp.o.d -o src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/aec/aec.cpp.o -c /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/aec/aec.cpp
In file included from /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/aec/aec.cpp:5:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/iostream:39:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/ostream:38:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/ios:38:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/iosfwd:40:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/postypes.h:40:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/cwchar:44:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/wchar.h:32:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/stdio.h:42:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/sys/types.h:36:
/home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
1 error generated.
FAILED: /home/noob/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/home/noob/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/noob/Android/Sdk/ndk-bundle/sysroot -DANDROID -DNDEBUG -Dgreatcompany_foot_EXPORTS -I../../../../src/main/cpp/greatcompany-foot/src -I../../../../src/main/cpp/greatcompany-foot/src/3rdparty/eigen3 -I../../../../src/main/cpp/greatcompany-foot/src/utils -I../../../../src/main/cpp/greatcompany-foot/src/modules/beamforming -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -O3 -mfpu=neon -mfloat-abi=softfp -march=armv7-a -Wno-parentheses -Os -DNDEBUG -fPIC -std=gnu++11 -MD -MT src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_kws.cpp.o -MF src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_kws.cpp.o.d -o src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/kws/sentence/Sentence_kws.cpp.o -c /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/kws/sentence/Sentence_kws.cpp
In file included from /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/kws/sentence/Sentence_kws.cpp:6:
In file included from ../../../../src/main/cpp/greatcompany-foot/src/utils/json/json.h:50:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/stdlib.h:36:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/malloc.h:22:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/stdio.h:42:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/sys/types.h:36:
/home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
1 error generated.
FAILED: /home/noob/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/home/noob/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/noob/Android/Sdk/ndk-bundle/sysroot -DANDROID -DNDEBUG -Dgreatcompany_foot_EXPORTS -I../../../../src/main/cpp/greatcompany-foot/src -I../../../../src/main/cpp/greatcompany-foot/src/3rdparty/eigen3 -I../../../../src/main/cpp/greatcompany-foot/src/utils -I../../../../src/main/cpp/greatcompany-foot/src/modules/beamforming -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -O3 -mfpu=neon -mfloat-abi=softfp -march=armv7-a -Wno-parentheses -Os -DNDEBUG -fPIC -std=gnu++11 -MD -MT src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/Buffer.cpp.o -MF src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/Buffer.cpp.o.d -o src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/Buffer.cpp.o -c /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/Buffer.cpp
In file included from /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/Buffer.cpp:5:
In file included from ../../../../src/main/cpp/greatcompany-foot/src/Buffer.h:11:
In file included from ../../../../src/main/cpp/greatcompany-foot/src/3rdparty/eigen3/Eigen/Core:80:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/complex:45:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/sstream:38:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/istream:38:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/ios:38:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/iosfwd:40:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/postypes.h:40:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/cwchar:44:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/wchar.h:32:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/stdio.h:42:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/sys/types.h:36:
/home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
1 error generated.
FAILED: /home/noob/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/home/noob/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/noob/Android/Sdk/ndk-bundle/sysroot -DANDROID -DNDEBUG -Dgreatcompany_foot_EXPORTS -I../../../../src/main/cpp/greatcompany-foot/src -I../../../../src/main/cpp/greatcompany-foot/src/3rdparty/eigen3 -I../../../../src/main/cpp/greatcompany-foot/src/utils -I../../../../src/main/cpp/greatcompany-foot/src/modules/beamforming -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -O3 -mfpu=neon -mfloat-abi=softfp -march=armv7-a -Wno-parentheses -Os -DNDEBUG -fPIC -std=gnu++11 -MD -MT src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/beamforming/delaysum.cpp.o -MF src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/beamforming/delaysum.cpp.o.d -o src/main/cpp/greatcompany-foot/CMakeFiles/greatcompany-foot.dir/src/modules/beamforming/delaysum.cpp.o -c /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/beamforming/delaysum.cpp
In file included from /home/noob/code/greatcompany/ExcellentApk/app/src/main/cpp/greatcompany-foot/src/modules/beamforming/delaysum.cpp:4:
In file included from ../../../../src/main/cpp/greatcompany-foot/src/modules/beamforming/delaysum.h:14:
In file included from ../../../../src/main/cpp/greatcompany-foot/src/3rdparty/eigen3/Eigen/Dense:1:
In file included from ../../../../src/main/cpp/greatcompany-foot/src/3rdparty/eigen3/Eigen/Core:80:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/complex:45:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/sstream:38:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/istream:38:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/ios:38:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/iosfwd:40:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/postypes.h:40:
In file included from /home/noob/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/cwchar:44:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/wchar.h:32:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/stdio.h:42:
In file included from /home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/sys/types.h:36:
/home/noob/Android/Sdk/ndk-bundle/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
1 error generated.
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.
Solution
In Android studio 3.0 and ndk 15, I got this error too. But I resolved this, but analyse it in chinese.
http://www.jianshu.com/p/27f98165d73d
Method :
if(${ANDROID_ABI} STREQUAL "armeabi-v7a")
include_directories(${ANDROID_SYSROOT}/usr/include/arm-linux-androideabi)
elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
include_directories(${ANDROID_SYSROOT}/usr/include/aarch64-linux-android)
else()
include_directories(${ANDROID_SYSROOT}/usr/include/arm-linux-androideabi)
endif()
Method 2
SET(CMAKE_CXX_FLAGS "-isystem /home/cc/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi")
Method 3
include_directories(${ANDROID_SYSROOT}/usr/include/arm-linux-androideabi)
Answered By - lemac
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.