Skip to content Skip to sidebar Skip to footer

Any Android Studio Version > 3.2.1 Show Red Resource But Still Compile

Me and my team are blocked to Android Studio 3.2.1. Any android studio after this one show error for ressource. Ressource are still clickeable/inspectable from editor but are in re

Solution 1:

I solved it after long other searchs.

Solution : My problem was i had 3 modules, but 2 of them had the same package name. I rename one and it solved my problem.

How i solved it:

  • First step, i checked if java files was the problems:

        1) I deleted all my .java files 
    
        2) Deleted all activity in androidmanifest.xml
    
        3) create a new empty activity 
    
  • Second step, i checked if xml files was the problem:

        1) I deleted all content in my res folder, except the layout of my empty activity
    
  • Third step, i checked if gradle library was the problem:

        1) I deleted one by one my dependencies in build.gradle
    

I found that my line who was injected the project in the dependencies was the cause of my problems :

implementation project(':XXX')

1) When i delete it, it was fixed.

2) Therefore, i inspect it and found that if i delete the androidmanifest.xml of XXX project, it solved my problem.

3) Debugging androidmanifest.xml, i found that the id was the problem.

It seems like that androidstudio after 3.2.1 doesn't allow multiple module with same package name. So, now, all my modules have specific package name.


Post a Comment for "Any Android Studio Version > 3.2.1 Show Red Resource But Still Compile"