Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
798 views
in Technique[技术] by (71.8m points)

gradle - Android Studio local path doesn't exist

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.

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:UsersSzymonEclipseAndroid AppuildapkAndroid App-debug-unaligned.apk
remote path: /data/local/tmp/szym1000.androidapp
Local path doesn't exist.`

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...