我更新了android studio,现在我在尝试运行应用程序时遇到以下错误。
Build command failed.
Error while executing process
C:\Users\bhaskar\AppData\Local\Android\sdk\cmake\3.10.2.4988404\bin\cmake.exe with arguments {--build C:\Users\bhaskar\Desktop\New Projects\otv
2\app\.externalNativeBuild\cmake\debug\armeabi-v7a --target baseUrl}
Unknown argument Projects\otv
Unknown argument 2\app\.externalNativeBuild\cmake\debug\armeabi-v7a
Usage: cmake --build <dir> [options] [-- [native-options]]我试过这个链接,但对我不起作用。Android Studio CMake Error: Build Command failed
我的build.gradle文件是:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.osolutions.otv"
minSdkVersion 16
targetSdkVersion 28
versionCode 9
versionName "1.1.1"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
ndk {
abiFilters "armeabi-v7a", "x86"
}
externalNativeBuild {
cmake {
version "3.10.2"
}
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation files('libs/YouTubeAndroidPlayerApi.jar')
// retrofit, gson
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1'
}我已经尝试了清理和重建项目,无效缓存和重新启动,尝试了链接中的步骤,我已经分享了这些似乎都不适合我。任何帮助都将不胜感激。
发布于 2019-05-16 12:21:20
我用旧版本的cmake解决了这个问题。我在路径中有两个版本的文件夹
C:\Users\bhaskar\AppData\Local\Android\sdk\cmake
3.6.41111459和3.10.2.4988404。我删掉了3.10....文件夹并运行该项目,它工作得很好。
https://stackoverflow.com/questions/56145161
复制相似问题