我发布了一个关于我遇到的问题的问题,它是答案,但出现的另一个问题比以前少,但它是一个我真的不明白的问题,因为我是使用 android studio 做应用程序 android 的新手。这些是给我安卓工作室的控制台错误:
第一的:
null
Build command failed.
Error while executing process C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app -BC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS=-std=c++14 -fexceptions -frtti -DCMAKE_TOOLCHAIN_FILE=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja -DBUILD_TESTING=OFF -DANDROID_TOOLCHAIN=gcc-4.9}
C:/Users/Raul del Rio/AndroidStudioProjects/MyApplication2
../../AppData/Local/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake
(include) CMakeLists.txt
<a href="openFile:C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake">Open File</a>
(include) CMakeLists.txt
<a href="openFile:C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake">Open File</a>
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Build command failed.
Error while executing process C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app -BC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\.externalNativeBuild\cmake\release\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS=-std=c++14 -fexceptions -frtti -DCMAKE_TOOLCHAIN_FILE=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja -DBUILD_TESTING=OFF -DANDROID_TOOLCHAIN=gcc-4.9}
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
这是另一个控制台:
Build command failed.
Error while executing process C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app -BC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS=-std=c++14 -fexceptions -frtti -DCMAKE_TOOLCHAIN_FILE=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja -DBUILD_TESTING=OFF -DANDROID_TOOLCHAIN=gcc-4.9}
(include) CMakeLists.txt
Open File
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Build command failed.
Error while executing process C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app -BC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\.externalNativeBuild\cmake\release\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS=-std=c++14 -fexceptions -frtti -DCMAKE_TOOLCHAIN_FILE=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja -DBUILD_TESTING=OFF -DANDROID_TOOLCHAIN=gcc-4.9}
(include) CMakeLists.txt
Open File
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
这是我为解决过去的问题所做的更改:
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.rauldelrio.myapplication"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
arguments '-DBUILD_TESTING=OFF', '-DANDROID_TOOLCHAIN=gcc-4.9'
cppFlags "-std=c++14 -fexceptions -frtti"
}
}
}