fatal error: 'asm/types.h' file not found #include


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process /Users/aaa/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/aaa/Documents/redpacket/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target qssq666x}
  [1/2] Building CXX object src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o
  FAILED: /Users/aaa/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++  --target=armv7-none-linux-androideabi --gcc-toolchain=/Users/aaa/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/aaa/Library/Android/sdk/ndk-bundle/sysroot  -Dqssq666x_EXPORTS -isystem /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include -isystem /Users/aaa/Library/Android/sdk/ndk-bundle/sources/android/support/include -isystem /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++abi/include -Wno-error=format-security -Wno-error=pointer-sign -O0 -fno-limit-debug-info  -fPIC -fvisibility=hidden -MD -MT src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o -MF src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o.d -o src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o -c /Users/aaa/Documents/redpacket/app/src/main/cpp/qssq666x.cpp
  In file included from /Users/aaa/Documents/redpacket/app/src/main/cpp/qssq666x.cpp:2:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/string:470:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/string_view:169:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/__string:56:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/algorithm:641:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/cstring:61:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/string.h:61:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/string.h:36:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/bits/strcasecmp.h:33:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/types.h:36:
  /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
  #include 
           ^~~~~~~~~~~~~
  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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
42 actionable tasks: 12 executed, 30 up-to-date

:app:externalNativeBuildDebug
Build qssq666x armeabi-v7a
[1/2] Building CXX object src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o
FAILED: /Users/aaa/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++  --target=armv7-none-linux-androideabi --gcc-toolchain=/Users/aaa/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/aaa/Library/Android/sdk/ndk-bundle/sysroot  -Dqssq666x_EXPORTS -isystem /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include -isystem /Users/aaa/Library/Android/sdk/ndk-bundle/sources/android/support/include -isystem /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++abi/include -Wno-error=format-security -Wno-error=pointer-sign -O0 -fno-limit-debug-info  -fPIC -fvisibility=hidden -MD -MT src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o -MF src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o.d -o src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o -c /Users/aaa/Documents/redpacket/app/src/main/cpp/qssq666x.cpp
In file included from /Users/aaa/Documents/redpacket/app/src/main/cpp/qssq666x.cpp:2:
In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/string:470:
In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/string_view:169:
In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/__string:56:
In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/algorithm:641:
In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/cstring:61:
In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/string.h:61:
In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/string.h:36:
In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/bits/strcasecmp.h:33:
In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/types.h:36:
/Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
#include 
         ^~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
:app:externalNativeBuildDebug FAILED
:app:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process /Users/aaa/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/aaa/Documents/redpacket/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target qssq666x}
  [1/2] Building CXX object src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o
  FAILED: /Users/aaa/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++  --target=armv7-none-linux-androideabi --gcc-toolchain=/Users/aaa/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/aaa/Library/Android/sdk/ndk-bundle/sysroot  -Dqssq666x_EXPORTS -isystem /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include -isystem /Users/aaa/Library/Android/sdk/ndk-bundle/sources/android/support/include -isystem /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++abi/include -Wno-error=format-security -Wno-error=pointer-sign -O0 -fno-limit-debug-info  -fPIC -fvisibility=hidden -MD -MT src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o -MF src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o.d -o src/main/cpp/two/CMakeFiles/qssq666x.dir/__/qssq666x.cpp.o -c /Users/aaa/Documents/redpacket/app/src/main/cpp/qssq666x.cpp
  In file included from /Users/aaa/Documents/redpacket/app/src/main/cpp/qssq666x.cpp:2:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/string:470:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/string_view:169:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/__string:56:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/algorithm:641:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/cstring:61:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/string.h:61:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/string.h:36:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/bits/strcasecmp.h:33:
  In file included from /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/types.h:36:
  /Users/aaa/Library/Android/sdk/ndk-bundle/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
  #include 
           ^~~~~~~~~~~~~
  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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
42 actionable tasks: 12 executed, 30 up-to-date

`

网上有解决方法,插入几句话搞定. 出现问题在mac电脑.
https://stackoverflow.com/questions/44793617/android-ndk-error-asm-types-h-not-found

你可能感兴趣的:(fatal error: 'asm/types.h' file not found #include )