Android Studio: How to change the file path to the .apk file after moving the entire project?

Viewed 3920

When I try to build my Android Studio project, it gives me the following dialog box (see link). (Clicking OK does not fix the problem and the same dialog comes up again.)

enter image description here

I realize that this directory is the one I just moved the entire project from (I just dragged and dropped the folder in finder). But now it's looking for this file (slice_2.apk) in the wrong location, because its path should now be:

Users/cssummer17/YelpMeImTrying/app/build/intermediates/split-apk/debug/slices/slice_2.apk

instead of

Users/cssummer17/ud851-Exercises/Lesson02-GitHub-Repo-Search/YelpMeImTrying/app/build/intermediates/split-apk/debug/slices/slice_2.apk

I would like to change where it's looking for the file, but I'm not sure how to change this. I have not changed any of my build.gradle files, and none of them have any relevant file paths in them, except one that contains the sdk location (which has not moved).

Thank you very much!

EDIT: I'm also pretty sure this is an issue with Instant Run, because apparently slice files do have something to do with Instant Run. After disabling it, everything seems to run fine.

2 Answers

"Build" -> "Rebuild Project", then "Run" again.

Helped me on the same problem when I copied my project to another PC (AndroidStudio 3.2.1 OS Windows)

Related