com.android.ddmlib.SyncException: 是一个目录 [英] com.android.ddmlib.SyncException: Is a directory

查看:25
本文介绍了com.android.ddmlib.SyncException: 是一个目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用 Android Studio 中的运行"按钮在我的设备上运行某个应用程序时,出现以下错误:

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

自上次运行该项目以来,我没有编辑过该项目中的任何文件,尽管 Android Studio 可能从那时起已升级到 Android Studio 2.2.3.

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.

我能找到的最接近的错误是在 SyncException 的谷歌源代码,除了这里我们看到实际的错误是Local path is a directory.,它没有t 完全匹配此错误.

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.

从我在 app/build/outputs/apk/ 中看到的,app-debug.apk 看起来像一个合法的 apk 文件,即.不是目录.

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.

不管怎样,我设备上的上一个应用程序是使用 NativeScript 构建的,并且具有相同的包名称.

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

推荐答案

刚刚在 Alex P 的回答中发帖,所以我们有了答案:

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

尝试执行 adb shell rm -rf/data/local/tmp 并先重启手机.如果你得到 rm:/data/local/tmp: Permission denied. 忽略它 - 在其内容已经被删除后它是 tmp 文件夹本身的(无论如何这就是你需要的)

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)

这篇关于com.android.ddmlib.SyncException: 是一个目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆