R.java not found on Android Studio 3.2

前端 未结 3 932
囚心锁ツ
囚心锁ツ 2021-01-19 06:33

We\'ve got a strange behaviour in an Android project we inherited. The APK builds without error but the IDE keeps complaining about missing R class<

相关标签:
3条回答
  • 2021-01-19 07:15

    In my case, I have to revert the version of android build tool:

    classpath 'com.android.tools.build:gradle:3.2.1' // use this version instead of 3.3.0
    
    0 讨论(0)
  • 2021-01-19 07:19

    First, thanks for all your support !

    After reading @Kingfisher Phuoc response, I finally found that it was an incompatibility between my Android Studio 3.2 and using Android gradle plugin 3.3.

    I updated my Android Studio to match the plugin and now it is working !

    It looks like the way the R class is generated have been updated in the 3.3 version (source: release notes, look for "Faster R class generation for library projects")

    0 讨论(0)
  • 2021-01-19 07:29

    In my case R.java always generates in build\generated\not_namespaced_r_class_sources . You can try cleaning and rebuilding the product.

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