EastWoodYang / MicroModule

Rebuild multiple complete module structures within the module.
Other
219 stars 50 forks source link

R.java引用不到 #9

Closed RFlame closed 5 years ago

RFlame commented 5 years ago

除了main module,布局引用R.java报错,比如说p_user image 请问这个需要怎么处理?

EastWoodYang commented 5 years ago

你当前引用的是哪个版本?

RFlame commented 5 years ago

发现只有main module 可以引用到,是工具版本问题?准备放弃了。。有空再研究下原理

RFlame commented 5 years ago

buildscript { ext.kotlin_version = '1.3.20' repositories { google() jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.3.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.eastwood.tools.plugins:micro-module:1.3.1'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { google() jcenter()

}

}

task clean(type: Delete) { delete rootProject.buildDir }

EastWoodYang commented 5 years ago

引用不到的原因是 没有生成对应MicroModule的R类(位于build/generated/source/micromodule/***/packagename/R.java),你可以尝试 sync & clean,检查该目录下是否生成

RFlame commented 5 years ago

感谢回复!!! 我刚准备放弃了,你提醒我版本号,我改了下版本竟然可以了。。。 如下: buildscript { ext.kotlin_version = '1.3.20' repositories { google() jcenter() //添加本地仓库地址 maven { url 'http://10.2.3.10:8081/repository/maven-public/' } } dependencies { classpath 'com.android.tools.build:gradle:3.3.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files

    classpath 'com.eastwood.tools.plugins:micro-module:1.3.1'
}

}

allprojects { repositories { google() jcenter() //添加本地仓库地址 maven { url 'http://10.2.3.10:8081/repository/maven-public/' } } }

task clean(type: Delete) { delete rootProject.buildDir }

再次感谢回复!

EastWoodYang commented 5 years ago

因为 注意到 kotlin,这个也是最近支持的