Skip to content

com.android.tools.r8.CompilationFailedException: Compilation failed to complete #2452

@clems36

Description

@clems36

Describe the bug

Running detox build -c android.emu.stag.release fails with the error above. This is only the case when i'm trying to run a release build, detox build -c android.emu.stag.debug runs fine.
The exact error i'm seeing is:

> Task :app:transformClassesAndResourcesWithR8ForStagReleaseAndroidTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithR8ForStagReleaseAndroidTest'.
> com.android.tools.r8.CompilationFailedException: Compilation failed to complete

I'm using Proguard in my app (i've followed the Proguard setup for Detox) and the app usually runs
app:transformClassesAndResourcesWithProguardForStagRelease when building and not R8.

To Reproduce

  • I have tested this issue on the latest Detox release and it still reproduces

Follow the setup guide for android step by step, build the app with detox build -c android.emu.stag.release. The content of .detoxrc.json is the following:

{
  "testRunner": "jest",
  "runnerConfig": "e2e/config.json",
  "configurations": {
    "android.emu.stag.debug": {
      "binaryPath": "android/app/build/outputs/apk/stag/debug/app-stag-debug.apk",
      "build": "cd android && ./gradlew app:assembleStagDebug app:assembleStagDebugAndroidTest -DtestBuildType=debug && cd ..",
      "type": "android.emulator",
      "device": {
        "avdName": "Pixel_API_29_AOSP"
      }
    },
    "android.emu.stag.release": {
      "binaryPath": "android/app/build/outputs/apk/stag/release/app-stag-release.apk",
      "build": "cd android && ./gradlew app:assembleStagRelease app:assembleStagReleaseAndroidTest -DtestBuildType=release && cd ..",
      "type": "android.emulator",
      "device": {
        "avdName": "Pixel_API_29_AOSP"
      }
    }
  }
}

Expected behavior

I would expect the build to pass the same way it does for the debug build.

Logs:

This is a small part of what i'm seeing before it fails (the list goes on forever, i can't even see the full trace in my terminal):

R8: 'void ensureIsInitialized()' already has a mapping
R8: 'void initialize()' already has a mapping
R8: 'java.util.Map getPropSetterInfos()' already has a mapping
R8: 'void <clinit>()' already has a mapping
R8: 'void <clinit>()' already has a mapping
R8: 'void <clinit>()' already has a mapping
R8: 'void <init>(com.facebook.react.uimanager.ThemedReactContext,android.util.AttributeSet)' already has a mapping
R8: 'android.net.Uri getURI(java.lang.String)' already has a mapping
R8: 'void drawPdf()' already has a mapping
R8: 'void setEnablePaging(boolean)' already has a mapping
R8: 'void setFitPolicy(int)' already has a mapping

Environment

  • Detox: 17.10.6
  • React Native: ~0.63.2
  • Node: v12.14.1
  • Device: Pixel 1 emulator
  • OS: android
  • Test-runner: jest-circus

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions