Android Studio 3.1.2 : Failed to resolve: runtime

前端 未结 4 2004
栀梦
栀梦 2021-02-02 06:58

I have recently updated my Android Studio to 3.1.2 . After the update I tried opening the existing project and was shown multiple gradle errors while compiling the project.

4条回答
  •  长发绾君心
    2021-02-02 07:28

    Please follow this as same (sequentially) in build.gradle (project: projectName) and issue will be gone

    buildscript {
    
    repositories { // keep same this order
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
    
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        // can add your other compile types here
        }
    }
    
    allprojects { // keep same this order
        repositories {
            google()
            jcenter()
        }
    }
    
    task clean(type: Delete) {
    delete rootProject.buildDir
    }
    

提交回复
热议问题