gpt4 book ai didi

android - CMake 的构建命令失败

转载 作者:行者123 更新时间:2023-11-29 23:09:56 28 4
gpt4 key购买 nike

我更新了 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'
}

我已尝试清理并重建项目、使缓存无效并重新启动,尝试了我共享的链接中的步骤,但似乎对我没有任何作用。任何帮助将不胜感激。

最佳答案

我使用旧版本的 cmake 解决了这个问题。我在路径中有两个版本文件夹

C:\Users\bhaskar\AppData\Local\Android\sdk\cmake

3.6.41111459 和 3.10.2.4988404。我删除了 3.10.... 文件夹并运行该项目,它运行良好。

关于android - CMake 的构建命令失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56145161/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com