Android Studio: Gradle: error: cannot find symbol variable

后端 未结 8 539
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条回答
  • 2020-11-27 20:36

    Make sure your variables are in scope for the method that is referencing it. For example I had defined a textview locally in a method in the class and was referencing it in another method.

    I moved the textview definition outside the method right below the class definition so the other method could access the definition, which resolved the problem.

    0 讨论(0)
  • 2020-11-27 20:41

    Open project in android studio click file and click Invalidate Caches/Restart

    0 讨论(0)
提交回复
热议问题