ferPrieto / SpaceX-prepare-for-Clean-Architecture-liftoff

Clean Architecture Modular Project: MVVM + Jetpack Compose + Coroutines + Flows + Dagger2 + LiveData + UnitTests + UITests + Screenshot Tests + MockWebServer
715 stars 88 forks source link

Issues with Connected Android Test #87

Open robertoaltieri opened 1 year ago

robertoaltieri commented 1 year ago

This might be an issue with my environment. I have checked out the latest version of master 0cc02b3. When I run:

gradle --version

I get:


Gradle 7.5.1

Build time: 2022-08-05 21:17:56 UTC Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918>

Kotlin: 1.6.21 Groovy: 3.0.10 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 11.0.17 (Oracle Corporation 11.0.17+10-LTS-269) OS: Mac OS X 13.2.1 x86_64

When I run: ./gradlew connectedAndroidTest

I get the error:

Duplicate class org.checkerframework.checker.compilermsgs.qual.CompilerMessageKey found in modules checker-3.1

If I try to run them from Android Studio, I get a different error

Unable to find explicit activity class {prieto.fernando.spacex.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared ?

ferPrieto commented 1 year ago

Ok I'll have a look asap @robertoaltieri, thanks for the heads up

robertoaltieri commented 1 year ago

I deleted the ~/.gradle folder and now I get a different error. To avoid issue with my environment I have forked your repo and added an action to run the tests. Now I get on the CI the same error that I get locally:

* What went wrong:
java.lang.StackOverflowError (no error message)

I see many errors like these ones:


prieto.fernando.spacex.presentation.screens.MainScreenKtTest > appNavigatesToLaunchesTabWhenSelected[test(AVD) - 13] FAILED 
    android.content.ActivityNotFoundException: Unable to find explicit activity class {prieto.fernando.spacex.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2197)

prieto.fernando.spacex.presentation.screens.MainScreenKtTest > app_loads_dashboard_by_default[test(AVD) - 13] FAILED 
    android.content.ActivityNotFoundException: Unable to find explicit activity class {prieto.fernando.spacex.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2197)

prieto.fernando.spacex.presentation.screens.MainScreenKtTest > bottom_tabs_displayed[test(AVD) - 13] FAILED 
    android.content.ActivityNotFoundException: Unable to find explicit activity class {prieto.fernando.spacex.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2197)

If you want I can make a PR to show it to you

robertoaltieri commented 1 year ago

BTW if I run it in Android studio I get an error because the test is trying to set the content again after the activity has already done it