Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash: NoSuchMethodError (handleException) in Kotlin.coroutines.CoroutineExceptionHandler in android.test.tools.crawler #2155

Closed
AaronMT opened this issue Feb 21, 2024 · 2 comments

Comments

@AaronMT
Copy link

AaronMT commented Feb 21, 2024

We recently upgraded to coroutines 1.8.0 https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.8.0 and are seeing runtime crashes on Test Lab's Robo Crawler (android.test.tools.crawler).

Not sure if this is the right spot to file an issue about this (test.tools.crawler), but does this mean androidx.test.tools.crawler needs to target 1.8.0 as this method is not found at runtime?

If unrelated, not sure if we need to start adding -keep interface kotlinx.coroutines.CoroutineExceptionHandler { *; } or equivalent to pro guard, as this seems to be happening on optimized builds that we want to have crawled.

java.lang.RuntimeException: Exception while trying to handle coroutine exception
     FATAL EXCEPTION: EditToolbar-thread-1
Process: org.mozilla.fenix, PID: 8372
java.lang.RuntimeException: Exception while trying to handle coroutine exception
	at coil.util.-Logs.handleUncaughtCoroutineException(Logs.kt:32)
	at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:35)
	at kotlinx.coroutines.StandaloneCoroutine.handleJobException(Builders.common.kt:3)
	at kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:105)
	at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:239)
	at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:5)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:14)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:111)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:923)
	Suppressed: java.lang.RuntimeException: Exception while trying to handle coroutine exception
		at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:28)
		... 10 more
		Suppressed: java.util.ConcurrentModificationException
			at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1212)
			at java.util.TreeMap$KeyIterator.next(TreeMap.java:1266)
			at mozilla.components.feature.toolbar.ToolbarAutocompleteFeature$2.invokeSuspend(ToolbarAutocompleteFeature.kt:89)
			at mozilla.components.feature.toolbar.ToolbarAutocompleteFeature$2.invoke(ToolbarAutocompleteFeature.kt:20)
			at mozilla.components.browser.toolbar.AsyncFilterListener$invoke$1.invokeSuspend(BrowserToolbar.kt:46)
			at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
			... 4 more
	Caused by: java.lang.NoSuchMethodError: No interface method handleException(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Throwable;)V in class Lkotlinx/coroutines/CoroutineExceptionHandler; or its super classes (declaration of 'kotlinx.coroutines.CoroutineExceptionHandler' appears in /data/app/~~9T6mRjP2eVImxY7vTlbjKg==/androidx.test.tools.crawler-y5xVBFr1jsDS7CkGFvTmIg==/base.apk)
		at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:11)
		... 10 more
Caused by: java.lang.NoSuchMethodError: No interface method handleException(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Throwable;)V in class Lkotlinx/coroutines/CoroutineExceptionHandler; or its super classes (declaration of 'kotlinx.coroutines.CoroutineExceptionHandler' appears in /data/app/~~9T6mRjP2eVImxY7vTlbjKg==/androidx.test.tools.crawler-y5xVBFr1jsDS7CkGFvTmIg==/base.apk)
	at coil.util.-Logs.handleUncaughtCoroutineException(Logs.kt:19)
@brettchabot
Copy link
Collaborator

androidx.test.tools.crawler is maintained by the firebase test lab team. I'd suggest following up on https://firebase.google.com/support

@WoYang
Copy link

WoYang commented Mar 14, 2024

I had the same problem this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants