2

I updated android studio and now I am getting the following error while trying to run the app.

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]]

I have tried the link but didn't work for me. Android Studio CMake Error: Build Command failed

My build.gradle file is:

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'
}

I have tried clean and rebuild the project, Invalidate cache and restart, tried steps in the link that I have shared none of it seems to be working for me. Any help would be appreciated.

bhaskar
  • 991
  • 1
  • 15
  • 37

1 Answers1

4

I solved it by using older version of cmake. I had two versions folder inside path

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

3.6.41111459 and 3.10.2.4988404. I deleted the 3.10.... folder and run the project and it worked fine.

bhaskar
  • 991
  • 1
  • 15
  • 37