Status Update
Comments
sg...@google.com <sg...@google.com>
ze...@google.com <ze...@google.com> #2
Caused by: java.lang.NullPointerException
at com.android.tools.r8.ir.optimize.ServiceLoaderRewriter.rewrite(ServiceLoaderRewriter.java:140)
at com.android.tools.r8.ir.conversion.IRConverter.optimize(IRConverter.java:1170)
at com.android.tools.r8.ir.conversion.IRConverter.rewriteCodeInternal(IRConverter.java:1100)
at com.android.tools.r8.ir.conversion.IRConverter.lambda$rewriteCode$12(IRConverter.java:1072)
at com.android.tools.r8.utils.ExceptionUtils.withOriginAttachmentHandler(ExceptionUtils.java:141)
at com.android.tools.r8.ir.conversion.IRConverter.rewriteCode(IRConverter.java:1068)
sg...@google.com <sg...@google.com> #3
Thank you for the report and the reproduction - that is very helpful.
The error happens while compiling kotlinx.coroutines.internal.MainDispatcherLoader.loadMainDispatcher()
If generating class file output and enabling assertions an AssertionError
is hit when generation the byte codes:
Caused by: java.lang.AssertionError
at com.android.tools.r8.ir.conversion.CfState.setStateFromFrame(CfState.java:94)
at com.android.tools.r8.ir.conversion.CfSourceCode.setStateFromFrame(CfSourceCode.java:611)
at com.android.tools.r8.cf.code.CfFrame.buildIR(CfFrame.java:297)
at com.android.tools.r8.ir.conversion.CfSourceCode.build(CfSourceCode.java:581)
at com.android.tools.r8.ir.conversion.CfSourceCode.buildInstruction(CfSourceCode.java:565)
at com.android.tools.r8.ir.conversion.IRBuilder.processWorklist(IRBuilder.java:874)
at com.android.tools.r8.ir.conversion.IRBuilder.build(IRBuilder.java:640)
at com.android.tools.r8.graph.CfCode.internalBuild(CfCode.java:393)
at com.android.tools.r8.graph.CfCode.internalBuildPossiblyWithLocals(CfCode.java:321)
at com.android.tools.r8.graph.CfCode.buildIR(CfCode.java:293)
at com.android.tools.r8.graph.LazyCfCode.buildIR(LazyCfCode.java:213)
at com.android.tools.r8.graph.ProgramMethod.buildIR(ProgramMethod.java:22)
at com.android.tools.r8.shaking.Enqueuer.handleReflectiveBehavior(Enqueuer.java:3624)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at com.android.tools.r8.shaking.Enqueuer.trace(Enqueuer.java:3278)
at com.android.tools.r8.shaking.Enqueuer.traceApplication(Enqueuer.java:2714)
at com.android.tools.r8.R8.runEnqueuer(R8.java:977)
at com.android.tools.r8.R8.run(R8.java:366)
at com.android.tools.r8.R8.run(R8.java:268)
at com.android.tools.r8.R8.lambda$runForTesting$1(R8.java:259)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:70)
Code for kotlinx.coroutines.internal.MainDispatcherLoader.loadMainDispatcher()
:
private final kotlinx.coroutines.MainCoroutineDispatcher loadMainDispatcher();
descriptor: ()Lkotlinx/coroutines/MainCoroutineDispatcher;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Code:
stack=4, locals=12, args_size=1
0: nop
1: getstatic #60 // Field FAST_SERVICE_LOADER_ENABLED:Z
4: ifeq 16
7: getstatic #61 // Field kotlinx/coroutines/internal/FastServiceLoader.INSTANCE:Lkotlinx/coroutines/internal/FastServiceLoader;
10: invokevirtual #43 // Method kotlinx/coroutines/internal/FastServiceLoader.loadMainDispatcherFactory$kotlinx_coroutines_core:()Ljava/util/List;
13: goto 84
16: ldc #17 // class kotlinx/coroutines/internal/MainDispatcherFactory
18: nop
19: ldc #4 // int -1
21: istore 10
23: ldc #1 // String 0
25: iinc 10, 1
28: astore 11
30: aload 11
32: invokestatic #44 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
35: tableswitch { // 0 to 0
0: 59
default: 52
}
52: iinc 10, 8
55: aconst_null
56: goto 72
59: ldc #17 // class kotlinx/coroutines/internal/MainDispatcherFactory
61: nop
62: invokevirtual #45 // Method java/lang/Class.getClassLoader:()Ljava/lang/ClassLoader;
65: iinc 10, 4
68: ldc #2 // String 19
70: astore 11
72: invokestatic #46 // Method java/util/ServiceLoader.load:(Ljava/lang/Class;Ljava/lang/ClassLoader;)Ljava/util/ServiceLoader;
75: invokevirtual #47 // Method java/util/ServiceLoader.iterator:()Ljava/util/Iterator;
78: invokestatic #48 // Method kotlin/sequences/SequencesKt.asSequence:(Ljava/util/Iterator;)Lkotlin/sequences/Sequence;
81: invokestatic #49 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
84: astore_1
85: aload_1
86: checkcast #12 // class java/lang/Iterable
89: ldc #4 // int -1
91: istore 10
93: ldc #1 // String 0
95: iinc 10, 1
98: astore 11
100: aload 11
102: invokestatic #44 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
105: tableswitch { // 0 to 0
0: 137
default: 124
}
124: iinc 10, 14
127: pop
128: aconst_null
129: astore 2
131: iconst_1
132: istore 3
134: goto 147
137: astore_2
138: iconst_0
139: istore_3
140: iinc 10, 14
143: ldc #2 // String 19
145: astore 11
147: aload_2
148: invokeinterface #50, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
153: astore 4
155: aload 4
157: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z
162: ifne 169
165: aconst_null
166: goto 357
169: aload 4
171: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
176: astore 5
178: aload 4
180: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z
185: ifne 193
188: aload 5
190: goto 357
193: aload 5
195: checkcast #17 // class kotlinx/coroutines/internal/MainDispatcherFactory
198: astore 6
200: iconst_0
201: istore 7
203: aload 6
205: invokeinterface #53, 1 // InterfaceMethod kotlinx/coroutines/internal/MainDispatcherFactory.getLoadPriority:()I
210: istore 6
212: aload 4
214: invokeinterface #52, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
219: ldc #4 // int -1
221: istore 10
223: ldc #1 // String 0
225: iinc 10, 1
228: astore 11
230: aload 11
232: invokestatic #44 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
235: tableswitch { // 0 to 0
0: 263
default: 252
}
252: iinc 10, 9
255: pop
256: aconst_null
257: aconst_null
258: astore 7
260: goto 277
263: astore 7
265: aload 7
267: checkcast #17 // class kotlinx/coroutines/internal/MainDispatcherFactory
270: iinc 10, 10
273: ldc #2 // String 19
275: astore 11
277: iload 10
279: tableswitch { // 0 to 0
0: 296
default: 309
}
296: iinc 10, 7
299: pop
300: aconst_null
301: astore 8
303: iconst_1
304: istore 9
306: goto 321
309: astore 8
311: iconst_0
312: istore 9
314: iconst_0
315: istore 10
317: ldc #1 // String 0
319: astore 11
321: aload 8
323: invokeinterface #53, 1 // InterfaceMethod kotlinx/coroutines/internal/MainDispatcherFactory.getLoadPriority:()I
328: istore 8
330: iload 6
332: iload 8
334: if_icmpge 345
337: aload 7
339: astore 5
341: iload 8
343: istore 6
345: aload 4
347: invokeinterface #51, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z
352: ifne 212
355: aload 5
357: checkcast #17 // class kotlinx/coroutines/internal/MainDispatcherFactory
360: dup
361: ifnull 375
364: aload_1
365: invokestatic #54 // Method kotlinx/coroutines/internal/MainDispatchersKt.tryCreateDispatcher:(Lkotlinx/coroutines/internal/MainDispatcherFactory;Ljava/util/List;)Lkotlinx/coroutines/MainCoroutineDispatcher;
368: dup
369: ifnull 375
372: goto 386
375: pop
376: aconst_null
377: aconst_null
378: iconst_3
379: aconst_null
380: invokestatic #55 // Method kotlinx/coroutines/internal/MainDispatchersKt.createMissingDispatcher$default:(Ljava/lang/Throwable;Ljava/lang/String;ILjava/lang/Object;)Lkotlinx/coroutines/internal/MissingMainCoroutineDispatcher;
383: checkcast #15 // class kotlinx/coroutines/MainCoroutineDispatcher
386: astore_1
387: goto 402
390: astore_2
391: aload_2
392: aconst_null
393: iconst_2
394: aconst_null
395: invokestatic #55 // Method kotlinx/coroutines/internal/MainDispatchersKt.createMissingDispatcher$default:(Ljava/lang/Throwable;Ljava/lang/String;ILjava/lang/Object;)Lkotlinx/coroutines/internal/MissingMainCoroutineDispatcher;
398: checkcast #15 // class kotlinx/coroutines/MainCoroutineDispatcher
401: astore_1
402: aload_1
403: areturn
Exception table:
from to target type
0 387 390 Class java/lang/Throwable
StackMapTable: number_of_entries = 11
frame_type = 16 /* same */
frame_type = 82 /* same_locals_1_stack_item */
stack = [ class java/util/List ]
frame_type = 255 /* full_frame */
offset_delta = 29
locals = [ class kotlinx/coroutines/internal/MainDispatcherLoader, class java/util/List, class java/lang/Iterable, int, class java/util/Iterator ]
stack = []
frame_type = 252 /* append */
offset_delta = 23
locals = [ class java/lang/Object ]
frame_type = 252 /* append */
offset_delta = 18
locals = [ int ]
frame_type = 254 /* append */
offset_delta = 42
locals = [ class java/lang/Object, int, int ]
frame_type = 255 /* full_frame */
offset_delta = 11
locals = [ class kotlinx/coroutines/internal/MainDispatcherLoader, class java/util/List, class java/lang/Iterable, int, class java/util/Iterator ]
stack = [ class java/lang/Object ]
frame_type = 81 /* same_locals_1_stack_item */
stack = [ class java/lang/Object ]
frame_type = 74 /* same_locals_1_stack_item */
stack = [ class kotlinx/coroutines/MainCoroutineDispatcher ]
frame_type = 255 /* full_frame */
offset_delta = 3
locals = [ class kotlinx/coroutines/internal/MainDispatcherLoader ]
stack = [ class java/lang/Throwable ]
frame_type = 253 /* append */
offset_delta = 11
locals = [ class kotlinx/coroutines/MainCoroutineDispatcher, class java/lang/Object ]
LineNumberTable:
line 25: 0
line 26: 1
line 27: 7
line 33: 16
line 34: 59
line 32: 72
line 35: 75
line 26: 84
line 38: 85
line 133: 147
line 134: 155
line 135: 169
line 136: 178
line 137: 193
line 38: 203
line 139: 212
line 140: 265
line 38: 321
line 141: 330
line 142: 337
line 143: 341
line 145: 345
line 146: 355
line 38: 364
line 39: 376
line 40: 390
line 42: 391
line 25: 402
LocalVariableTable:
Start Length Slot Name Signature
200 10 6 it Lkotlinx/coroutines/internal/MainDispatcherFactory;
203 7 7 $i$a$-maxBy-MainDispatcherLoader$loadMainDispatcher$1 I
311 17 8 it Lkotlinx/coroutines/internal/MainDispatcherFactory;
321 7 9 $i$a$-maxBy-MainDispatcherLoader$loadMainDispatcher$1 I
330 25 8 v$iv I
265 90 7 e$iv Ljava/lang/Object;
212 145 6 maxValue$iv I
178 179 5 maxElem$iv Ljava/lang/Object;
155 202 4 iterator$iv Ljava/util/Iterator;
138 219 2 $this$maxBy$iv Ljava/lang/Iterable;
147 210 3 $i$f$maxBy I
85 301 1 factories Ljava/util/List;
391 11 2 e Ljava/lang/Throwable;
0 404 0 this Lkotlinx/coroutines/internal/MainDispatcherLoader;
sg...@google.com <sg...@google.com> #4
The problem is calling definition.asInvokeVirtual()
on a Phi
.
sg...@google.com <sg...@google.com> #5
matt.insko, the reproduction you have provided revealed a bug in our compiler, which have now been fixed.
Now I have a question on the jars in the reproduction. As far as I can see they are kotlin-android-extensions-runtime
, kotlin-stdlib-jdk7
, kotlinx-coroutines-android
, kotlinx-coroutines-core
and kotlin-stdlib
. But from what I can see the jars you have provided in the reproduction are not to be the original distribution of these libraries, but they have been to have been rewritten/instrumented by some tool. E.g. from what I can see the code for kotlinx.coroutines.internal.MainDispatcherLoader.loadMainDispatcher()
above is the code from kotlinx-coroutines-core-1.3.8.jar
with instrumentation. Now the problem is that the StackMapTable
is not rewritten. The code for kotlinx.coroutines.internal.MainDispatcherLoader.loadMainDispatcher()
from kotlinx-coroutines-core-1.3.8.jar
is below. The StackMapTable
attribute is the same as in StackMapTable
is invalid.
This is the reason for the AssertionError
mentioned in
How did you generate these jars?
private final kotlinx.coroutines.MainCoroutineDispatcher loadMainDispatcher();
descriptor: ()Lkotlinx/coroutines/MainCoroutineDispatcher;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Code:
stack=4, locals=10, args_size=1
0: nop
1: getstatic #16 // Field FAST_SERVICE_LOADER_ENABLED:Z
4: ifeq 16
7: getstatic #22 // Field kotlinx/coroutines/internal/FastServiceLoader.INSTANCE:Lkotlinx/coroutines/internal/FastServiceLoader;
10: invokevirtual #26 // Method kotlinx/coroutines/internal/FastServiceLoader.loadMainDispatcherFactory$kotlinx_coroutines_core:()Ljava/util/List;
13: goto 35
16: ldc #28 // class kotlinx/coroutines/internal/MainDispatcherFactory
18: ldc #28 // class kotlinx/coroutines/internal/MainDispatcherFactory
20: invokevirtual #34 // Method java/lang/Class.getClassLoader:()Ljava/lang/ClassLoader;
23: invokestatic #40 // Method java/util/ServiceLoader.load:(Ljava/lang/Class;Ljava/lang/ClassLoader;)Ljava/util/ServiceLoader;
26: invokevirtual #44 // Method java/util/ServiceLoader.iterator:()Ljava/util/Iterator;
29: invokestatic #50 // Method kotlin/sequences/SequencesKt.asSequence:(Ljava/util/Iterator;)Lkotlin/sequences/Sequence;
32: invokestatic #54 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
35: astore_1
36: aload_1
37: checkcast #56 // class java/lang/Iterable
40: astore_2
41: iconst_0
42: istore_3
43: aload_2
44: invokeinterface #57, 1 // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
49: astore 4
51: aload 4
53: invokeinterface #63, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z
58: ifne 65
61: aconst_null
62: goto 163
65: aload 4
67: invokeinterface #67, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
72: astore 5
74: aload 4
76: invokeinterface #63, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z
81: ifne 89
84: aload 5
86: goto 163
89: aload 5
91: checkcast #28 // class kotlinx/coroutines/internal/MainDispatcherFactory
94: astore 6
96: iconst_0
97: istore 7
99: aload 6
101: invokeinterface #71, 1 // InterfaceMethod kotlinx/coroutines/internal/MainDispatcherFactory.getLoadPriority:()I
106: istore 6
108: aload 4
110: invokeinterface #67, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
115: astore 7
117: aload 7
119: checkcast #28 // class kotlinx/coroutines/internal/MainDispatcherFactory
122: astore 8
124: iconst_0
125: istore 9
127: aload 8
129: invokeinterface #71, 1 // InterfaceMethod kotlinx/coroutines/internal/MainDispatcherFactory.getLoadPriority:()I
134: istore 8
136: iload 6
138: iload 8
140: if_icmpge 151
143: aload 7
145: astore 5
147: iload 8
149: istore 6
151: aload 4
153: invokeinterface #63, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z
158: ifne 108
161: aload 5
163: checkcast #28 // class kotlinx/coroutines/internal/MainDispatcherFactory
166: dup
167: ifnull 181
170: aload_1
171: invokestatic #77 // Method kotlinx/coroutines/internal/MainDispatchersKt.tryCreateDispatcher:(Lkotlinx/coroutines/internal/MainDispatcherFactory;Ljava/util/List;)Lkotlinx/coroutines/MainCoroutineDispatcher;
174: dup
175: ifnull 181
178: goto 192
181: pop
182: aconst_null
183: aconst_null
184: iconst_3
185: aconst_null
186: invokestatic #81 // Method kotlinx/coroutines/internal/MainDispatchersKt.createMissingDispatcher$default:(Ljava/lang/Throwable;Ljava/lang/String;ILjava/lang/Object;)Lkotlinx/coroutines/internal/MissingMainCoroutineDispatcher;
189: checkcast #83 // class kotlinx/coroutines/MainCoroutineDispatcher
192: astore_1
193: goto 208
196: astore_2
197: aload_2
198: aconst_null
199: iconst_2
200: aconst_null
201: invokestatic #81 // Method kotlinx/coroutines/internal/MainDispatchersKt.createMissingDispatcher$default:(Ljava/lang/Throwable;Ljava/lang/String;ILjava/lang/Object;)Lkotlinx/coroutines/internal/MissingMainCoroutineDispatcher;
204: checkcast #83 // class kotlinx/coroutines/MainCoroutineDispatcher
207: astore_1
208: aload_1
209: areturn
Exception table:
from to target type
0 193 196 Class java/lang/Throwable
StackMapTable: number_of_entries = 11
frame_type = 16 /* same */
frame_type = 82 /* same_locals_1_stack_item */
stack = [ class java/util/List ]
frame_type = 255 /* full_frame */
offset_delta = 29
locals = [ class kotlinx/coroutines/internal/MainDispatcherLoader, class java/util/List, class java/lang/Iterable, int, class java/util/Iterator ]
stack = []
frame_type = 252 /* append */
offset_delta = 23
locals = [ class java/lang/Object ]
frame_type = 252 /* append */
offset_delta = 18
locals = [ int ]
frame_type = 254 /* append */
offset_delta = 42
locals = [ class java/lang/Object, int, int ]
frame_type = 255 /* full_frame */
offset_delta = 11
locals = [ class kotlinx/coroutines/internal/MainDispatcherLoader, class java/util/List, class java/lang/Iterable, int, class java/util/Iterator ]
stack = [ class java/lang/Object ]
frame_type = 81 /* same_locals_1_stack_item */
stack = [ class java/lang/Object ]
frame_type = 74 /* same_locals_1_stack_item */
stack = [ class kotlinx/coroutines/MainCoroutineDispatcher ]
frame_type = 255 /* full_frame */
offset_delta = 3
locals = [ class kotlinx/coroutines/internal/MainDispatcherLoader ]
stack = [ class java/lang/Throwable ]
frame_type = 253 /* append */
offset_delta = 11
locals = [ class kotlinx/coroutines/MainCoroutineDispatcher, class java/lang/Object ]
LineNumberTable:
line 25: 0
line 26: 1
line 27: 7
line 32: 16
line 35: 16
line 32: 16
line 35: 16
line 32: 16
line 35: 16
line 32: 16
line 33: 16
line 34: 18
line 32: 23
line 35: 26
line 26: 35
line 37: 36
line 38: 36
line 133: 43
line 134: 51
line 135: 65
line 136: 74
line 137: 89
line 38: 99
line 138: 108
line 139: 108
line 140: 117
line 38: 127
line 141: 136
line 142: 143
line 143: 147
line 145: 151
line 146: 161
line 38: 170
line 39: 182
line 40: 196
line 42: 197
line 25: 208
LocalVariableTable:
Start Length Slot Name Signature
96 10 6 it Lkotlinx/coroutines/internal/MainDispatcherFactory;
99 7 7 $i$a$-maxBy-MainDispatcherLoader$loadMainDispatcher$1 I
124 10 8 it Lkotlinx/coroutines/internal/MainDispatcherFactory;
127 7 9 $i$a$-maxBy-MainDispatcherLoader$loadMainDispatcher$1 I
136 25 8 v$iv I
117 44 7 e$iv Ljava/lang/Object;
108 55 6 maxValue$iv I
74 89 5 maxElem$iv Ljava/lang/Object;
51 112 4 iterator$iv Ljava/util/Iterator;
41 122 2 $this$maxBy$iv Ljava/lang/Iterable;
43 120 3 $i$f$maxBy I
36 156 1 factories Ljava/util/List;
197 11 2 e Ljava/lang/Throwable;
0 210 0 this Lkotlinx/coroutines/internal/MainDispatcherLoader;
ap...@google.com <ap...@google.com> #6
Branch: master
commit aad51464604c3e360b36cc1f4473e057248b439e
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Aug 04 14:58:24 2020
Add phi check when checking in value definition in service rewriter
Bug: 162568140
Change-Id: I193475d8fbff5e8b53775d38a159181b392c1183
M src/main/java/com/android/tools/r8/ir/optimize/ServiceLoaderRewriter.java
M src/test/java/com/android/tools/r8/rewrite/ServiceLoaderRewritingTest.java
ap...@google.com <ap...@google.com> #7
Branch: 2.1
commit f1c7696a1e9ce978541d9c303a2ad2261ddb8061
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Aug 04 15:14:14 2020
Version 2.1.56
Cherry-pick: Add phi check when checking in value definition in service rewriter
CL:
Cherry-pick: Reland "Ensure no service loader rewriting if it crosses a feature split"
CL:
bug: 162568140
Change-Id: I05cb372595d3755e81690cb8caab06c01b4c9c0b
M src/main/java/com/android/tools/r8/FeatureSplit.java
M src/main/java/com/android/tools/r8/Version.java
M src/main/java/com/android/tools/r8/graph/AppServices.java
M src/main/java/com/android/tools/r8/ir/optimize/ServiceLoaderRewriter.java
M src/test/java/com/android/tools/r8/rewrite/ServiceLoaderRewritingTest.java
ma...@gmail.com <ma...@gmail.com> #8
DashO. I will let the team know about your concern regarding the unaltered
StackMapTable.
Regards,
Matt Insko
On Tue, Aug 4, 2020 at 8:52 AM <buganizer-system@google.com> wrote:
sg...@google.com <sg...@google.com> #9
Thank you for you reply Matt. I see now why I could not make sense of the rewriting :-).
I will mark this fixed as the NullPointerException
issue was an actual but that was uncovered by the supplied reproduction.
Description
Building my project with AGP v4.0.1 (R8 v2.0.88) I get the following stack trace:
Caused by: java.lang.NullPointerException
at com.android.tools.r8.ir.optimize.g0.a(:52)
at com.android.tools.r8.ir.conversion.O.a(:486)
at com.android.tools.r8.ir.conversion.O.a(:417)
at com.android.tools.r8.ir.conversion.O.b(:53)
... 8 more
This error occurs during processing processing
Error in inputs/3.jar:kotlinx/coroutines/internal/MainDispatcherLoader.class at Lkotlinx/coroutines/internal/MainDispatcherLoader;loadMainDispatcher()Lkotlinx/coroutines/MainCoroutineDispatcher;
I have uploaded the compiled jars and a script for running r8 that will reproduce this issue.
I have reproduced this issue with various versions of r8 compiled from tags of
1.6.67
2.0.88 (with AGP v4.0.1)
2.1.38
2.2.6-dev
Please contact me if you need any further information.