向Android Studio中导入项目后,运行时出现Cause: llvm-rs-cc is missing错误

向Android Studio中导入项目后,在编译Gradle的时候,出现了Cause: llvm-rs-cc is missing错误,网上对此没找到合理的解决方案,我就只好自己钻研了。于是我拿我新建的Android项目和我外部导入的项目来对比gradle文件,果然,我真是个小幸运,居然一击就中,吼吼吼好开森

一、打开导入的项目根目录下中的build.gradle文件:

内容如下所示:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

二、修改buildscript中的dependencies的classpath值为'com.android.tools.build:gradle:3.2.0'

修改后的文件为:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

你可能感兴趣的:(Android开发)