How to clean a project in Android Studio? I have changed the project from Eclipse and my apk file is not updating, it contains the old apk file from Eclipse. I did rebuild project, doesn't help. Also checked Out folder, no apk for this project is there. Also I changed my project name once while it was in Eclipse. Now the Out folder still contains the old projectname.apk file. Would really appreciate your help.
Asked
Active
Viewed 7,892 times
3 Answers
7
When you think that Android Studio (or Intellij IDEA) isn't picking up an externally made change, sometimes File -> Invalidate Caches... can help.

Barry O'Neill
- 435
- 6
- 16
-
I tried Invalidate Caches. Still it's the old apk file after I ran the project again. – MSIslam Jun 05 '13 at 17:55
-
2In the **Project Settings** dialog, under **Project**, Ensure the _Project Name_ and _Project Compiler Output_ are the values you expect. Then, under **Modules**, select your project module (The one that generates the application, if you have several) and under the *Paths* tab, check that _Inherit Project Compile Output Path_ is checked. Finally, under the **Facets** section in **Project Settings**, choose the application's _Android_ facet, and ensure _Library Module_ isn't checked. – Barry O'Neill Jun 06 '13 at 18:30
-
Aside, are you using Android Studio and Eclipse at the same time? I don't recommend it on the same project folder. – Barry O'Neill Jun 06 '13 at 18:34
-
I was working on Eclipse before, but after I imported the project into Android Studio, I am only working on Android Studio. But the project folder remains same as this is my workspace for both Eclipse and Android Studio. – MSIslam Jun 06 '13 at 21:16
-
In Android Studio, I am not sure which one would be Project Settings you have mentioned. I checked File>Settings, coudn't find anything like Project Name and Project Compiler, Modules, Facets. Project structure shows the project as per folder name, not the name I assigned. Though I can see that as Project name under Window. – MSIslam Jun 06 '13 at 21:23
-
No, my mistake. It's **File -> Project Structure...** or Ctrl-Alt-Shift-S (not Project Settings, sorry!). – Barry O'Neill Jun 07 '13 at 00:05
-
In Project, Yes the project name is what I expect, this is the name I gave while importing from Eclipse. But there has been no apk assigned with this name! Only apk is what I gave the name in Eclipse. In Module, the module name is different from my project. This is the name of the old project name which I assigned when I created the project in Eclipse.(This is also project folder name). Here under Paths tab, Inherit Project Compile Output Path is checked. In Facets, Library Module isn't checked. – MSIslam Jun 07 '13 at 03:01
-
Now whenever I run the project or build the project, in the bin folder files are not updating properly. Specially the apk file and some other files(AndroidManifest.xml, classes.dex, res and aidl folder) are not updating anymore. I could not find out anything like clean project in Android Studio. – MSIslam Jun 07 '13 at 03:03
-
FYI, I imported the project from Eclipse and tried to give a different name in Android Studio. – MSIslam Jun 07 '13 at 03:04
-
Just to mention, previously in a test project, I deleted the bin folder and then did rebuild and ran the project. But no bin folder were created or any apk file was generated. – MSIslam Jun 07 '13 at 03:16
-
In Android Studio, the apks are usually generated to the **out** folder (aka what **Project Compiler Output** in the _Project_ section says) – Barry O'Neill Jun 07 '13 at 15:17
-
No luck there too. It has only earliest version of the apk files(name.apk and name.unaligned.apk). No files are updating in the out folder. I think I messed up something badly :(. No clue why this is happening. – MSIslam Jun 07 '13 at 15:51
-
1It's hard to say what's going wrong, since the project could be configured any number of ways. Perhaps you could make a new project folder with the src, res, and other project-only files/folders, and create a new project from those. (Ie, File -> Close, then 'Import Project... and use the _Create project from existing sources_ as opposed to using any Gradle/Maven/Eclipse files). Sorry I can't be more help. – Barry O'Neill Jun 07 '13 at 16:03
-
I will do that after I finish the functionalities, will create a new project. Thanks a lot for all the tips. – MSIslam Jun 07 '13 at 16:15
-
Did you have any luck in figuring it out? – Barry O'Neill Jun 25 '13 at 18:25
-
Not really. I actually created a new project and started working on that. Thanks for all your help though. – MSIslam Jun 25 '13 at 19:24
-
1Usually the best approach when project metadata starts acting up :) – Barry O'Neill Jun 28 '13 at 13:48
0
In my own case, deleting the existing/old apk in the output folder helped to resolve this issue. If you run into this problem, it might be worth trying the following sequence of steps:
- I opened my file manager and deleted the existing apk file.
- I opened Android studio and clicked on Build APK(s).

Taslim Oseni
- 6,086
- 10
- 44
- 69
0
I had this problem before and this way helped me. You can run this at the root of your project
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
Then cd to android and run this
./gradlew assembleDebug

Medisa
- 379
- 1
- 3
- 12