Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

com.android.ddmlib.SyncException: Is a directory

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.

like image 622
EricRobertBrewer Avatar asked Dec 16 '16 23:12

EricRobertBrewer


1 Answers

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)

like image 199
RefuX Avatar answered Nov 01 '22 04:11

RefuX