android/sunflower

[Bug]: NoClassDefFoundError when instrumented test.

Jaehwa-Noh opened this issue · 0 comments

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