Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't run my app in emulator after I renamed the folder of the project

I almost finished my app so I decided to rename the folder's project with a specific name. Before this I've done a backup just in case but now when I run the app in emulator I got this error for both of them as shown here:

image

This only happens when I execute the app with Instant Run otherwise it will work (in emulator). The fun part is that I've tested this issue on 2 actual devices, on LG Optimus L7 2 and Samsung Galaxy A3. With Instant Run enabled it worked only on the first phone and with Instant Run disabled it worked on both of them.

In the image that I've posted I've shown a specific path (E:\backup\AndroidGame\app\build\intermediates\split-apk\debug\slices\slice_5.apk)

Please note that I moved the folder "backup" into another disk because I thought it might interfer with the original folder of the project. So the path shown in the image does not exists anymore in local disk E. Only the folder named AndroidGame which I opened with Android Studio. This is not the first time I changed the name of the folder's project but then it worked without any problem.

The app is like finished so i shouldn't worry about this? Will it work after exporting the project to an apk?

like image 560
Moisoni Ioan Avatar asked Dec 18 '22 09:12

Moisoni Ioan


1 Answers

You can not change your Folder Name, because when you build new APK then App can not find out folder for output files.

Follow this Trick:

1. Close android studio

2. Change project root directory name

3. Open android studio

4. Open the project(not from local history but by browsing to it)

like image 104
Narendra Sorathiya Avatar answered Apr 30 '23 16:04

Narendra Sorathiya