All right, I have scoured the internet and I'm still struggling with this stuff. I have an android library (the full code can be found here) that I'm working on. So gist is, after upgrading to Android studio Flamingo and the other lots to the latest version, the debug run from the UI essentially stopped connecting to either an emulator or a real device. I have no clue why. Below is the build log, but hey you can clone the project and try it yourself.
05/31 21:02:51: Launching 'testldc1()' on Pixel 4 API 30.
Running tests
Open logcat panel for emulator Pixel 4 API 30
Executing tasks: [:mips:connectedDebugAndroidTest] in project /Users/yuck/dev/repos/mips-simulator
> Configure project :mips
AGPBI: {"kind":"warning","text":"The option setting 'android.experimental.testOptions.emulatorSnapshots.maxSnapshotsForTestFailures=0' is experimental.","sources":[{}]}
> Task :mips:preBuild UP-TO-DATE
> Task :mips:preDebugBuild UP-TO-DATE
> Task :mips:generateDebugResValues
> Task :mips:generateDebugResources
> Task :mips:packageDebugResources
> Task :mips:preDebugAndroidTestBuild UP-TO-DATE
> Task :mips:javaPreCompileDebug
> Task :mips:javaPreCompileDebugAndroidTest
> Task :mips:parseDebugLocalResources
> Task :mips:writeDebugAarMetadata
> Task :mips:processDebugManifest
> Task :mips:compileDebugLibraryResources
> Task :mips:generateDebugRFile
> Task :mips:checkDebugAndroidTestAarMetadata
> Task :mips:compileDebugJavaWithJavac
> Task :mips:generateDebugAndroidTestResValues
> Task :mips:mapDebugAndroidTestSourceSetPaths
> Task :mips:generateDebugAndroidTestResources
> Task :mips:bundleLibCompileToJarDebug
> Task :mips:extractDeepLinksDebug
> Task :mips:processDebugAndroidTestManifest
> Task :mips:mergeDebugAndroidTestShaders
> Task :mips:compileDebugAndroidTestShaders NO-SOURCE
> Task :mips:generateDebugAndroidTestAssets UP-TO-DATE
> Task :mips:mergeDebugShaders
> Task :mips:compileDebugShaders NO-SOURCE
> Task :mips:generateDebugAssets UP-TO-DATE
> Task :mips:packageDebugAssets
> Task :mips:mergeDebugAndroidTestAssets
> Task :mips:compressDebugAndroidTestAssets
> Task :mips:processDebugJavaRes NO-SOURCE
> Task :mips:bundleLibResDebug NO-SOURCE
> Task :mips:processDebugAndroidTestJavaRes NO-SOURCE
> Task :mips:mergeDebugAndroidTestResources
> Task :mips:mergeDebugJniLibFolders
> Task :mips:mergeDebugNativeLibs NO-SOURCE
> Task :mips:copyDebugJniLibsProjectOnly
> Task :mips:mergeDebugAndroidTestJniLibFolders
> Task :mips:mergeDebugAndroidTestNativeLibs NO-SOURCE
> Task :mips:desugarDebugAndroidTestFileDependencies
> Task :mips:checkDebugAndroidTestDuplicateClasses
> Task :mips:validateSigningDebugAndroidTest
> Task :mips:bundleLibRuntimeToJarDebug
> Task :mips:writeDebugAndroidTestSigningConfigVersions
> Task :mips:bundleLibRuntimeToDirDebug
> Task :mips:mergeDebugAndroidTestJavaResource
> Task :mips:processDebugAndroidTestResources
> Task :mips:compileDebugAndroidTestJavaWithJavac
> Task :mips:dexBuilderDebugAndroidTest
> Task :mips:mergeLibDexDebugAndroidTest
> Task :mips:mergeProjectDexDebugAndroidTest
> Task :mips:mergeExtDexDebugAndroidTest
> Task :mips:packageDebugAndroidTest
> Task :mips:createDebugAndroidTestApkListingFileRedirect
> Task :mips:connectedDebugAndroidTest
Starting 0 tests on Pixel_4_API_30(AVD) - 11
> Task :mips:connectedDebugAndroidTest FAILED
41 actionable tasks: 41 executed
Test run failed to complete. Instrumentation run failed due to Process crashed.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mips:connectedDebugAndroidTest'.
> There were failing tests. See the report at: file:///Users/yuck/dev/repos/mips-simulator/mips/build/reports/androidTests/connected/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 16s
It does say that test failed which is indeed true, however, the debugger never attached and my break points were pointless. This makes it extremely hard for me figured why it's failing and my tool is failing at this point.
I've used the solutions that suggested using androidx
runner and even followed the instruction here to setup my tests dependencies from scratch. Tried excluding junit
dependency and only have the one from andriodx
but still no go. And cleared cache and invalidate and the other obvious things.