Android Studio: Gradle: error: cannot find symbol variable

后端 未结 8 546
Happy的楠姐
Happy的楠姐 2020-11-27 20:07

I was working on my app and everything was normal until I tried to display image in java.

I ran the app once and it ran normally, the picture was displayed. After th

8条回答
  •  萌比男神i
    2020-11-27 20:34

    If you are using multiple flavors?

    -make sure the resource file is not declared/added both in only one of the flavors and in main.

    Example: a_layout_file.xml file containing the symbol variable(s)

    src:

    flavor1/res/layout/(no file)

    flavor2/res/layout/a_layout_file.xml

    main/res/layout/a_layout_file.xml

    This setup will give the error: cannot find symbol variable, this is because the resource file can only be in both flavors or only in the main.

提交回复
热议问题