GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — R.txt 错误 找不到符号 · Issue #35 · kezong/fat-aar-android

R.txt 错误 找不到符号  #35

New issue
Copy link
New issue
Copy link
Closed
Closed
R.txt 错误 找不到符号 #35
Copy link

Description

@wodezhuanshu
wodezhuanshu
opened on Jul 19, 2019
Issue body actions

警告: [options] 未与 -source 1.7 一起设置引导类路径
/Users/zhoupengfei/StudioProjects/game_sdk/testmerge/build/intermediates/exploded-aar/release/r/com/bytedance/sdk/account/open/aweme/R.java:290: 错误: 找不到符号
public static final int abc_config_showMenuShortcutsWhenKeyboardPresent = com.ss.union.testmerge.R.bool.abc_config_showMenuShortcutsWhenKeyboardPresent;
^
符号: 变量 abc_config_showMenuShortcutsWhenKeyboardPresent
位置: 类 bool
/Users/zhoupengfei/StudioProjects/game_sdk/testmerge/build/intermediates/exploded-aar/release/r/com/bytedance/sdk/account/open/aweme/R.java:335: 错误: 找不到符号
public static final int error_color_material = com.ss.union.testmerge.R.color.error_color_material;

然而 这些文件是 这个module依赖了 appcompatV7 这些文件是V7里面的 ,可是我在 生成的R.java文件中 确实看到有这么个属性 ,但是就是报错 一直卡在这了

gradle插件版本3.4。1
gradle版本 5.1.1
fat-aar版本是 1.1.11

Activity

  1. kezong commented on Jul 19, 2019

    @kezong
    kezong
    on Jul 19, 2019
    Owner
    More actions

    现在有两个解决办法:

    1. module依赖appcompatV7的方式改为compileOnly.
    2. 在主module中加上implementation 相同版本的appcompatV7
  2. kezong commented on Jul 19, 2019

    @kezong
    kezong
    on Jul 19, 2019
    Owner
    More actions

    你试试是否可以解决

  3. wodezhuanshu commented on Jul 19, 2019

    @wodezhuanshu
    wodezhuanshu
    on Jul 19, 2019
    Author
    More actions

    我试了下 在我的要打包的module模块中 使用了api依赖了 V7 发现还是不行,难道要换成compileOnly?

  4. kezong commented on Jul 19, 2019

    @kezong
    kezong
    on Jul 19, 2019
    Owner
    More actions

    �在主module中使用api或者implementation support之后,clean再编一次

  5. wodezhuanshu commented on Jul 19, 2019

    @wodezhuanshu
    wodezhuanshu
    on Jul 19, 2019
    Author
    More actions

    OK 我晚会试试 谢谢你的及时回复

  6. wodezhuanshu commented on Jul 19, 2019

    @wodezhuanshu
    wodezhuanshu
    on Jul 19, 2019
    Author
    More actions

    dependencies { embed (name:'dy-account-common-0.0.2.4',ext:'aar') compileOnly (name:'dy-account-common-0.0.2.4',ext:'aar') embed (name:'dy-aweme-open-sdk-0.0.1.1',ext:'aar') compileOnly (name:'dy-aweme-open-sdk-0.0.1.1',ext:'aar') embed (name:'dy-opensdk-oversea-0.0.2.7',ext:'aar') compileOnly (name:'dy-opensdk-oversea-0.0.2.7',ext:'aar') api 'com.android.support:appcompat-v7:28.0.0' api 'com.google.code.gson:gson:2.8.5' }

    警告: [options] 未与 -source 1.7 一起设置引导类路径 /Users/zhoupengfei/StudioProjects/LightGamUnity/TestMergeAArDemo/mylibrary/build/intermediates/exploded-aar/release/r/com/bytedance/sdk/account/open/aweme/R.java:290: 错: 找不到符号 public static final int abc_config_showMenuShortcutsWhenKeyboardPresent = com.ss.union.mylibrary.R.bool.abc_config_showMenuShortcutsWhenKeyboardPresent; ^ 符号: 变量 abc_config_showMenuShortcutsWhenKeyboardPresent 位置: 类 bool /Users/zhoupengfei/StudioProjects/LightGamUnity/TestMergeAArDemo/mylibrary/build/intermediates/exploded-aar/release/r/com/bytedance/sdk/account/open/aweme/R.java:335: 错: 找不到符号 public static final int error_color_material = com.ss.union.mylibrary.R.color.error_color_material; ^ 符号: 变量 error_color_material 位置: 类 color /Users/zhoupengfei/StudioProjects/LightGamUnity/TestMergeAArDemo/mylibrary/build/intermediates/exploded-aar/release/r/com/bytedance/sdk/account/open/aweme/R.java:391: 错: 找不到符号 public static final int abc_action_bar_progress_bar_size = com.ss.union.mylibrary.R.dimen.abc_action_bar_progress_bar_size; ^ 符号: 变量 abc_action_bar_progress_bar_size 位置: 类 dimen 3 个错误

    ` dependencies {
    classpath 'com.android.tools.build:gradle:3.4.0'
    classpath 'com.kezong:fat-aar:1.1.11'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }`
    

    是不是跟我依赖的aar里面 他们对 support的依赖是implement形式的有关 是不是需要他们以compileOnly的形式依赖?

  7. kezong commented on Jul 19, 2019

    @kezong
    kezong
    on Jul 19, 2019
    Owner
    More actions

    嗯,是的。 目前的版本是这样的,aar对support的依赖需要改成compileOnly,这样就不会生成对应的R.txt。

    我现在也在优化这一块,预计下一个版本能够能解决该问题。

  8. wodezhuanshu commented on Jul 19, 2019

    @wodezhuanshu
    wodezhuanshu
    on Jul 19, 2019
    Author
    More actions

    够能解决该问

    👍

  9. wodezhuanshu commented on Jul 19, 2019

    @wodezhuanshu
    wodezhuanshu
    on Jul 19, 2019
    Author
    More actions

    你的意思是说 如果原来是 api或者implement形式的 那么主module进行融合打包的时候 会生成对应的support的R.java,也就是 appcompat的资源ID ,这样就会导致融合后,appcompat的资源也被打进了我们的融合aar中,并且引用的包名也变成了我们的,所以会出现上面的错误 com.ss.union.mylibrary.R.bool.abc_config_showMenuShortcutsWhenKeyboardPresent 但是其实这个资源文件是V7包中的 ,是这样理解吗

  10. kezong commented on Jul 19, 2019

    @kezong
    kezong
    on Jul 19, 2019
    Owner
    More actions

    不完全是这样,真正资源并不会融合至aar。
    如果api或者implement形式引入appcompat包,�会在R.txt中声明appcompat包中的资源id, 但是实际资源并不会打入aar中。
    但是fat-aar插件中合并R文件时会根据R.txt中的id来做资源映射,生成R.java,而这时候找不到appcompat的实际资源,所以就会出错。

  11. wodezhuanshu commented on Jul 19, 2019

    @wodezhuanshu
    wodezhuanshu
    on Jul 19, 2019
    Author
    More actions

    咱们下个版本大概什么时候更新呢?

  12. kezong commented on Jul 19, 2019

    @kezong
    kezong
    on Jul 19, 2019
    Owner
    More actions

    方案已经有了,周末应该会更新。

    Reacted by wodezhuanshu
  13. wodezhuanshu commented on Jul 19, 2019

    @wodezhuanshu
    wodezhuanshu
    on Jul 19, 2019
    Author
    More actions

    现在就是融合那些aar里面的R.txt文件中包含不属于自己的属性的时候就会出错

  14. kezong commented on Jul 21, 2019

    @kezong
    kezong
    on Jul 21, 2019
    Owner
    More actions

    试一下1.2.0版本

  15. wodezhuanshu commented on Jul 21, 2019

    @wodezhuanshu
    wodezhuanshu
    on Jul 21, 2019 via email
    Author
    More actions
    OK 好的 明天到公司我就试一下 现在在外边 | | 周朋飞 邮箱:[email protected] | 签名由 网易邮箱大师 定制 在2019年07月21日 13:55,kezong 写道: 试一下1.2.0版本 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
  16. wodezhuanshu commented on Jul 22, 2019

    @wodezhuanshu
    wodezhuanshu
    on Jul 22, 2019
    Author
    More actions

    我试了试120的版本 目前打包是没问题的,我在测试测试看打出来的包 使用过程中会不会有问题 。哦 对了,这个如果是基于融合的包 再次融合 ,会不会出现什么问题呢?

  17. wodezhuanshu
    closed this as completedon Jul 22, 2019
  18. kezong commented on Jul 22, 2019

    @kezong
    kezong
    on Jul 22, 2019
    Owner
    More actions

    不会有问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.