JPush_flutter混淆打包错误

标签: #<Tag:0x00007f657fb6b520> #<Tag:0x00007f657fb6b3b8>

flutter集成JPush,使用混淆打包出现错误。(集成JPush之前已集成了JMessage,混淆打包成功。)

  • 混淆配置:
#Flutter Wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }

# 极光
-dontoptimize
-dontpreverify
-keepattributes  EnclosingMethod,Signature
-dontwarn cn.jpush.**
-keep class cn.jpush.** { *; }
-keep class * extends cn.jpush.android.helpers.JPushMessageReceiver { *; }

-dontwarn cn.jiguang.**
-keep class cn.jiguang.** { *; }

-dontwarn cn.jmessage.**
-keep class cn.jmessage.**{ *; }

-keepclassmembers class ** {
    public void onEvent*(**);
}

#========================gson================================
-dontwarn com.google.**
-keep class com.google.gson.** {*;}

#========================protobuf================================
-keep class com.google.protobuf.** {*;}

# ohter
-dontwarn com.sangcomz.fishbun.adapter.image.impl.PicassoAdapter
-keep class com.sangcomz.fishbun.adapter.image.impl.PicassoAdapter
  • 错误日志:
* What went wrong:
Execution failed for task ':jpush_flutter:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  E:\WorkSpace\wunian_app\build\jpush_flutter\intermediates\res\merged\release\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  E:\WorkSpace\wunian_app\build\jpush_flutter\intermediates\res\merged\release\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  E:\WorkSpace\wunian_app\build\jpush_flutter\intermediates\res\merged\release\values\values.xml:2615: error: resource android:attr/fontVariationSettings not found.
  E:\WorkSpace\wunian_app\build\jpush_flutter\intermediates\res\merged\release\values\values.xml:2616: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

先降低到 0.0.11 版本使用

1、刚刚我经过测试,不混淆打包也会失败。
2、降到0.0.11确实问题解决。
3、降级只需要jpush_flutter: 0.0.11即可,把前面的^去掉,不需要改文件名。
4、由于我的flutter版本是1.7.8,而0.0.13版本是升级到1.7.8的,我不确定后面会不会有其他问题。

谢谢解决问题!

预计本周我们会处理下最新版本的问题。

好的,到时我再更新

请问大家都是怎么打包的?打包步骤提供一下,研发这边按他的步骤没测出来这个报错。

0.0.11版本运行报错:
Methods marked with @UiThread must be executed on the main thread. Current thread: Thread-16

0.0.13版本打包报错

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

E:\flutterspace\ehs-android\build\jpush_flutter\intermediates\res\merged\release\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.

E:\flutterspace\ehs-android\build\jpush_flutter\intermediates\res\merged\release\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.

E:\flutterspace\ehs-android\build\jpush_flutter\intermediates\res\merged\release\values\values.xml:2615: error: resource android:attr/fontVariationSettings not found.

E:\flutterspace\ehs-android\build\jpush_flutter\intermediates\res\merged\release\values\values.xml:2616: error: resource android:attr/ttcIndex not found.

error: failed linking references.

我的flutter 是1.9.0版本的,希望尽快修复下

请问你的 0.0.13 版本是怎么打包的?打包步骤提供一下

打包问题已发新版本处理,可以更新测试验证。