Android Studio - local path doesn't exist
I originally saw this error after upgrading from 0.2.13 to 0.3. These instructions have been updated for the release of Android Studio 0.5.2. These are the steps I completed to resolve the issue.
1.In build.gradle make sure gradle is set to 0.9.0
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.0'
}
}
2.In gradle-wrapper.properties make sure to use gradle 1.11
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip
3.Sync project with gradle files by pressing the button to the left of the avd button
4.Try to build project again. If still having issues possibly try File > Invalidate Caches/Restart
NOTE: If you are using 0.9.+
and it gives Could not GET 'http://repo1.maven.org/maven2/com/android/tools/build/gradle/'. Received status code 401 from server: Unauthorized
(happens sporadically) then change to 0.9.0
. Also, you have to use build tools 19.0 or greater I believe so make sure you have those downloaded in sdk manager and use as buildToolsVersion
in whichever gradle file holds that info.
Try this:
- Close IDE
- Remove .idea folder and all .iml files in the project.
- Restart the IDE and re-import the project.
Original post: https://code.google.com/p/android/issues/detail?id=59018
I managed to find a temporary workaround. Do all by yourself using command line :
// build apk
./gradlew assemble --daemon
// debug apk is unaligned so we need to align it
zipalign -f 4 app/build/apk/app-debug-unaligned.apk app/build/apk/app-debug.apk
// reinstall it using adb
adb install -r app/build/apk/app-debug.apk
This is temporary, but I hope they will fix this for 0.2.5
Edit : not fixed in 0.2.5
Edit2 : fixed for now by adding in my module.iml file (in facet/configuration) :
<option name="APK_PATH" value="/build/apk/appname-debug-unaligned.apk" />