Android Studio - local path doesn't exist

2019-01-01 15:14发布

After updating Android Studio to 0.2.4 I can't get my project to deploy. There is a complete mismatch of the apk filename.

Waiting for device.
Target device: 0146B0020E010020
Uploading file
    local path: /home/martin/workspace/git/projectname/projectname/project/build/classes/debug/AppName.apk
    remote path: /data/local/tmp/com.xxx.xxx.android.projectname
Local path doesn't exist.

After reading some posts here, I changed the output path to the build/apk folder, but the issue remains. Instead of the created projectname-debug-unaligned.apk he is looking for the projectname.apk and I have no idea how and where I can tell him to change the name he is looking for. Any ideas?

PS: Yes I have read several posts which are shown in the list on the right side. The restart of the IDE worked for my coworker, but not for me.

Edit:

I stumbled from one issue to the next so I reverted back to the only downloadable version I could find: 0.2.0.

No disappearing UI elements, I can create new projects and, best of all, I can finally deploy the APK from the studio to my device again. I will try 0.2.5 as soon as it is released.

29条回答
梦寄多情
2楼-- · 2019-01-01 15:23

Heh tried all these answers and none of them worked. I think a common cause of this issue is something a lot simpler.

I advise all who get this problem to look at their launch configuration:

Launch Configuration

Look! The launch configuration contains options for which APK to deploy. If you choose default, Android Studio will be dumb to any product flavors, build types etc. you have in your gradle file. In my case, I have multiple build types and product flavors, and received "no local path" when trying to launch a non-default product flavor.

Android Studio was not wrong! It couldn't find the default APK, because I was not building for it. I solve my issue by instead choosing "Do not deploy anything" and then executing the gradle install task I needed for my specific combination of product flavor / build type.

查看更多
何处买醉
3楼-- · 2019-01-01 15:23

HotNoob's video 'Android Ep8 - Fixing Android Studio Bug "Local path doesn't exist."' worked for me. http://youtu.be/i4WcMIyc8OQ

查看更多
千与千寻千般痛.
4楼-- · 2019-01-01 15:24

Just Close The Android Studio and Restart it and Sysnc. Gradle Files Again......And Run The Project Again

查看更多
旧时光的记忆
5楼-- · 2019-01-01 15:26

From 0.2.13 to 0.3.0 Just download new gradle 1.8 from http://www.gradle.org/downloads Reimport project and choose new gradle to use.

in build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.1'
    }
}

not sure it really need, but i use invalidate caches and restart before reimport project invalidate caches and restart

查看更多
残风、尘缘若梦
6楼-- · 2019-01-01 15:27

Please check the build.gradle file. if there is some operation about "applicationVariants.all" or the assignment to output.outputFile, means trying to change to name or location of the output file.

You can try to comment them out first then try again.

查看更多
倾城一夜雪
7楼-- · 2019-01-01 15:28

I fixed this by adding "Gradle-aware make" before launch in my launch configuration.

enter image description here

查看更多
登录 后发表回答