com.android.ddmlib.SyncException: Is a directory

2019-06-19 08:40发布

When I try to run a certain application onto my device using the 'Run' button in Android Studio, I get the following error:

12/16 15:05:27: Launching app
$ adb push /Users/me/myproject/app/build/outputs/apk/app-debug.apk /data/local/tmp/com.mycompany.myproject
com.android.ddmlib.SyncException: Is a directory
Error while Installing APK

I haven't edited any files in the project from the last time I ran it, although Android Studio may have upgraded since then to Android Studio 2.2.3.

The closest error that I could find is in the Google source code for SyncException, except here we see that the actual error is Local path is a directory., which doesn't exactly match this error.

From what I see in app/build/outputs/apk/, app-debug.apk looks like a legitimate apk file, ie. not a directory.

I have restarted my device, uninstalled the app from my device, and have even restarted my computer.

For what it's worth, the previous app which was on my device was built using NativeScript and has the same package name.

1条回答
Viruses.
2楼-- · 2019-06-19 08:59

Just posting in Alex P's answer, so we have an answer:

try doing adb shell rm -rf /data/local/tmp and rebooting the phone first. it's ok if you get rm: /data/local/tmp: Permission denied. ignore it - it's for the tmp folder itself after its content was already removed (that's what you need anyway)

查看更多
登录 后发表回答