Android Cache Problem during build

I have a minor issue with the way IntelliJ caches files or builds (not sure about terminology here).

Situation Abstract:

Library module
- DrawableA
- DrawableB

App module
- DrawableA

Assume library images are black and white, App ones are color.

The app shows (correctly) the colorful A.
The app shows (correctly) the black and white B (means its missing).

Now I add an image to App project, Drawable B, in color.

- If you simply press "run" he will keep using black and white B
- If you "rebuild project" he will use the correct one
- If you try "Make" and "Compile" manually on Lib and App NO EFFECT

To clarify, this issue is really special. It only occurs if the DrawableB is NOT present in the App module. If you have it, but the WRONG one, and you update it, it works. I assume its an internal caching of IntelliJ, and he does not recognize that I added a drawable (and he has to use it from the App now, not the LIB). Perhaps its something in the google build of Android projects, not enough info about the internal here...

I know, the obvious tip is "do a rebuild of the whole project" - that said, I have 18 App modules, each for one App. The rebuild takes forever (on one of our machines without SSD), and its not neccessary. If I change something in e.g. AppX, I only need to rebuild AppX and the Library. But there seems to be no option for it.

Does anyone know a workaround, like deleting BIN or other cache folders via script? Cant split up the modules in different "projects", would loose refactoring capabilities. Thanks a lot for any feedback.


Crosspost here, check before taking the time to answer

Comment actions Permalink

I also asked on Stackoverflow, check here for answer to prevent duplicated typing work:

Comment actions Permalink

ChristianRuppert schrieb:

I also asked on Stackoverflow, check here for answer to prevent duplicated typing work:

So let me cross post the Answer as well:

If you use Libraries I suggest Maven. The Android plugin for Maven is very good. As is the Maven integration in IntelliJ. Android-Annotations, Robotium and ViewPagerIndicator, all the important Android tool-kits use Maven. It is the best way to work.


Please sign in to leave a comment.