-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
android build fails react-native < 0.65 + 2.3.0-alpha.2 + android build flavors #2245
Comments
Issue validatorThe issue is valid! |
Here's an example of a repo that has a similar need, at the very top of the loop on variants they get the name, then at the bottom they do a dependsOn of a dynamic task name based on variant name. The middle will not be interesting here, but it illustrates the principle https://github.com/oblador/react-native-vector-icons/blob/master/fonts.gradle |
@piaskowyk no intention to pressure (it's open source of course!) just wanted to note that 0.65 is getting very close to release, and this package is still alpha for 0.65 compatibility Seems odd but even as an affected party (my app uses build variants) as long as it was semver major with a note, I think that's acceptable - it's what semver majors are for. The warning could be "This release is intended for people upgrading to react-native 0.65. If you are using build variants in Android and are still on react-native 0.64, you should stay on reanimated 2.2.x until a fix for #2245 is contributed. Thanks") |
@mikehardy 0.65 was released today |
HI, I managed to have some problems with reanimated jus hours ago and if you don't mind me asking. You mentioned about staying on 0.64 with Reanimated 2.2.X, i wonder if my maching has something to do with it becuase Im new to RN and yarn just automatically installed 0.65 RN and 2.2.0, Now beacuse they're incompatible, I tried downgrading Rn to 0.64 or 0.63 in a guess that it might fix it. Now i managed to install 2.3.0 via the yarn install optional dialog when I touched my package the json file and reanimated was working again so 0.65 and 2.3.0 was the solution for that. I wonder if how could I safely use and run reanimated 2.2.0 and RN 0.64 for the mean time because it looks like reanimated is in alpha stage right now./ thanks. :) |
With apologies, I've updated the app I have with build flavors to react-native 0.65, so this issue does not affect me. I'd love to contribute a PR to fix it but I'm already maintaining a bunch of open source stuff and don't have the bandwidth to work on this since it no longer affects me and there is a fix for it that's the "happy path" anyway (upgrade to react-native 0.65...) |
## Description Added support for Gradle flavor. Solution based on https://stackoverflow.com/a/34679933/7276742 Fixes - #2245 - #2292
Description
The < 65 version of the android build is not android build flavor aware
Expected behavior
Building with flavors should work?
Actual behavior & steps to reproduce
Building with flavors fails because the tasks depended on in the build.gradle for this module are not flavor aware, so they don't exist
Snack or minimal code example
react-native-reanimated/android-npm/build.gradle
Lines 62 to 72 in 73c620a
An example of making them work correctly is to replace every 'Release' or 'Debug' with 'DevRelease' or 'DevDebug' in my project (I have a 'dev' flavor, and it results in tasks with 'Dev' sliced in the task names)
I think it needs some magic like an application variants loop and then set the replace task to depend on the merge/strip of each variants https://stackoverflow.com/a/63922131/9910298
Package versions
Affected platforms
The text was updated successfully, but these errors were encountered: