-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Update Android Gradle plugin to 4.0.1 #29013
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
Update Android Gradle plugin to 4.0.1 #29013
Conversation
Base commit: c421838 |
Base commit: c421838 |
fe355a1
to
b575aee
Compare
b575aee
to
fa3bc8c
Compare
fa3bc8c
to
a4cee29
Compare
Rebased, since #28170 was merged. Ready for early review/testing, not ready for merge. |
a4cee29
to
cf8f720
Compare
cf8f720
to
7e40076
Compare
Please revert NDK change. It just works fine for me on RN 0.63 app. |
Let's merge this before cutting 0.64, which should be coming soon 😇 |
waiting for this update then I'll merge |
You mean the older version works fine? Did you try the newer one? The default for |
If we keep the latest: |
The project in
|
@friederbluemle do you have any reason to update the NDK version other than it is the default version for AGP 4.0.1? cc @dulmandakh I think we should keep notes that once this pr ( with updated NDK version ) merge we need to update our CI NDK version to |
AFAIK, CI still use NDK 20.x. A while ago, I tried to bump it to 21, but failed. So I propose to use same NDK version for React Native and RN apps, even we don't have known issues yet. For me, it's one less NDK version to install on my system at least. |
I agree with you @dulmandakh, if we don't have known issues, or need specific function I think it's better to stick with the current NDK version. |
Yeah, let's keep all versions in the repo consistent, and if an upgrade is needed, we'll do it in separate PR. I think it's also important to put this version down in one place so that all configs depending on it can get the same exact version (perhaps we should just add a constant in react.gradle?). |
@friederbluemle: thoughts? |
7e40076
to
c23943a
Compare
Sure, as requested, I removed the alignment of the ndk from this PR again. The main reason why I initially wanted to align the NDK with the AGP version is that the website linked above states:
In this case, if everything works fine with the older version, I guess we can update the AGP first. |
Yes, definitely agree we should use the same NDK version for React Native and RN apps. Ideally, it should also be the same (default) version that the AGP uses (and is thoroughly tested by Google) - If there is some problem with the newer NDK, then of course - we should not update it yet.
Yes, I also agree with that! Although the same could be said about the update of the AGP as well "if we don't have an issue it's better to stick with the current version" ;) Either way, I'm fine updating AGP first, and NDK later - just wanted to make sure this doesn't fall off the radar because everything is "working fine". Does anyone have logs/details on what issues there are with the current repo and NDK 21? Should we open an issue to at least keep track of it? |
Thanks, I'll merge this ASAP. Re: NDK v21, let's get this set up in CI so that we can upgrade the versions to 21 all at once. cc @hramos re: CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fkgozali has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Thanks @fkgozali 👍 |
This pull request was successfully merged by @friederbluemle in 553fb8b. When will my fix make it into a release? | Upcoming Releases |
Android gradle plugin v4+ seems to be causing some issues. JS bundles are failing to get copied into the aab or apk output seemingly randomly (running build twice sometimes adds the js bundle to the output) #29398 Sorry to comment on a closed pr @fkgozali @friederbluemle but this change may bite a lot of people if it goes out in a release so I thought this would be the best place to alert those likely to know how to mitigate it. |
I'll defer to @friederbluemle and @dulmandakh for recommendation. |
Seems there's a change in task ordering behavior somewhere that causes bundle to get copied after assets are merged so bundle gets left out of assets. See here: react-native-community/upgrade-support#38 (comment) |
@AndrewMorsillo - Thanks for the report and sorry to hear this update is causing some issues on your end. That said, we have been struggling with a separate (?) issue (libhermes.so not found) even before this update that might be related to an obscure internal task ordering change that happened between the 3.4 and 3.5 series. There is still no clear solution until today, and I am not sure it's related. |
We decided to postpone taking 4.0.1 or later until after the RN v0.64 upgrade. That's because someone reported an issue with 4.0.1 [1], and a supposed fix landed in facebook/react-native@53f55001a, which was a change to RN's internal code released in v0.64. Release notes here: https://developer.android.com/studio/releases/gradle-plugin#4-1-0 Quite a few major changes announced, hopefully they're all good ones. Our tests pass, and a debug build on Android built and ran fine for me. Part of the RN v0.63 -> v0.64 changes to the template app, corresponding to: facebook/react-native@cf8368f20 facebook/react-native@553fb8b28 facebook/react-native@dfa9db49e See discussion at https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/Pin.20to.20explicit.20NDK.20version.3F/near/1210089. [1] facebook/react-native#29013 (comment)
We decided to postpone taking 4.0.1 or later until after the RN v0.64 upgrade. That's because someone reported an issue with 4.0.1 [1], and a supposed fix landed in facebook/react-native@53f55001a, which was a change to RN's internal code released in v0.64. Release notes here: https://developer.android.com/studio/releases/gradle-plugin#4-1-0 Quite a few major changes announced, hopefully they're all good ones. Our tests pass, and a debug build on Android built and ran fine for me. Part of the RN v0.63 -> v0.64 changes to the template app, corresponding to: facebook/react-native@cf8368f20 facebook/react-native@553fb8b28 facebook/react-native@dfa9db49e See discussion at https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/Pin.20to.20explicit.20NDK.20version.3F/near/1210089. [1] facebook/react-native#29013 (comment)
This is a major version update that needs to be tested thoroughly.
Summary
Android Studio 4.0.1 is now available in the stable channel
https://androidstudio.googleblog.com/2020/05/android-studio-40-available-in-stable.html
https://developer.android.com/studio/releases/gradle-plugin#4.0.1
Changelog
[Android] [Changed] - Update Android Gradle plugin to 4.0.1
Test Plan
Build project
Closes #29044