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

Build failed for instrumentation test with the solution code and the official document #244

Open
milochen0418 opened this issue Oct 25, 2024 · 1 comment

Comments

@milochen0418
Copy link

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-write-automated-tests#4

In which task and step of the codelab can this issue be found?
Build failed for instrumentation test

Describe the problem

Screenshot 2024-10-25 at 2 25 17 PM

Steps to reproduce?

$ git clone https://github.com/google-developer-training/basic-android-kotlin-compose-training-tip-calculator.git
$ cd basic-android-kotlin-compose-training-tip-calculator
$ git checkout test_solution

Only follow the steps provided by Google official document here
https://developer.android.com/codelabs/basic-android-kotlin-compose-write-automated-tests#4

Versions
Android Studio version:
Screenshot 2024-10-25 at 2 29 55 PM

API version of the emulator:
Screenshot 2024-10-25 at 2 30 23 PM

Additional information
Include screenshots if they would be useful in clarifying the problem.

My build failed information is here

2024-10-25 14:23:52: Launching TipUITests on 'Pixel 8 API 35.
Running tests
Executing tasks: [:app:connectedDebugAndroidTest] in project /Users/milochen/gits/basic-android-kotlin-compose-training-tip-calculator


> Configure project :app
AGPBI: {"kind":"warning","text":"The option setting 'android.experimental.testOptions.emulatorSnapshots.maxSnapshotsForTestFailures=0' is experimental.","sources":[{}]}

> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:checkDebugAarMetadata UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:mapDebugSourceSetPaths UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:packageDebugResources UP-TO-DATE
> Task :app:parseDebugLocalResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugMainManifest UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugManifestForPackage UP-TO-DATE
> Task :app:processDebugResources UP-TO-DATE
> Task :app:compileDebugKotlin UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:bundleDebugClassesToCompileJar UP-TO-DATE
> Task :app:preDebugAndroidTestBuild SKIPPED
> Task :app:processDebugAndroidTestManifest UP-TO-DATE
> Task :app:generateDebugAndroidTestBuildConfig UP-TO-DATE
> Task :app:checkDebugAndroidTestAarMetadata UP-TO-DATE
> Task :app:generateDebugAndroidTestResValues UP-TO-DATE
> Task :app:mapDebugAndroidTestSourceSetPaths UP-TO-DATE
> Task :app:generateDebugAndroidTestResources UP-TO-DATE
> Task :app:mergeDebugAndroidTestResources UP-TO-DATE
> Task :app:processDebugAndroidTestResources UP-TO-DATE
> Task :app:compileDebugAndroidTestKotlin UP-TO-DATE
> Task :app:javaPreCompileDebugAndroidTest UP-TO-DATE
> Task :app:compileDebugAndroidTestJavaWithJavac UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:compressDebugAssets UP-TO-DATE
> Task :app:processDebugJavaRes UP-TO-DATE
> Task :app:mergeDebugJavaResource UP-TO-DATE
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
> Task :app:desugarDebugFileDependencies UP-TO-DATE
> Task :app:mergeExtDexDebug UP-TO-DATE
> Task :app:mergeLibDexDebug UP-TO-DATE
> Task :app:dexBuilderDebug UP-TO-DATE
> Task :app:mergeProjectDexDebug UP-TO-DATE
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :app:mergeDebugNativeLibs NO-SOURCE
> Task :app:stripDebugDebugSymbols NO-SOURCE
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:writeDebugAppMetadata UP-TO-DATE
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE
> Task :app:packageDebug UP-TO-DATE
> Task :app:createDebugApkListingFileRedirect UP-TO-DATE
> Task :app:mergeDebugAndroidTestShaders UP-TO-DATE
> Task :app:compileDebugAndroidTestShaders NO-SOURCE
> Task :app:generateDebugAndroidTestAssets UP-TO-DATE
> Task :app:mergeDebugAndroidTestAssets UP-TO-DATE
> Task :app:compressDebugAndroidTestAssets UP-TO-DATE
> Task :app:processDebugAndroidTestJavaRes UP-TO-DATE
> Task :app:mergeDebugAndroidTestJavaResource UP-TO-DATE
> Task :app:mergeDebugAndroidTestJniLibFolders UP-TO-DATE
> Task :app:mergeDebugAndroidTestNativeLibs NO-SOURCE
> Task :app:checkDebugAndroidTestDuplicateClasses UP-TO-DATE
> Task :app:desugarDebugAndroidTestFileDependencies UP-TO-DATE
> Task :app:mergeExtDexDebugAndroidTest UP-TO-DATE
> Task :app:mergeLibDexDebugAndroidTest UP-TO-DATE
> Task :app:dexBuilderDebugAndroidTest UP-TO-DATE
> Task :app:mergeProjectDexDebugAndroidTest UP-TO-DATE
> Task :app:validateSigningDebugAndroidTest UP-TO-DATE
> Task :app:writeDebugAndroidTestSigningConfigVersions UP-TO-DATE
> Task :app:packageDebugAndroidTest UP-TO-DATE
> Task :app:createDebugAndroidTestApkListingFileRedirect UP-TO-DATE
> Task :app:connectedDebugAndroidTest FAILED


FAILURE: 
Build failed with an exception.




* What went wrong:


Execution failed for task ':app:connectedDebugAndroidTest'.


> 
There were failing tests. See the report at: file:///Users/milochen/gits/basic-android-kotlin-compose-training-tip-calculator/app/build/reports/androidTests/connected/debug/index.html




* Try:


> 
Run with 
--stacktrace
 option to get the stack trace.


> 
Run with 
--info
 or 
--debug
 option to get more log output.


> 
Run with 
--scan
 to get full insights.


> 
Get more help at 
https://help.gradle.org
.




BUILD FAILED
 in 5s


61 actionable tasks: 1 executed, 60 up-to-date

@milochen0418 milochen0418 changed the title Intro to state in Compose: Android Basics in Compose Build failed for instrumentation test Oct 25, 2024
@milochen0418 milochen0418 changed the title Build failed for instrumentation test Build failed for instrumentation test with the solution code Oct 25, 2024
@milochen0418 milochen0418 changed the title Build failed for instrumentation test with the solution code Build failed for instrumentation test with the solution code and official document Oct 25, 2024
@milochen0418 milochen0418 changed the title Build failed for instrumentation test with the solution code and official document Build failed for instrumentation test with the solution code and the official document Oct 25, 2024
@TripleCamera
Copy link

@milochen0418 I encountered the same problem, and fixed it after upgrading to the latest version of AGP (Tools > AGP Upgrade Assistant...) You can have a try.

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

2 participants