Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio gradle refresh failed

I know there are a couple of threads on this but none seem to solve my problem. I just installed Android Studio v0.4.6 on my Mac. Every time I create a new project I get the error:

 Gradle 'Budget' project refresh failed:
        Content is not allowed in prolog.

In more detail I get:

    Error:A problem occurred configuring root project 'Budget'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve org.ow2.asm:asm-analysis:4.0.
     Required by:
         :Budget:unspecified > com.android.tools.build:gradle:0.7.3 > com.android.tools.lint:lint:22.4.2 > com.android.tools.lint:lint-checks:22.4.2
      > Could not parse POM http://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/4.0/asm-analysis-4.0.pom
         > Content is not allowed in prolog.
   > Could not resolve org.ow2.asm:asm-tree:4.0.
     Required by:
         :Budget:unspecified > com.android.tools.build:gradle:0.7.3 > com.android.tools.lint:lint:22.4.2 > com.android.tools.lint:lint-checks:22.4.2 > com.android.tools.lint:lint-api:22.4.2
      > Could not parse POM http://repo1.maven.org/maven2/org/ow2/asm/asm-tree/4.0/asm-tree-4.0.pom
         > Content is not allowed in prolog.

I can't seem to find a solution to this issue. I tried updating Android Studio to v0.5, changing the dependencies:

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

and both of those failed. Any help would really be appreciated!

like image 461
Ryan Sayles Avatar asked Sep 22 '26 12:09

Ryan Sayles


1 Answers

  1. First of all, you should have installed the newest version of Android Studio which is 0.5.5. Then update your gradle plugin version to the newest one --> 0.9.+

    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'
    }
    
  2. You should check you repositories if all modules/libraries have a correct URL, eg.

    repositories {
        mavenCentral()
    }
    
  3. Verify your local.properties and check if a path to Android SDK is correct.

  4. Try to build your project in the Terminal using your local Gradle distribution and Gradle wrapper: Local distribution:

    gradle clean build
    

    Wrapper:

    ./gradlew clean build
    

    If you don't have the local distribution, install the newest version using e.g homebrew (for mac users) (brew install gradle).

  5. Set the path to the local Gradle distribution in the Android Studio (default path for brew and mac is: /usr/local/Cellar/gradle/1.11/libexec/).

  6. After all these steps close your project and import it again (like you import the project for the very first time).
like image 75
mmBs Avatar answered Sep 25 '26 07:09

mmBs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!