Gradle error on Android Studio startup

36,226

Solution 1

EDIT

  1. Go to File > Settings > "Build,Execution,Deployment"> Compiler

Click compiler directly.

  1. Check the option: Use external build > Apply > OK.

It worked for me !! :)

Solution 2

You seem to have more than one issue. Problems loading gradle on startup and problems resolving the dependency path name in your environment.

I recently found a fix for the "Failed to import Gradle project" issue, which could be linked to your dependency issue.

At least if you fix one, you know your issue could specifically be the dependency path resolution rather than a gradle/android studio issue...

Check out the troubleshooting section here: http://developer.android.com/sdk/installing/studio.html#Troubleshooting

The basic steps are: 1. Close android studio 2. Open the SDK manager (run android binary/executable which should be in /tools) 3. Scroll down the list and expand extras 4. Tick the "Android Support Repository" 5. Click Install Packages.. etc etc...

You need to download this as Android Studio 0.2.x needs a new maven repository used by the new build system for the support library, instead of using support library jar's.

Let us know if anything changes after trying this fix.

Solution 3

In the error message, the path appears: 'P:\Projekte\VertretungsplanProject\libraries\actionbarsherlock\:Vertretungsplan\libs\android-support-v4.jar'

It looks like you're on Windows. The semicolon before Vertretungsplan is not a legal filesystem character. This appears in your script as

compile files(':Vertretungsplan/libs/android-support-v4.jar')

Try changing this to

compile files('Vertretungsplan/libs/android-support-v4.jar')
Share:
36,226

Related videos on Youtube

maysi
Author by

maysi

Updated on July 09, 2022

Comments

  • maysi
    maysi over 1 year

    Every time I start Android Studio I get the following error:

    Gradle 'VertretungsplanProject' project refresh failed: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'. A problem occurred configuring project ':Vertretungsplan'. A problem occurred configuring project ':Vertretungsplan'. Failed to notify project evaluation listener. A problem occurred configuring project ':libraries:actionbarsherlock'. Failed to notify project evaluation listener. Could not normalize path for file 'P:\Projekte\VertretungsplanProject\libraries\actionbarsherlock:Vertretungsplan\libs\android-support-v4.jar'. The syntax for the filename, directoryname or the volume label is wrong

    My project looks like this:

    enter image description here

    Gradle settings:

    enter image description here

    build.gradle of :Vertretungsplan:

    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.5.+'
        }
    }
    apply plugin: 'android'
    
    dependencies {
        compile files('libs/commons-io-2.4.jar')
        compile project(':libraries:actionbarsherlock')
    }
    
    android {
        compileSdkVersion 17
        buildToolsVersion "17.0.0"
    
        defaultConfig {
            minSdkVersion 8
            targetSdkVersion 16
        }
    }
    

    build.gradle of :VertretungsplanProject is empty.

    build.gradle of :actionbarsherlock:

    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.5.+'
        }
    }
    apply plugin: 'android-library'
    
    dependencies {
        compile files(':Vertretungsplan/libs/android-support-v4.jar')
    }
    
    android {
        compileSdkVersion 17
        buildToolsVersion "17.0.0"
    
        defaultConfig {
            minSdkVersion 7
            targetSdkVersion 16
        }
    
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                res.srcDirs = ['res']
            }
        }
    }
    

    When I want to compile now this error appears:

    Deprecated make implementation
    Old implementation of "Make" feature is enabled for this project. It has been deprecated and will be removed soon. Please enable newer 'external build' feature in Settings | Compiler.

    After changing this setting to Use external build everything is working fine. But this appears every time I start Android Studio and this is really annoying.

    UPDATE

    I deleted the android-support-v4.jar from the libs folder and simply wrote compile 'com.android.support:support-v4:18.0.0' to the build.gradle of ActionbarSherlock. Then the android-support-v4.jar is used from the installed SDK.

    • maysi
      maysi over 10 years
      No still No solution :(
  • Prachi
    Prachi over 10 years
    Well, after you make the setting, the IDE gives a pop-up of "Update" saying "you have changed..blah blah.." on the right hand top. I made the selection ,"always for ..." and tada... It worked for me !
  • Prachi
    Prachi over 10 years
    heres the exact pop-up : Update Property Files The structure of following Android modules was changed: facebook google-play-services_lib Would you like to update related project.properties files? Only once Always for these modules Never for these modules
  • maysi
    maysi over 10 years
    I had downloaded the support repository. I fixed this issue in another way. I redownloaded android studio and didn't use the support v4 jar file in my project anymore. I just wrote that I want to use the support file of the sdk and then it works.
  • speedynomads
    speedynomads over 10 years
    Do you remember where you chose to use the support file of the sdk? Just thinking for someone reading this who is having the same problem..
  • speedynomads
    speedynomads over 10 years
    Thanks. Slowly getting the hang of gradle vs studio;
  • Iancovici
    Iancovici almost 10 years
    @Vera Option isn't there, when i clicked on compiler. All i see is "clear output directory on rebuild" and "Automatically show first error in editor"
  • Iancovici
    Iancovici almost 10 years
    @Vera Just created a new question with all the information you may need.
  • slf
    slf almost 10 years
    well it's not exactly 'extra' if it doesn't work without it now is it?

Related