Meituan-Dianping / Robust

Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.
Apache License 2.0
4.4k stars 806 forks source link

使用 gradle 修复onCreate、onPause等方法死循环 #359

Open zhangyugehu opened 4 years ago

zhangyugehu commented 4 years ago

使用 androidx 库和robust 0.4.90,Modify androidx.appcompat.app.AppCompatActivity方法时报错

异常类型:SuperNotCalledException: Activity

手机型号:Meizu m3x(型号无关

手机系统版本:Android 6.0 (版本无关

Robust版本:0.4.90

Gradle版本:3.4.1

系统:Mac

堆栈/日志:

Process: com.example, PID: 8839
    android.util.SuperNotCalledException: Activity {com.example/com.example.activity.market.DetailsAttentionActivity} did not call through to super.onCreate()
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2697)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2812)
        at android.app.ActivityThread.-wrap11(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1605)
        at android.os.Handler.dispatchMessage(Handler.java:111)
        at android.os.Looper.loop(Looper.java:191)
        at android.app.ActivityThread.main(ActivityThread.java:6022)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:821)
zhangyugehu commented 4 years ago

现在发现和Gradle Version有关。gradle version 4.4 + plugin version 3.1.2没问题。5.1.1 + 3.4.2有问题

GainLee commented 3 years ago

严格说是gradle plugin 3.4.0开始就有问题了,因为3.4.0默认开了R8,可以在gradle.properties里面关掉android.enableR8 = false,关掉后编译会慢一点

wqkerry commented 2 years ago

严格说是gradle plugin 3.4.0开始就有问题了,因为3.4.0默认开了R8,可以在gradle.properties里面关掉android.enableR8 = false,关掉后编译会慢一点

按照这样还是不行的额。。。