AIDE “Unknown entity 'R'” Error with Android Studio App Project

守給你的承諾、 提交于 2019-12-04 16:50:01

Just add an import with R with the name of your Project. Like for example, my package name is - com.xyz.app then add an Import as import com.xyz.app.R;

This will happen when the applicationId does not match the package name in the app's build.gradle file.

For me, it turned out that I was missing another error that was preventing AIDE from completing the build. It was buried at the bottom of the mass of "Unknown entity 'R'" errors. Once I fixed that , it built like a dream and auto-generated the R file like normal. Yay!

  • Delete the build (the one I encircled in blue ink.)
  • Open the project again and refresh build
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!