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

前端 未结 3 2055
伪装坚强ぢ
伪装坚强ぢ 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:21

    addition to @Gabriele answer

    you should change

    runProguard false  
    

    to

    minifyEnabled false 
    
    0 讨论(0)
  • 2021-01-01 00:30

    In my case I just used

    "Menu > File > Invalidate Caches/Restart > Invalidate & Restart"

    I was solved.

    0 讨论(0)
  • 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'
            }
        }
    
    0 讨论(0)
提交回复
热议问题