NoSuchFieldError: No static field listView1 of type I in class Lcom/disdemo/R$id; or its superclasses

I have module1 (in Android Studio) with listView1 in activity_main.xml (present in res of the module1). The MainActivity of this module is being launched from another module2 in the same Android Studio project.

I have tried deleting the module1 and again creating a new one with same res and java files. Still I am getting the same issue.


I think you have layout in both library and module with same name or inflating multiple xml layout with duplicate resource id.


In both modules, you have an activity_main.xml. Please rename one file.

Update: What @kundan kamal wants to express is, you have a layout file in both modules with a similar name.


you have use multiple module and give same name of any xml layout then give this error so please rename your xml layout.