您的位置:首页 > 博客中心 > APP开发 >

Android Studio 4.0.1 找不到R.java 2020.09.08

时间:2022-03-12 23:51

看以往的教材中R.java都是在项目的\app\build\generated\source\r\debug\包名下的

通常AS会自动在项目的R.java中创建代表项目中资源的资源ID,大致格式如下

public final class R
{
    public static final class layout
    {
        public static final int activity_main = 0x7f040017;
    }

    public static final class mipmap
    {
        public static final int ic_launcher = 0x7f030000;
    }

    public static final class string
    {
        public static final int app_name = 0x7f0b0011;
        public static final int hello_world = 0x7f0b0012;
    }
}

结果今天在使用AS4.0.1新建Helloworld项目,发现\generated\source目录下不存在\r\debug\,在文件管理其中搜索有关R的文件发现R.java变为了R.txt

技术图片

并且R.txt在D:\Android\HelloWorld\app\build\intermediates\runtime_symbol_list\debug目录下

相关推荐

电脑软件

本类排行

今日推荐

热门手游