DSAppTeam / Anchors

:white_check_mark: Anchors 是一个基于图结构,支持同异步依赖任务初始化 Android 启动框架。其锚点提供 "勾住" 依赖的功能,能灵活解决初始化过程中复杂的同步问题。参考 alpha 并改进其部分细节, 更贴合 Android 启动的场景, 同时支持优化依赖初始化流程, 自动选择较优的路径进行初始化。
Apache License 2.0
820 stars 79 forks source link

java.lang.IllegalStateException: rhs must not be null #26

Closed liu-xiao-dong closed 3 years ago

liu-xiao-dong commented 3 years ago

java.lang.RuntimeException: Unable to create application com.stub.StubApp: java.lang.IllegalStateException: rhs must not be null at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5758) at android.app.ActivityThread.-wrap1(ActivityThread.java:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6518) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: java.lang.IllegalStateException: rhs must not be null at com.effective.android.anchors.AnchorsRuntime$taskComparator$1.compare(AnchorsRuntime.java:38) at com.effective.android.anchors.AnchorsRuntime$taskComparator$1.compare(AnchorsRuntime.java:23) at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.util.TimSort.sort(TimSort.java:220) at java.util.Arrays.sort(Arrays.java:1498) at java.util.ArrayList.sort(ArrayList.java:1470) at java.util.Collections.sort(Collections.java:201) at com.effective.android.anchors.AnchorsRuntime.tryRunBlockRunnable(AnchorsRuntime.java:92) at com.effective.android.anchors.AnchorsManager.start(AnchorsManager.java:106) at com.xxx.xxx.MainApplication.onCreate(MainApplication.java:167) at com.stub.StubApp.onCreate(StubApp.java:118) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1120) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5755) ... 8 more

YummyLau commented 3 years ago

@liu-xiao-dong 检查下排序的task,不能传null。

YummyLau commented 3 years ago

@liu-xiao-dong 你使用的版本是最新版本么 框架的task外部不能随意调用run哦,会触发框架的task执行流程,导致链的逻辑发生更改。

liu-xiao-dong commented 3 years ago

嗯,确实是使用方式有问题,我使用的是1.1.1版本,我把版本也升级到最新版本