-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Please publish yoga-layout on Maven Central #1065
Comments
React Native depends on com.facebook.yoga:proguard-annotations which is also available on JCenter only. |
Yes please. As of posting this, jcenter is down due to some technical issues and I'm unable to get this dependency. |
This is really important and just shows how brittle external dependencies really are. |
I'm honestly surprised the build process didn't use any offline cache. I had compiled this project many times before on MacOS and WSL2. When jcenter went down, both would not compile. |
You can force gradle to prefer offline or go offline only, it's a command line flag. |
Note that:
Which looks like this failure to set the CMAKE program more or less (yes, windows paths, but probably adaptable): https://stackoverflow.com/a/64917390/9910298 This project appears to be a transitive dependency of react-native via flipper as well, so it is critical this is updated soon as multiple projects needs updated releases I think before jcenter can be purged |
Here's a work-around for the time being:
allprojects {
repositories {
google()
mavenLocal()
mavenCentral()
// ...
+ flatDir {
+ dirs "$rootProject.projectDir/libs"
+ }
}
}
(Add `allproject` entirely, if it's missing in your project)
dependencies {
- implementation 'com.facebook.react:react-native:+'
+ implementation 'com.facebook.fbjni:fbjni-java-only:0.0.4'
+ implementation('com.facebook.react:react-native:+') {
+ exclude group: 'com.facebook.fbjni', module: 'fbjni-java-only'
+ exclude group: 'com.facebook.yoga', module: 'proguard-annotations'
+ }
} |
@d4vidi that's an interesting approach, you are on to something there. This is a potential start towards something automated for people that can't update. Examine this if you have time: https://github.com/ankidroid/Anki-Android/blob/master/AnkiDroid/robolectricDownloader.gradle - the idea is to pre-download maven artifacts you'll need later I wrote that in order to have external dependency download de-flaked in an E2E CI type pipeline where the downloads were failing builds and giving me a fail signal outside of my code changes. With that and an exponential-back-off-retry I have great signal to noise. But - if the general idea of "you can have a gradle task that downloads dependencies before your real build" is combined with the idea of "react-native jcenter dependencies may be downloaded"... 1- store the problematic in-use artifacts on the official react-native github somewhere (or on their respective project pages) as downloadable things - have a known list of them, I think there are only a handful (yoga android-annotations, 2 flipper plugins, fbjni) 2- write a downloader script for them like the above 3- integrate that in to patch releases of RN CLI? It could be just as terrible + functional as https://github.com/mikehardy/jetifier :-), which is and was kind of gross but also just glossed over the whole AndroidX migration for everyone at once and made it go away... |
If done well it requires no external approval or waiting actually - a repo could simply get them now even if it wouldn't be officially blessed, write the task and throw them in the local Note that it may be useful to develop this capability regardless of the dependencies we know about being fixed, as there is always some other thing we did not know about. And if we have this capability then someone somewhere can get a copy of the artifact, post it in the downloadable spot, we can add it to the npm package for an update to the list and everyone is auto-fixed again until versions are actually updated (similar to jetifier which did have some missing edge cases at the start until adoption was 100% and is still a lifesaver for folks on RN59 etc) |
@mikehardy That could actually make a really cool solution. Perhaps we could even publish it as a Gradle plugin - I wonder. |
Just a quick note here: JCenter is on record as saying they will leave the repo up in read-only mode, so this is not urgent any longer However it is important (despite not being urgent) to have ability to publish somewhere/anywhere else, so I believe the issue is still valid Cheers |
I know there's an update that JCenter will be kept as a read-only repository indefinitely but yoga-layout is failing with a 403 on JCenter but works on maven. Does this mean the migration from |
As of Monday (5th July 2021) I've been getting this issue, and it seems I've missed the boat in terms of grabbing the artefact from Bintray so feel like I'm a bit stuck. I'm not really an Android dev and use Yoga through React Native. `Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
Full build scan is here: https://scans.gradle.com/s/lyge6fz762tsu/ Seems whereas JCenter has until Feb 2022 and will be available read-only, Bintray went 4th July https://status.bintray.com/ |
@PhilipBrew So for now you just need the jcenter maven repository and it should work? I'm still building successfully at least Appears that react-native 0.65 when it's released will have evicted jcenter completely based on the template alterations visible on that branch facebook/react-native@9a923be |
@mikehardy Yeah I think so long as I can grab the .jar file I will be able to do @d4vidi workaround above. I then anticipate some of the other packages I'm using to throw the same issues however. I'm really unsure why I'm suddenly unable to build Android but the wider community as a whole seem to be fine, at least for now. Apologies if we should be having this conversation somewhere else, but it feels like I'm missing something when a base create-react-native-app does indeed build EDIT: I bumped gradle from 3.5.3 to classpath |
It seems like Is there anything left to be done here then? |
|
It seems like it is https://search.maven.org/artifact/com.facebook.yoga/proguard-annotations/1.19.0/jar |
Oops, somehow I was unable to find it... |
Our project needs com.facebook.yoga:proguard-annotations:1.14.1 which is still absent on Maven Central |
Out of curiosity: why can't you update to the latest version? |
maybe this help: it looks like to be on 1.19 you need to be using RN65 - RN64 is still on 1.14: https://github.com/facebook/react-native/blob/0.64-stable/ReactAndroid/build.gradle |
@cortinico @kelset You are right, guys. This is my fault. Since we moved to RN 0.65, 1.14 is not needed anymore. Didn't see it myself. Thanks! :-) |
Just a heads up: com.facebook.yoga:proguard-annotations:1.14.1 has now been republished to MavenCentral so users on RN 0.64.x would be able to build while fetching this artifact from https://repo1.maven.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/ |
It looks like @cortinico has taken care of this. Please let me know if there is anything still pending on this issue. |
Report
https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
JCenter will be unavailable on May 1, 2021.
But it seems yoga-layout is available on JCenter only.
https://mvnrepository.com/artifact/com.facebook.yoga.android/yoga-layout?repo=jcenter
The text was updated successfully, but these errors were encountered: