-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
🐛 Building android with React Native 0.71 #1418
Comments
I also face with this issue. :( |
I guess this is the reason (from node-modules/android/README.md):
And in react-native-vision-camera/android/build.graddle:
|
Suggested fix is to replace
And also temporary disable frame processors for Android only until proper fix will be available. PS Disabling Frame Processors cause losing some functionalities like bar code scanner. |
+1 |
1 similar comment
+1 |
Note: this only happens if frame processors are enabled. With no frame processor one can bump kotlinVersion to 1.6.20 (or higher) and be done with it. I'd say we should stay clear of 0.71 for a few months since a bunch of libs (I made 5+ patch-package to make my app build with 0.71, haven't tested functionalities yet) are broken because RN moved android artifacts to Maven. Some of those broken libs can get away with a simple patch package(i.e. don't build RN from source, instead use the On my side both reanimated and vision-camera has no support for Fabric so I'll stick to 0.67. I see no point upgrading RN since 1) we can't have React 18 features 2) we can't have Fabric 3) that's a ton of trouble upgrading RN. |
3rd party libraries - updates and requests, if anyone is interested reactwg/react-native-new-architecture#6 Note that I still had to make patch-package for some of those marked as "complete" to work with Fabric + 0.71, react-native-safe-area-context and react-native-screens included. |
same issue for me |
same issue for me, blocking |
An rather crude (and dumb) solution would be
This solution SHOULD enable people with almost zero knowledge about how the build process of react-native-vision-camera to use frame processors with RN 0.71. |
It appears that both https://mvnrepository.com/artifact/com.facebook.react/react-native and https://mvnrepository.com/artifact/com.facebook.react/hermes-engine were abandoned after the incident on Nov 4, 2022. So if someone went there and wondering why there's only rc0 but no stable version - you went to the wrong place :) |
hello, I tried to see the 2 links, but not obvious where to find a "aar" file in all tht a, a more précide link would be expected. I am not geek enough to find that. |
If you have no idea what those links are about then your best choice is to use a different version of react native, say 0.69. From my perspective, at this time point, everyone should stay clear of 0.71 unless they have a very good reason to do so. |
thks, yes I stay on 0.69, but just work ahead to prepare next versions stacks. |
Just wait for library maintainers to catch up with RN, it could take a few months though. |
Same issue here |
|
+1 |
It would be nice patch to be added for android artifacts to be retrieved from maven instead of node_modules as currently this change is breakable for upgrading to 0.71. The 0.70.x version has issues with hermes build and this issue is breaking the upgrade to 0.71 where it is fixed. |
+1 |
Just tried the crude approach I suggested and I'm now hitting strange blockers. I couldn't find anything related to changes in C++ parts in RN0.70 vs 0.71. The header file was of course intact and sits where it should be. |
Ok I think I got it.
Now you should be able to use I'll say this again: The above steps are how you do library patching wrong. It is "With Enough Thrust Pigs Fly Just Fine" in action and you should definitely do library patching in the other direction - patch the library, not the framework, and probably never patch the framework to make it closer to an older version. I made this post just to highlight where things have changed and maybe provide some insights about how one could patch Fun fact: I was never a fan of Java/Gradle/Maven or anything that's Java-bounded so there is zero chance I'll make a proper fix for this issue. You guys have a nice day. |
Ok I guess Java wins this round. I actually made a (half-baked) fix. You'll still need to do step 6 and 7 though, but I figure you only need to do that once. You'll find some strange formatting diffs in the patch file, I didn't want to bother myself to get rid of those since the original build.gradle was formatted in a rather strange way, so I left those as is. And I didn't test it with hermes disabled. |
@zzz08900 thanks for this work, any reason why you can't submit these changes as a PR? |
Because the fix is half-baked. I don't think modifying node_modules/react-native from react-native-vision-camera is a good idea since it has the potential to break many, many other things. I guess @mrousavy would agree. And the patch-package could break things if you are not using hermes(no test was done there, but I guess it could). And I didn't change how react-native-vision-camera detects hermes(without So the patch-package is at best a temporary workaround, if you feel like it you can make it into a proper PR. I got my hands full of other problems for now. I would say the patch-package is a flying pig with HUGE rocket thrusters. |
Adding |
thks,It took two days until the answer was found here.The method of adding a remote dependency library is invalid, only aar can be used |
It worked for me using kotlinversion=1.6.20 But i changed also sdk and buildtools to 33 |
I do confirm for 1 week ago I change kotlin version to more , see #1460 (comment) but sorry , where did you "changed also sdk and buildtools to 33" please? |
I am having the same problem, did you manage to solve it? |
What were you trying to do?
Hello,
I am trying to build my application for android.
On iOS, it builds well and launches.
I use
react-native-reanimated
:2.14.1
.I get these warings and errors on the android build :
Any idea if vision-camera is ready for react-native 0.71?
Thank you for your work!
Reproduceable Code
No response
What happened instead?
I get a gradle build error.
Relevant log output
No response
Device
Any
VisionCamera Version
^2.15.2
Additional information
The text was updated successfully, but these errors were encountered: