cannot find symbol in Android Studio without rebuilding project

前端 未结 8 1631
眼角桃花
眼角桃花 2021-01-01 12:01

When I try to deploy my project to the emulator the compile fails with a bunch of Cannot find symbol errors. I have to rebuild the project then deploy everytime I make a cha

相关标签:
8条回答
  • 2021-01-01 12:28

    Same here. Check this for updates: https://code.google.com/p/android/issues/detail?id=56884&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

    0 讨论(0)
  • 2021-01-01 12:32

    I used the following answer and it worked great:

    https://stackoverflow.com/a/19223269/1531683

    You can do "File" -> "Invalidate Caches...", and select "Invalidate and Restart" option to fix this.

    0 讨论(0)
  • 2021-01-01 12:35

    Using java 7 inner classes instead of lambda functions provided by retro-lambda solved my issue.

    0 讨论(0)
  • 2021-01-01 12:39

    As a temporary workaround, try turning off Preferences > Compiler > Use External Build.

    (as suggested in this issue: https://code.google.com/p/android/issues/detail?id=56884)

    0 讨论(0)
  • 2021-01-01 12:42

    Clicking "Sync project with Gradle files" resolved this for me.

    enter image description here

    0 讨论(0)
  • 2021-01-01 12:45

    Just Click Build -> Clean Project. It will solve the problem of missing "R.java".

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