With 0.4.3 Android Studio, error: “Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly”

前端 未结 7 1671
猫巷女王i
猫巷女王i 2020-12-14 07:42

I have noticed that several people are having issues after upgrading to Android Studio 0.4.3 (problem with 0.4.2 also I believe). My error and debug steps so far are as foll

相关标签:
7条回答
  • 2020-12-14 08:05

    I had the same problem and using local gradle distribution didn't work for me either. I ended up finding the solution here Gradle DSL method not found: 'runProguard'

    Anything above gradle version 0.14.0 has to use minifyEnabled instead of runProguard in your projects build.gradle file. Here is how it should look :

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

    Hope this helps. Check out the link if you are still confused

    0 讨论(0)
  • 2020-12-14 08:06

    Go to File > Settings > Gradle you will end up with this screen for setting up your gradle :

    gradle setting

    Also make sure you have Google Repository in your Android SDK directory which will be located at :

    $SDK_DIR\extras\google\m2repository\com\google\android\gms\play-services\3.1.36
    

    If not do install it from SDK Manager > Extras > Google Repository first.

    EDIT :

    All your build.gradle(If you are using root level build.gradle to define android gradle plugin version, check in that only) must point to 0.8 version(latest as of now) of android gradle plugin

     dependencies {
         classpath 'com.android.tools.build:gradle:0.8.+'
     }
    

    UPDATED :

    Mapping is :

     | Android Gradle Plugin |  Gradle Version |
           0.7.+                     1.9
           0.8.+                     1.10
    
    0 讨论(0)
  • 2020-12-14 08:11

    In the scope of the project, in the gradle properties file, you should add :

    org.gradle.jvmargs=-Xmx1024m
    
    0 讨论(0)
  • 2020-12-14 08:13

    Well, I don't know what worked for them, but for me worked to add little scripts to build.gradle.

    Do note that it's important to put them at the top of the page (in build.gradle).

    0 讨论(0)
  • 2020-12-14 08:15

    Well i dont know what worked for them but for me worked to add a little scripts to build.gradle. DO note its important to put them at the top of the page (in build.gradle).

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

    THEN: in buildToolsVersion I had a version 19.1.0 and there for I installed build-tools (SDK manager) version 19.1 & 19. I uninstall other build-tools packetes, im not a fan of useless stuff.

    And you should be good to go, hope it helps someone..

    0 讨论(0)
  • 2020-12-14 08:21

    I ran into this problem and found I already had the location of Gradle set and already had the Google Repository installed as mentioned by pyus13.

    My solution was switching Android SDK Build-tools to a previous version fixed the problem. The latest revision was 19.1, but updating to that broke the tool chain.

    It could just be as simple as trying another Build-tools.

    SDK Platform-tools and SDK Build-tools

    0 讨论(0)
提交回复
热议问题