Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

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.

like image 469
Komal Gupta Avatar asked Apr 03 '15 22:04

Komal Gupta


3 Answers

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

like image 89
JosephM Avatar answered Nov 07 '22 04:11

JosephM


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.

like image 39
kundan kamal Avatar answered Nov 07 '22 04:11

kundan kamal


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

like image 8
user7176550 Avatar answered Nov 07 '22 02:11

user7176550