IntelliJ IDEA - Can't build anything, always get “package R does not exist”

前端 未结 13 512
轻奢々
轻奢々 2020-12-16 09:32

I\'m trying to use IntelliJ IDEA to work on an Android app with a colleague that swears by it, but I\'m unable to build any of the Android projects he sends me because whene

相关标签:
13条回答
  • 2020-12-16 10:13

    In Android Studio, my problem was when i copy pasted a class to use as a template to make another similar class, it asks to automatically import a bunch of stuff, most of which was not going to be related to the new class, so i said cancel. with it it left out import com.your.packagename.R; so R wasnt actually being imported into the file i was trying to use it in.

    can be fixed with an alt-enter when clicking on R (it should be highlighted in red)

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