-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
com.android.tools.r8.CompilationFailedException: Compilation failed to complete #2452
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! For more information on bots in this reporsitory, read this discussion. |
@clems36 this is most likely a configuration issue related to proguard / R8 enabling and rules association with each target (production/test APK, with flavours). I don't think it suggests a problem with Detox' prebaked rules, but it's hard to track these down without proper access to the Gradle build scripts. If you could work out an equivalent demo app where this reproduced - that would be best. Alternatively, for running Detox you might be able to resort to this command for building the test code:
(namely, have prod-code built in release - as you already do, yet keep the test-code built in debug). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! For more information on bots in this reporsitory, read this discussion. |
The issue has been closed for inactivity. |
I had a similar issue here, my workaround was to disable minification for my productFlavor. Here are the relevant changes I made: // app/build.gradle def enableProguardInReleaseBuilds = System.getProperty('enableProguardInReleaseBuilds', 'true').toBoolean() // package.json "build": "cd android && ./gradlew assembleE2eRelease assembleE2eReleaseAndroidTest -DtestBuildType=release -DenableProguardInReleaseBuilds=false && cd ..", |
@awinograd Thanks for sharing this - some may find it useful. However, I cannot personally recommend that as other than a last-resort solution, because the interest is to be able to run Detox as close as possible to the actual production app you'd eventually be uploading to the store -- and in the production one, you really do want minification enabled. |
@d4vidi . Thanks for your feedback. yes, it's not ideal that the app isn't running as close to prod as possible. When I tried your proposed solution in #2452 (comment) I got a "No instrumentation runner found on device" error which I wasn't able to resolve. Granted, I'm no expert, and may not have known how to address it! I tried setting testBinaryPath manually to no effect |
I understand. The proper solution is to pinpoint the missing minification (R8/Proguard) rules and add them in the right place. I'm afraid that's easier said than done (see my blogpost on this), but it should bring you up to speed with running on the real-ish app. |
com.android.tools.r8.CompilationFailedException: Compilation failed to complete |
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:
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 notR8
.To Reproduce
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: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):
Environment
jest-circus
The text was updated successfully, but these errors were encountered: