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

NoMethodFound crashes with new beta01 releases #2229

Closed
rvandermeulen opened this issue May 21, 2024 · 2 comments
Closed

NoMethodFound crashes with new beta01 releases #2229

rvandermeulen opened this issue May 21, 2024 · 2 comments

Comments

@rvandermeulen
Copy link

Description

I recently ran some tests with the newly-available beta01 builds, but I'm seeing NoMethodFound crashes when running our test suite in Firebase. From what I can see, somehow Tracing is being included transitively and is somehow being force-downgraded to version 1.0.0, breaking the tests. We're running with AGP 8.4.0. Is there a way for AndroidX Test to force the usage of 1.1.0?

Expected Results

Tests run without error.

Actual Results

Crashes like below:

java.lang.NoSuchMethodError: No static method forceEnableAppTracing()V in class Landroidx/tracing/Trace; or its super classes (declaration of 'androidx.tracing.Trace' appears in /data/app/~~9lig4wljZGQoejYAYxvzkg==/org.mozilla.reference.browser.debug-vt1UJt2eb2DgvMdAGFjIQg==/base.apk!classes13.dex)
at androidx.test.platform.tracing.AndroidXTracer.enableTracing(AndroidXTracer.java:57)
at androidx.test.platform.tracing.Tracing.<init>(Tracing.java:53)
at androidx.test.platform.tracing.Tracing.<clinit>(Tracing.java:49)
at androidx.test.platform.tracing.Tracing.getInstance(Tracing.java:62)
at androidx.test.espresso.base.BaseLayerModule.providesTracing(BaseLayerModule.java:190)
at androidx.test.espresso.base.BaseLayerModule_ProvidesTracingFactory.providesTracing(BaseLayerModule_ProvidesTracingFactory.java:37)
at androidx.test.espresso.base.BaseLayerModule_ProvidesTracingFactory.get(BaseLayerModule_ProvidesTracingFactory.java:29)
at androidx.test.espresso.base.BaseLayerModule_ProvidesTracingFactory.get(BaseLayerModule_ProvidesTracingFactory.java:11)
at androidx.test.espresso.core.internal.deps.dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at androidx.test.espresso.base.IdlingResourceRegistry_Factory.get(IdlingResourceRegistry_Factory.java:34)
at androidx.test.espresso.base.IdlingResourceRegistry_Factory.get(IdlingResourceRegistry_Factory.java:12)
at androidx.test.espresso.core.internal.deps.dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at androidx.test.espresso.DaggerBaseLayerComponent$BaseLayerComponentImpl.idlingResourceRegistry(DaggerBaseLayerComponent.java:275)
at androidx.test.espresso.Espresso.<clinit>(Espresso.java:64)
at androidx.test.espresso.Espresso.onView(Espresso.java:86)
at org.mozilla.reference.browser.ui.robots.NavigationToolbarRobotKt.<clinit>(NavigationToolbarRobot.kt:96)
at org.mozilla.reference.browser.ui.robots.NavigationToolbarRobotKt.navigationToolbar(Unknown Source:0)
at org.mozilla.reference.browser.ui.ThreeDotMenuTest.threeDotMenuItemsTest(ThreeDotMenuTest.kt:90) 

AndroidX Test and Android OS Versions

androidx-test-core = "1.6.0-beta01"
androidx-test-espresso = "3.6.0-beta01"
androidx-test-monitor = "1.7.0-beta01"
androidx-test-orchestrator = "1.5.0-beta01"
androidx-test-runner = "1.6.0-beta01"
androidx-test-uiautomator = "2.3.0"

This is running on the Firebase Pixel2.arm version 30 device.

Link to a public git repo demonstrating the problem:

mozilla-mobile/reference-browser@master...rvm_androidx_test

@utzcoz
Copy link
Contributor

utzcoz commented May 22, 2024

I think this issue is similar to #1755.

@brettchabot
Copy link
Collaborator

Thanks for the report. Yes this issue i identical to #1755

The workaround for now is to explicitly add ' implementation androidx.tracing:tracing:1.1.0' to your dependencies to force AGP to use the newer version

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