Android Studio 本地路径不存在 [英] Android Studio local path doesn't exist

查看:73
本文介绍了Android Studio 本地路径不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Gradle 将我的 Eclipse 项目导入到 Android 中.起初我遇到了 R.java 的问题,但我通过在项目设置中添加gen"文件夹作为源来解决这些问题.

I imported my Eclipse project into Android using Gradle. At first I had problems with R.java but I resolved them by adding 'gen' folder as sources in Project Settings.

然而,即使 Android Studio 不再显示任何错误,当我尝试将项目部署到我的 Android 设备上时,我还是收到了错误:

However, even though Android Studio doesn't show any errors any more, when I'm trying to deploy the project onto my Android device, I get the error:

Waiting for device.
Target device: 01c47c94e112d5fb
Uploading file
local path: C:\Users\Szymon\Eclipse\Android App\build\apk\Android App-debug-unaligned.apk
remote path: /data/local/tmp/szym1000.androidapp
Local path doesn't exist.`

我检查了我的 Android App 文件夹,没有 build 文件夹,这是真的.但是为什么Android Studio没有生成呢?

I checked my Android App folder and there is no build folder, that's true. But why didn't Android Studio generate it?

我发现有人有类似的问题这里.但是,我不知道如何在 Android Studio 中运行 gradlew packageDebug.有什么想法吗?

I found someone had a similar problem here. However, I have no idea how to run the gradlew packageDebug in Android Studio. Any ideas?

推荐答案

我刚遇到这个问题,即使没有从 Eclipse 转移,也很沮丧,因为我一直没有显示编译或 packageDebug 错误.如果您清理并运行 packageDebug,它会以某种方式自行修复.不要担心已弃用的方法语句 - 它似乎是对开发人员的通用通知.

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. Don't worry about the deprecated method statement - it seems to be a generic notice to developers.

打开一个命令行,在你项目的根目录中,运行:

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

./gradlew clean packageDebug

显然,如果这些步骤中的任何一个显示错误,您应该修复它们...但是当它们都成功时,您现在应该能够在导航本地路径时找到 apk —— 更好的是,您的程序应该安装/在设备/模拟器上运行!

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

这篇关于Android Studio 本地路径不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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