I had an Android Studio project I created. The project was named App2-1. After I was done with that project I wanted to move onto my next project named App2-2 that is based off of App2-1. I copied and pasted the directory containing my project “App2-1” and named the new directory “App2-2”. Then I opened up the directory using open project in Android Studio. No errors or anything. I made a whole bunch of changes and then I ran the app and it keeps opening my old app. Almost like it has a reference to it or something. Ideas?
Things I’ve tried:
- Restarting Android Studio
- Invalidating caches/Restart in AS
- Restarted my emulator
- Uninstalled my app from emulator/Clean install
- Tried a physical device
I’m guessing my workflow of creating a new project based on an old project was incorrect. Appreciate any tips.
I would make a copy of the project in a new folder and in this copy delete the following;
- .iml file
- .gradle folder
- .idea folder
- build folder
then open Android Studio and select ‘File > Import Project…’ and select the new projects settings.gradle file and click ‘open’
You might have to check the dependencies and re-build but hopefully this should set things up in AS from scratch.
For me, ‘Gradle -> Tasks -> other -> clean’ worked.
There might be a new functionality. For me worked:
Invalidate Caches / Restart ->
Invalidate and Restart
Tools > AVD manager > click the downward arrow next to your emulator > cold boot now
This should fix all of emulator problems.