dueros / dcs-sdk-java

Apache License 2.0
338 stars 120 forks source link

Mac 上的Android Studio 编译不通过 #58

Closed CrowMagic closed 6 years ago

CrowMagic commented 6 years ago

Build command failed.

Error while executing '/Users/tramp/Library/Android/sdk/cmake/3.6.4111459/bin/cmake' with arguments {-H/Users/tramp/dcs-sdk-java/app -B/Users/tramp/dcs-sdk-java/app/.externalNativeBuild/cmake/debug/armeabi -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=/Users/tramp/Library/Android/sdk/ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/tramp/dcs-sdk-java/app/build/intermediates/cmake/debug/obj/armeabi -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Users/tramp/Library/Android/sdk/cmake/3.6.4111459/bin/ninja -DCMAKE_TOOLCHAIN_FILE=/Users/tramp/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=21 -DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions -I/src/main/cpp}

-- Configuring incomplete, errors occurred!

(include) CMakeLists.txt Open File

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage

CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

Build command failed.

Error while executing '/Users/tramp/Library/Android/sdk/cmake/3.6.4111459/bin/cmake' with arguments {-H/Users/tramp/dcs-sdk-java/app -B/Users/tramp/dcs-sdk-java/app/.externalNativeBuild/cmake/release/armeabi -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=/Users/tramp/Library/Android/sdk/ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/tramp/dcs-sdk-java/app/build/intermediates/cmake/release/obj/armeabi -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/Users/tramp/Library/Android/sdk/cmake/3.6.4111459/bin/ninja -DCMAKE_TOOLCHAIN_FILE=/Users/tramp/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=21 -DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions -I/src/main/cpp}

-- Configuring incomplete, errors occurred!

(include) CMakeLists.txt Open File

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage

CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

singlepig commented 6 years ago

请问这咋解决的? @CrowMagic

singlepig commented 6 years ago

我的NDK是r17b,无法编译通过,错误信息和上述一致。通过降级NDK版本到r16b解决。 NDK官方下载网址 https://developer.android.com/ndk/downloads/older_releases 修改local.properties中的ndk.dir来制定r16b的位置,不需要删除r17b

GregGe commented 6 years ago

dcs-sdk-java/app/build.gradle中修改一下 android{ defaultConfig { ndk { // 平台,去掉'armeabi‘ abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a' } } }