安卓莫名消失的R文件

今天AS Android项目中的R文件突然不见了, 但是还能正常run debug apk 并且构建

找了下原因,是因为AS/Intellij中为了保护内存,设定的单个文件大小不能超过2500kb

解决方案如下:

打开AS,选中 Help ---- Edit Custom Properties...

输入以下内容:

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=5000

表示设置单个文件最大为5000kb

重启AS , rebuild 解决问题

转载于:https://my.oschina.net/u/1175512/blog/2245878

你可能感兴趣的:(开发工具)