adwiv / android-fat-aar

Gradle script that allows you to merge and embed dependencies in generted aar file
The Unlicense
1.46k stars 435 forks source link

task generateRJava generates attr that can't find #88

Open goolong opened 6 years ago

goolong commented 6 years ago
if (rTxt.exists()) {
                rTxt.eachLine {
                    line ->
                        //noinspection GroovyUnusedAssignment
                        def (type, subclass, name, value) = line.tokenize(' ')
                        rMap[subclass].putAt(name, type)
                }
            }

            def sb = "package $aarPackageName;" << '\n' << '\n'
            sb << 'public final class R {' << '\n'

            rMap.each {
                subclass, values ->
                    sb << "  public static final class $subclass {" << '\n'
                    values.each {
                        name, type ->
                            sb << "    public static $type $name = ${libPackageName}.R.${subclass}.${name};" << '\n'
                    }
                    sb << "    }" << '\n'
            }

            sb << '}' << '\n'

In R.txt file,(type, subclass, name, value),some res name belong to System,so can't find it in our library

/Users/goolong/Didi/unifiedPaySdk/pay/build/generated/source/r/release/com/didi/didipay/pay/R.java:89: 错误: 找不到符号 public static int constraintSet = com.didi.unified.pay.R.attr.constraintSet; ^ 符号: 变量 constraintSet 位置: 类 attr

tommy8421 commented 6 years ago

@goolong Normally it's caused by using different version of support library. -- FYI