11

I recently attempted to migrate my Eclipse project over to Android Studio. All went well until I attempted to run the project and an error came up:

Uploading file
    local path: /Users/user/Documents/myapp/Android/myapp/build/apk/myapp-debug-unaligned.apk
    remote path: /data/local/tmp/com.mycompany.myapp
Local path doesn't exist.

How can I fix this problem?

Edit I want to mention as this is still getting answers and comments, this issue occurred while using Android Studio 0.1.3 and have not had similar issues with newer versions of Android Studio when converting eclipse projects.

knightsbore
  • 470
  • 2
  • 8
  • 24
  • possible duplicate of [Android Studio - local path doesn't exist](http://stackoverflow.com/questions/18256177/android-studio-local-path-doesnt-exist) – flx Mar 01 '14 at 02:36

8 Answers8

11

Go to your project folder. Open ProjectName folder.

In file Your_Project_name.iml add

<option name="APK_PATH" value="/build/apk/your_app_name-debug-unaligned.apk" />

Or

<option name="APK_PATH" value="/build/outputs/apk/your_app_name-debug-unaligned.apk"/>

In new versions of Android studio

David
  • 37,109
  • 32
  • 120
  • 141
ZanMax
  • 365
  • 4
  • 13
  • 5
    I would add that this option goes as a child of the node of your node. – levigroker Oct 24 '13 at 19:41
  • Presumably this only works if that's the only APK your project generates. If you have the possibility of generating and running different APKs, for example from different flavors, I don't think this would work. – nasch Feb 13 '15 at 15:59
9

I just ran into this problem, even without transferring from Eclipse, and was frustrated because I kept showing no compile or packageDebug errors. Somehow it all fixes itself if you clean and THEN run packageDebug.

Open up a commandline, and in your project's root directory, run:

./gradlew clean packageDebug

Obviously, if either of these steps shows errors, you should fix those...But when they both succeed you should be able to find the apk when you navigate the local path -- and even better, your program should install/run on the device/emulator!

alikonda
  • 1,186
  • 9
  • 7
  • Ah perfect solution! When I ran that it installed a bunch of things... Everything working great now. – Jona Mar 25 '15 at 13:55
4

I've encountered this problem after migrating from Eclipse to Android Studio. As shantanu said,

gradlew packageDebug

helped to point out that I need local.properties file, so I've created it in the project root with just one line, and after that all works fine.
local.properties contain only one property - sdk.dir, and looks like (in Windows):

sdk.dir=c:\\path-to-android-studio\\sdk

Don't forget to change \ in your path to \\ (there's no need to escape / in Linux or Mac).

Wrote this answer only to gather all info about common problem after migrating from Eclipse to Android Studio to help many people get rid of this little trouble faster without googling every step.

SpongeBobFan
  • 964
  • 5
  • 13
  • Just want to add, I couldn't find the `gradlew packageDebug` command so that may be different on some machines. I had a local.properties but for some reason my sdk path was set as `C\:/Users/.../sdk` even after deleting the project, android studio, and pulling it down from the repository again (local.properties isn't tracked in version control). Changed the path to `C:/Users/.../sdk` and it works. – mrfreester Dec 12 '13 at 04:40
4

You can also check your project .iml file to see that the correct APK_PATH is set

3

I had the same problem after update of Android Studio. The APK build path was incorrect. The YouTube video Android Ep8 - Fixing Android Studio Bug "Local path doesn't exist." helped me (step by step).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Anton Kashpor
  • 1,255
  • 2
  • 18
  • 34
2

Simple solution that worked for me: I went to Build->Rebuild Project.

Daniel Ryan
  • 6,976
  • 5
  • 45
  • 62
  • This works initially, as Rebuild does a clean which there is not explicitly an option for in android studio. The error comes back when trying to load a device. Any ideas? – speedynomads Jul 19 '13 at 13:48
  • I might of had to restart Android Studio too, can't exactly remember. But my issue never came back. Are you on the latest Android Studio version 0.2? – Daniel Ryan Jul 22 '13 at 23:20
  • Ya, i'm on the latest version. I managed to get in working by doing a system install of gradle and making sure it was added to my path. (.bash_profile on mac). Now it builds and rebuilds fine, weird. – speedynomads Jul 22 '13 at 23:25
0

Please verify if JAVA_HOME is OK.

https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+Variable+in+Windows

It was my problem here and fixed after insert JAVA_HOME i

Gorio
  • 1,606
  • 2
  • 19
  • 32
0

I used these steps:

  1. Close IDE
  2. remove /build folder
  3. Reopen IDE
Gene Bo
  • 11,284
  • 8
  • 90
  • 137