Gradle version 1.10 is required. Current version is 2.2.1. in android

前端 未结 3 2194
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 23:56

I had an Android project built with Android Studio and trying to import and run it on my Android Studio but facing the below error when trying to Sync the project



        
3条回答
  •  情深已故
    2021-01-01 00:43

    You have to update the:

    • gradle plugin for Android
    • gradle version
    • proguard syntax

    Gradle plugin for Android

    You have to change this line in build.gradle:

    classpath 'com.android.tools.build:gradle:0.9.+'
    

    in

    classpath 'com.android.tools.build:gradle:1.1.+'
    

    Gradle Version

    Change this line in gradle-wrapper.properties

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

    in

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

    About proguard you have to change this line in your build.gradle

    buildTypes {
            release {
                runProguard false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
    

    In

    buildTypes {
            release {
                 minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
    

提交回复
热议问题