-
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
Detox doesn't work with React-Native 0.59 on Android #1208
Comments
Facing the same errors here with RN 0.59.1. I've pretty much the same environment: Environment:
|
Same thing here after upgrading to Detox 11.0.0
|
Has anyone been able to find a workaround?
|
I was able to patch this by going into the
The
|
For those of you using diff --git a/node_modules/detox/android/detox/build.gradle b/node_modules/detox/android/detox/build.gradle
index 7185ab1..9c0494d 100644
--- a/node_modules/detox/android/detox/build.gradle
+++ b/node_modules/detox/android/detox/build.gradle
@@ -20,12 +20,16 @@ android {
versionName "1.0"
}
+ configurations.all {
+ resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
+ }
+
productFlavors {
flavorDimensions "minReactNative"
- minReactNative44 {
- dimension "minReactNative"
+ // minReactNative44 {
+ // dimension "minReactNative"
- }
+ // }
minReactNative46 {
dimension "minReactNative"
}
@@ -69,11 +73,11 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$_kotlinVersion"
- minReactNative44Implementation 'com.squareup.okhttp3:okhttp:3.4.1'
- minReactNative44Implementation 'com.squareup.okhttp3:okhttp-ws:3.4.1'
+ // minReactNative44Implementation 'com.squareup.okhttp3:okhttp:3.4.1'
+ // minReactNative44Implementation 'com.squareup.okhttp3:okhttp-ws:3.4.1'
- minReactNative46Implementation 'com.squareup.okhttp3:okhttp:3.6.0'
- minReactNative46Implementation 'com.squareup.okio:okio:1.13.0'
+ minReactNative46Implementation 'com.squareup.okhttp3:okhttp:3.12.1'
+ minReactNative46Implementation 'com.squareup.okio:okio:1.15.0'
// Versions are in-sync with the 'androidx-test-1.1.0' release/tag of the android-test github repo,
// used by the Detox generator. See https://github.com/android/android-test/releases/tag/androidx-test-1.1.0
|
@elyalvarado There are few things to consider in this context:
|
Everyone interested in work associated with RN versions (on Android) are most welcome to follow the original upgrade issue. I'd be happy to get insights and feedback from everyone there! For now, closing this issue. |
FYI: Selecting the correct build flavor does not prevent these errors. If a build flavor is present, it's dependency constraints are taken into account. That's why I actually had to comment out the other one to even make it work. |
@d4vidi If according to @kbrandwijk the issue is not fixed by selecting the correct build flavor, why was it closed? I understand Android support for +0.56 is WIP, but if the issue exist it should remain open to keep track of it. I also think that going through Android Studio shouldn't be needed, given that the detox cli exists it should work regardless. |
@elyalvarado sorry, I've somehow had that overlooked. Please try the following:
implementation('com.squareup.okhttp3:okhttp:3.12.1') { force = true }
implementation('com.squareup.okio:okio:1.15.0') { force = true }
implementation('com.google.code.findbugs:jsr305:3.0.2') { force = true} A bit nasty but it oughta do it. |
In any case, we're still partly stuck due to the RN issue I've mentioned. Please help us out by upvoting :) |
The:
...mentioned in #1208 (comment) sounds like the kind of thing that should work here, but doesn't. One problem I can see is that the "implementation" is for the app, not test code. If replace "implementation" with "androidTestImplementation" still get version conflicts for the same three libraries. This is for detox 11.0.2. |
@jgreen210 could you provide a gradle log snippet containing info regarding the conflicts? |
detox 11.0.2 Redoing what #1208 (comment) |
I'm also getting the same error as @jgreen210 using detox 11.0.2 and rn 0.59.1 |
@jgreen210 was that when using |
@Lythenas care to provide some gradle logs? |
The logs in #1208 (comment) were with neither "implementation" nor "androidTestImplementation". I didn't try "implementation" since it's wrong. I did try "androidTestImplementation" - it gave the same errors (although I didn't actually compare them line by line). |
I'm still having the described issue on detox 11.0.2 and RN 0.59.1
|
@d4vidi I't pretty much the same as the others:
With
And with
Btw: Is there any way to make the logs collapsible on github? |
I guess using |
Just for protocol I managed to get my app to build on .59 with detox 12 by changing
to
and
to the android block |
Gosh, i hate upgrading react native versions, but I wanted hooks sooo bad, but now I've been pulling my hair out coz I'm getting the same errors with React Native v59.2 and detox v12.1.1. |
Same issue, RN 0.59.2, Detox 12.1.1 |
I have RN 0.59.2 and Detox 12.1.1 the following patch to detox (based on @kbrandwijk suggestions) makes it work for me:
I don't want the hassle of having to keep a fork up to date, so I'm using patch-package to automatically apply the same patch on any upgrade, keep it in version control, and avoid yarn removing my patch. I highly recommend it for this cases. If anybody wants to apply this patch manually and check if it works, you can copy and paste the content of the patch into a file (
|
Yeah that's basically the same answer I posted 12 days ago, and we're no closer to actually getting those dependencies sorted... :( |
@kbrandwijk that's true, but two things here:
I updated my comment to reflect that the patch was created based on your suggestions. |
@elyalvarado I absolutely agree about |
Hi I am using Detox 12.1.1 and RN 0.59 when I am trying to build with androidx changes i am getting below error for react-native-camera
FAILURE: Build failed with an exception.
BUILD FAILED in 9s I have also used the below option as suggested by web but didn't get any success , Can anyone look into this because i am able to build with android studio . |
Android X isn't even supported by RN 0.59 yet, so I fail to see how Detox fits in. However, you could try adding that |
So why detox choose to upgrade on androidx
On Mon, 1 Apr 2019 at 5:09 PM, Kim Brandwijk ***@***.***> wrote:
Android X isn't even supported by RN 0.59 yet, so I fail to see how Detox
fits in. However, you could try adding that exclude to the build.gradle
of react-native-camera.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1208 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AX8BlmYPMG5ojGmJ_VVcaxerNai4voxVks5vce_4gaJpZM4b0dMJ>
.
--
Yogesh Thanvi
QA Team Lead
Punchh Tech India Pvt Ltd
|
Detox's use of androidx is forcing you to enable androidx in your app's gradle.properties (i.e. globally), and I'm struggling to see a way to make it work with a react-native project with a significant number of dependencies. They'd all need to move to androidx at the same time or some sort of automated patching would be required (facebook/react-native#23112). The first option isn't possible (short of forking them all). The second option appears to need support from google, probably via a change in its jetifier tool that would allow it to be used in an npm/yarn postinstall hook. |
I am using the latest Detox version, and didn't run into that requirement... |
Please give the latest Detox - |
Big thanks @d4vidi, @elyalvarado and everyone else involved for getting this sorted. |
Sure thing, happy to help! |
Working fine with 12.1.3 but got the below failure which solved by adding packaging options What went wrong: Solved By : |
Describe the bug
After upgrading React Native to version 0.59 detox fails compiling the Android project. The standalone Android project builds and works ok when not using detox. The output of the build process is the following:
The full error output continues for a while (and is pasted at the end of this issue).
It looks like react native 0.59 upgraded many android libraries to newer versions, and the resolution in the detox project is failing for the following libraries:
In all those cases the version provided by React Native is newer than the one being used by detox or any of its dependencies.
To Reproduce
Upgrade a working project to RN 0.59, and build any android configuration. Ex:
detox build -c android.emu.debug
Expected behavior
Detox should work with newer react native version
Environment (please complete the following information):
Device and Verbose Detox Logs
The text was updated successfully, but these errors were encountered: