Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task generateRJava generates attr that can't find #88

Open
goolong opened this issue May 9, 2018 · 1 comment
Open

task generateRJava generates attr that can't find #88

goolong opened this issue May 9, 2018 · 1 comment

Comments

@goolong
Copy link

goolong commented May 9, 2018

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants