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:
Gradle settings:
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.
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.
In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.
Then open Android Studio and go to File > Settings > Build, Execution and Deployment > Gradle > Use Gradle from > Set the path of the downloaded Gradle. Step 4. Now try syncing the Gradle again and check if the error still persists.
Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.
EDIT
File > Settings > "Build,Execution,Deployment"> Compiler
Click compiler directly.
Use external build
> Apply
> OK
.It worked for me !! :)
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.
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')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With