Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

[Bug]: NoClassDefFoundError when instrumented test. #965

Open
4 tasks done
Jaehwa-Noh opened this issue Apr 12, 2024 · 0 comments
Open
4 tasks done

[Bug]: NoClassDefFoundError when instrumented test. #965

Jaehwa-Noh opened this issue Apr 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Jaehwa-Noh
Copy link
Contributor

Jaehwa-Noh commented Apr 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

Is this an issue related to the sample app?

  • Yes, this is a specific issue related to this samples repo.

What happened?

Android Studio: Android Studio Iguana | 2023.2.1 Patch 2
Emulator: API 34_Resizable experimental

When I run instrumented test, the test is opened twice.
What I run is PlantDetailComposeTest
This has been not normal behave so that I check the logcat.
There are FATAL EXCEPTION as below.

Relevant logcat output

FATAL EXCEPTION: main
	Process: com.google.samples.apps.sunflower.test, PID: 3291
	java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/test/internal/platform/app/ActivityInvoker;
		at java.lang.Class.newInstance(Native Method)
		at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
		at android.app.Instrumentation.newActivity(Instrumentation.java:1378)
		at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3676)
		at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922)
		at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
		at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
		at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
		at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
		at android.os.Handler.dispatchMessage(Handler.java:106)
		at android.os.Looper.loopOnce(Looper.java:205)
		at android.os.Looper.loop(Looper.java:294)
		at android.app.ActivityThread.main(ActivityThread.java:8177)
		at java.lang.reflect.Method.invoke(Native Method)
		at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
		at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
	Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.test.internal.platform.app.ActivityInvoker" on path: DexPathList[[zip file "/data/app/~~uJP-XT7Eh9tvASW5FWMN5Q==/com.google.samples.apps.sunflower.test-be_d50sR5l-ARmi0cJrljg==/base.apk"],nativeLibraryDirectories=[/data/app/~~uJP-XT7Eh9tvASW5FWMN5Q==/com.google.samples.apps.sunflower.test-be_d50sR5l-ARmi0cJrljg==/lib/x86_64, /system/lib64, /system_ext/lib64]]
		at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
		at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
		at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
		at java.lang.Class.newInstance(Native Method) 
		at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) 
		at android.app.Instrumentation.newActivity(Instrumentation.java:1378) 
		at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3676) 
		at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922) 
		at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 
		at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) 
		at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) 
		at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443) 
		at android.os.Handler.dispatchMessage(Handler.java:106) 
		at android.os.Looper.loopOnce(Looper.java:205) 
		at android.os.Looper.loop(Looper.java:294) 
		at android.app.ActivityThread.main(ActivityThread.java:8177) 
		at java.lang.reflect.Method.invoke(Native Method) 
		at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) 
		at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) 

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Jaehwa-Noh Jaehwa-Noh added the bug Something isn't working label Apr 12, 2024
@Jaehwa-Noh Jaehwa-Noh changed the title [Bug]: NoClassDefFoundError when instrument test. [Bug]: NoClassDefFoundError when instrumented test. Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant