Android Studio Gradle issue upgrading to version 0.5.0 - Gradle Migrating From 0.8 to 0.9 - Also Android Studio upgrade to 0.8.1

后端 未结 8 2408
名媛妹妹
名媛妹妹 2020-11-27 14:41

After upgrade message states:

Failed to refresh Gradle project \'XXX\'
The project is using an unsupported version of the Android Gradle plug-in (0.8.3).
Ve         


        
8条回答
  •  余生分开走
    2020-11-27 14:44

    To fix it, open file called build.gradle in the project root, and change gradle version there to 0.9.+.

    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.9.+'
        }
    }
    

    To be repeated for each project ;(

    If you then get a message like "Unable to load class 'org.gradle.api.artifacts.result.ResolvedComponentResult".

    Go to you project_folder/gradle/wrapper directory and edit Unable to load class 'org.gradle.api.artifacts.result.ResolvedComponentResult'. file changing the distributionUrl to

    distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
    

    After upgrade to version 0.8.1 (full download and copy SDK folder over), had to have new version of gradle installed by IDE (using the "Fix it" link a couple of time :S ), and modifing the "android" section of the gradle file in project folder from 19.0 to 19.1, as below: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.12.+' } } apply plugin: 'android'

    repositories {
        mavenCentral()
    }
    
    android {
        compileSdkVersion 19
        buildToolsVersion '19.1.0'
    
        defaultConfig {
            minSdkVersion 7
            targetSdkVersion 19
        }
    }
    
    dependencies {
        compile 'com.android.support:appcompat-v7:19.1.+'
        compile 'com.android.support:support-v4:19.1.0'
    }
    

提交回复
热议问题