Andorid Studio找不到R类

Andorid Studio找不到R类

When Andorid Studio report error that cannot reslove R, you can try following method to solve it.

  1. Rebuild the project or resyc the Gradle.

  2. It might because of the size of R file is out of the maximum size of single file. You can change it via your Android Studio IDE. Click

Help -> Edit Custom Properties

at idea.properties file, add a extra line/or change existing setting:

idea.max.intellisense.filesize = 20000

Notice: the default size is 2500, you can change whatever parameter you like just ensure it is larger than R file. This is configuration for your Andorid Studio IDE and saved locally, therefore, you might need to reconfigure it when you change your IDE; moving your project; update/upgrade Android Studio.




当Android Studio 提示找不到R类时,可以尝试一下方法:

  1. 尝试rebuild项目和重新同步Gradle
  2. 可能由于R文件的大小大于Android Studio设定的最大文件大小。因此可以在Android Studio界面下:

Help -> Edit Custom Properties
在出现的idea.properties文件中加入/修改一行:
idea.max.intellisense.filesize = 20000

其中2000参数可以为任意int但是要确保大小比R文件大。默认值为2500。这个配置是Android Studio的配置,并保存在本地。因此您可能需要重新配置这个当您跟换了开发环境或升级了Android Studio。




Enjoy coding!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据你提供的引用内容,如果在Android Studio下载完后不到R文件,可能有以下几种解决方法。 首先,你可以尝试在Android Studio切换到Packages模式,到你的项目路径:app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r,然后你就能到R文件了。 另外,你也可以尝试在Android Studio选择Packages模式,到你的项目路径:app/build/intermediates/nruntime_symbol_list/debug/R.txt。在R.txt文件,你可以看到R文件的int值与resource.arsc映射表对应值相同。 如果以上方法都没有解决问题,你可以尝试注释掉build.gradle文件的release相关配置。具体做法是将build.gradle文件的以下代码段注释掉: // buildTypes { // release { // minifyEnabled true // zipAlignEnabled true // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' // } // } 然后重新构建你的项目。 希望以上方法能够帮助你解决问题。如果还有其他疑问,请随时提问。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Android Studio R文件不到](https://blog.csdn.net/g984160547/article/details/118226248)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [Android Studio提示不到符号错误](https://blog.csdn.net/apple_51426592/article/details/125458615)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值