【问题标题】:Android FirebasePerformance issue with ProguardProguard 的 Android FirebasePerformance 问题
【发布时间】:2018-07-19 06:17:04
【问题描述】:

我们在项目中实施了 FirebasePerformance,但何时无法构建项目。我在 Proguard 中遇到错误,这与在外部库(qrchart_obfuscation.jar)中有两个具有相同名称但不同情况(A.class 和 a.class)的类有关。我对proguard也不是很熟悉。

通过阅读来源,我希望在 proguard 中添加 -dontwarn 选项,但这将是我最后的选择,因为来源说“只有在你知道自己在做什么时才使用它”。

我仍然尝试添加 -dontwarn qr.android.chart,并将 Mapping.txt 与我之前没有 FirebasePerformance 的构建进行了比较,我发现类 (qr.android.chart) 存在差异,不确定此详细信息是否有帮助

感谢您对 FirebasePerformance 的 proguard 设置的帮助和建议。

Reading program directory [C:\...\build\intermediates\transforms\FirebasePerformancePlugin\adevelop\release\4] (filtered)

Warning: class [qr/android/chart/b/a.class] unexpectedly contains class [qr.android.chart.b.A]
Warning: class [qr/android/chart/b/b.class] unexpectedly contains class [qr.android.chart.b.B]
Warning: class [qr/android/chart/b/c.class] unexpectedly contains class [qr.android.chart.b.C]
Warning: class [qr/android/chart/b/d.class] unexpectedly contains class [qr.android.chart.b.D]
Warning: class [qr/android/chart/b/e.class] unexpectedly contains class [qr.android.chart.b.E]
Warning: class [qr/android/chart/b/f.class] unexpectedly contains class [qr.android.chart.b.F]
Warning: class [qr/android/chart/b/g.class] unexpectedly contains class [qr.android.chart.b.G]
Warning: class [qr/android/chart/b/h.class] unexpectedly contains class [qr.android.chart.b.H]
Warning: class [qr/android/chart/b/i.class] unexpectedly contains class [qr.android.chart.b.I]
Warning: class [qr/android/chart/b/j.class] unexpectedly contains class [qr.android.chart.b.J]
Warning: class [qr/android/chart/b/k.class] unexpectedly contains class [qr.android.chart.b.K]

Warning: there were 11 classes in incorrectly named files.
         You should make sure all file names correspond to their class names.
         The directory hierarchies must correspond to the package hierarchies.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unexpectedclass)
         If you don't mind the mentioned classes not being written out,
         you could try your luck using the '-ignorewarnings' option.

我在构建签名 APK 期间看到了有关 Firebase 性能和 proguard 问题的链接,但情况不同 -FirebasePerformance SDK external library issue in progaurd

【问题讨论】:

    标签: android android-proguard firebase-performance


    【解决方案1】:

    问题是 qr.android.chart 库在 proguard 时没有使用 dontusemixedcaseclassnames 选项。

    在不区分大小写的文件系统(即 Mac OSX 喜欢使用的文件系统)上构建时,Firebase Performance 使用的字节码检测过程会遇到问题,因为未归档的类最终会相互覆盖。

    您的选择是禁用字节码检测或请求激活 dontusemixedcaseclassnames 选项的新 qr.android.chart 库。

    【讨论】:

      【解决方案2】:

      如果您在 macOS 上工作,我发现了一个丑陋的解决方法。创建一个区分大小写的磁盘映像并将项目复制到那里,以便 firebase perf 插件可以处理区分大小写的文件。

      如何在此处创建磁盘映像:https://documentation.spryker.com/tutorials/howtos/ht-case-sensitive-file-system-mac.htm

      对于我的项目,我需要一张 5gb 的图片。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多