Skip to content
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 only upgrade react-native to 0.72.x #17062

Closed
wants to merge 23 commits into from

Conversation

siddarthkay
Copy link
Contributor

This PR is just made to test and fix effects of this upgrade on CI.
Note: This PR only contains Android side of the upgrades.
state: WIP

@siddarthkay siddarthkay self-assigned this Aug 19, 2023
@siddarthkay siddarthkay marked this pull request as draft August 19, 2023 06:50
@status-im-auto
Copy link
Member

status-im-auto commented Aug 19, 2023

Jenkins Builds

Click to see older builds (99)
Commit #️⃣ Finished (UTC) Duration Platform Result
afc5a93 #1 2023-08-19 06:54:39 ~4 min ios 📄log
36e3858 #2 2023-08-19 06:56:02 ~3 min android 📄log
36e3858 #2 2023-08-19 06:56:03 ~3 min android-e2e 📄log
4a66842 #3 2023-08-19 07:20:49 ~3 min android 📄log
4a66842 #3 2023-08-19 07:20:49 ~3 min android-e2e 📄log
b11562d #4 2023-08-19 07:32:19 ~2 min android-e2e 📄log
b11562d #4 2023-08-19 07:33:15 ~3 min android 📄log
67a4164 #5 2023-08-19 08:05:15 ~2 min android-e2e 📄log
67a4164 #5 2023-08-19 08:05:20 ~2 min android 📄log
9894d80 #6 2023-08-19 11:47:47 ~2 min android-e2e 📄log
9894d80 #6 2023-08-19 11:47:49 ~2 min android 📄log
f85266c #7 2023-08-19 13:32:47 ~2 min android-e2e 📄log
f85266c #7 2023-08-19 13:32:49 ~2 min android 📄log
e3369b4 #8 2023-08-19 13:36:13 ~2 min android-e2e 📄log
e3369b4 #8 2023-08-19 13:36:15 ~2 min android 📄log
✔️ 37c90eb #9 2023-08-19 13:47:56 ~5 min android-e2e 🤖apk 📲
✔️ 37c90eb #9 2023-08-19 13:47:57 ~5 min android 🤖apk 📲
✔️ 400b9bd #10 2023-08-19 14:16:02 ~5 min android-e2e 🤖apk 📲
✔️ 400b9bd #10 2023-08-19 14:16:08 ~5 min android 🤖apk 📲
a8b01ab #11 2023-08-21 02:53:58 ~4 min android 📄log
a8b01ab #11 2023-08-21 02:54:07 ~4 min android-e2e 📄log
3dae888 #12 2023-08-21 03:26:54 ~1 min android 📄log
3dae888 #12 2023-08-21 03:26:54 ~1 min android-e2e 📄log
e1e74bf #13 2023-08-21 03:41:21 ~2 min android 📄log
e1e74bf #13 2023-08-21 03:41:22 ~2 min android-e2e 📄log
5043890 #14 2023-08-21 03:55:43 ~3 min android-e2e 📄log
5043890 #14 2023-08-21 03:55:45 ~3 min android 📄log
cd406b6 #15 2023-08-21 04:02:48 ~2 min android 📄log
cd406b6 #15 2023-08-21 04:02:48 ~2 min android-e2e 📄log
a1adbbe #16 2023-08-21 05:22:47 ~3 min android 📄log
a1adbbe #16 2023-08-21 05:22:49 ~3 min android-e2e 📄log
56a6081 #17 2023-08-21 10:48:23 ~4 min android 📄log
56a6081 #17 2023-08-21 10:48:26 ~4 min android-e2e 📄log
53e4fe4 #18 2023-08-21 12:55:27 ~3 min android-e2e 📄log
53e4fe4 #18 2023-08-21 12:55:33 ~3 min android 📄log
665ae0c #20 2023-08-21 13:18:33 ~3 min android 📄log
665ae0c #20 2023-08-21 13:18:37 ~3 min android-e2e 📄log
b473c6d #21 2023-08-21 13:45:22 ~3 min android 📄log
b473c6d #21 2023-08-21 13:47:19 ~5 min android-e2e 📄log
9e77222 #22 2023-08-21 14:12:12 ~4 min android-e2e 📄log
9e77222 #22 2023-08-21 14:12:16 ~4 min android 📄log
2dc3bfd #25 2023-08-21 15:55:07 ~5 min android 📄log
2dc3bfd #25 2023-08-21 15:55:22 ~5 min android-e2e 📄log
871471d #26 2023-08-22 04:17:04 ~2 min android-e2e 📄log
871471d #26 2023-08-22 04:17:09 ~2 min android 📄log
6d5d41c #27 2023-08-22 04:50:00 ~3 min android-e2e 📄log
6d5d41c #27 2023-08-22 04:50:00 ~3 min android 📄log
ea34d0e #28 2023-08-22 05:12:24 ~2 min android-e2e 📄log
ea34d0e #28 2023-08-22 05:12:33 ~2 min android 📄log
0ce5f29 #29 2023-08-22 10:13:36 ~2 min android 📄log
0ce5f29 #29 2023-08-22 10:14:13 ~3 min android-e2e 📄log
b5d07b1 #30 2023-08-22 14:47:23 ~3 min android-e2e 📄log
b5d07b1 #30 2023-08-22 14:49:33 ~6 min android 📄log
46f3645 #32 2023-08-23 12:31:53 ~3 min android-e2e 📄log
46f3645 #32 2023-08-23 12:32:21 ~4 min android 📄log
ff40abc #35 2023-08-23 19:00:45 ~3 min android 📄log
ff40abc #35 2023-08-23 19:00:49 ~3 min android-e2e 📄log
ecdd1aa #36 2023-08-23 19:15:03 ~2 min android-e2e 📄log
ecdd1aa #36 2023-08-23 19:18:36 ~6 min android 📄log
b023962 #37 2023-08-28 07:04:10 ~3 min android-e2e 📄log
b023962 #37 2023-08-28 07:04:11 ~3 min android 📄log
4896b5e #38 2023-08-28 15:07:17 ~3 min android 📄log
4896b5e #38 2023-08-28 15:07:18 ~3 min android-e2e 📄log
bf8af7a #39 2023-08-29 02:37:26 ~5 min android 📄log
bf8af7a #39 2023-08-29 02:37:29 ~5 min android-e2e 📄log
88e33d9 #40 2023-08-29 03:52:34 ~5 min android-e2e 📄log
88e33d9 #40 2023-08-29 03:52:45 ~5 min android 📄log
dc59e8e #41 2023-08-29 04:44:24 ~5 min android 📄log
dc59e8e #41 2023-08-29 04:44:28 ~6 min android-e2e 📄log
✔️ f435008 #42 2023-08-29 05:13:21 ~6 min android 🤖apk 📲
✔️ f435008 #42 2023-08-29 05:13:24 ~6 min android-e2e 🤖apk 📲
✔️ 18675c6 #43 2023-08-29 05:22:35 ~6 min android-e2e 🤖apk 📲
✔️ 18675c6 #43 2023-08-29 05:22:47 ~6 min android 🤖apk 📲
✔️ f3429ab #44 2023-08-29 05:47:12 ~6 min android-e2e 🤖apk 📲
✔️ f3429ab #44 2023-08-29 05:47:16 ~6 min android 🤖apk 📲
✔️ 1203834 #45 2023-08-29 06:32:38 ~6 min android 🤖apk 📲
✔️ 1203834 #45 2023-08-29 06:32:38 ~6 min android-e2e 🤖apk 📲
✔️ 55be202 #46 2023-08-29 13:36:41 ~7 min android-e2e 🤖apk 📲
✔️ 55be202 #46 2023-08-29 13:36:43 ~7 min android 🤖apk 📲
✔️ 803c227 #47 2023-08-29 14:22:36 ~6 min android-e2e 🤖apk 📲
✔️ 803c227 #47 2023-08-29 14:23:51 ~7 min android 🤖apk 📲
✔️ 4bcdbbc #48 2023-08-29 15:06:46 ~6 min android-e2e 🤖apk 📲
✔️ 4bcdbbc #48 2023-08-29 15:06:50 ~6 min android 🤖apk 📲
✔️ e750581 #50 2023-08-29 15:36:17 ~6 min android 🤖apk 📲
✔️ e750581 #50 2023-08-29 15:37:50 ~7 min android-e2e 🤖apk 📲
✔️ 88a95b2 #51 2023-08-31 10:38:04 ~5 min android 🤖apk 📲
✔️ 88a95b2 #51 2023-08-31 10:38:07 ~6 min android-e2e 🤖apk 📲
✔️ 2ad68c5 #52 2023-08-31 12:16:00 ~6 min android-e2e 🤖apk 📲
✔️ 2ad68c5 #52 2023-08-31 12:16:06 ~6 min android 🤖apk 📲
✔️ 41bef8a #54 2023-09-01 05:28:33 ~7 min android-e2e 🤖apk 📲
✔️ 41bef8a #54 2023-09-01 05:29:14 ~7 min android 🤖apk 📲
✔️ c4c9ecd #55 2023-09-01 06:02:08 ~7 min android 🤖apk 📲
✔️ c4c9ecd #55 2023-09-01 06:02:56 ~8 min android-e2e 🤖apk 📲
✔️ 6976739 #56 2023-09-03 12:35:51 ~7 min android-e2e 🤖apk 📲
✔️ 6976739 #56 2023-09-03 12:35:55 ~7 min android 🤖apk 📲
✔️ 1be8d64 #57 2023-09-04 10:37:12 ~7 min android-e2e 🤖apk 📲
✔️ 1be8d64 #57 2023-09-04 10:37:30 ~7 min android 🤖apk 📲
f90615a #59 2023-09-09 11:23:44 ~25 sec android-e2e 📄log
f90615a #59 2023-09-09 11:23:44 ~25 sec android 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 7cb898e #60 2023-09-09 16:02:50 ~7 min android-e2e 🤖apk 📲
✔️ 7cb898e #60 2023-09-09 16:02:57 ~7 min android 🤖apk 📲
✔️ e29825d #61 2023-09-09 17:01:20 ~7 min android-e2e 🤖apk 📲
✔️ e29825d #61 2023-09-09 17:01:36 ~7 min android 🤖apk 📲

@jakubgs
Copy link
Member

jakubgs commented Aug 19, 2023

This failure:

A problem occurred configuring project ':react-native-keychain'.
> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':react-native-keychain:classpath'.
      > Could not resolve com.adarshr:gradle-test-logger-plugin:2.0.0.
        Required by:
            project :react-native-keychain
         > No cached version of com.adarshr:gradle-test-logger-plugin:2.0.0 available for offline mode

Appears to indicate lack of com.adarshr:gradle-test-logger-plugin:2.0.0, but it is there:

 > grep -A3 gradle-test-logger-plugin nix/deps/gradle/deps.json
    "path": "com/adarshr/gradle-test-logger-plugin/2.0.0",
    "repo": "https://plugins.gradle.org/m2",
    "files": {
      "gradle-test-logger-plugin-2.0.0.pom": {
        "sha1": "fe5c29ddcae80215fd7ec74476880de67d66c894",
        "sha256": "sha256-kVCmaVqB+SN+4958dClo5XcMHyWCGsS3c5kCFh9lUu4="
      },
      "gradle-test-logger-plugin-2.0.0.jar": {
        "sha1": "957ca7f6f4390ea8cf4551fff43a96da50844b98",
        "sha256": "sha256-lZFMdk+bW0P59xiCWMxr9BsLr2dnlhqjQIJtgHyAjp0="
      }

And it is in the store:

 > find /nix/store -maxdepth 1 -iname '*gradle-test-logger-plugin*'
/nix/store/c1l61jfc12wyan718s0hqgbanm7bq1pw-gradle-test-logger-plugin-2.0.0.pom.drv
/nix/store/cmsnv0x1jlk0i52w8rnbxxg60891vn7i-gradle-test-logger-plugin-2.0.0.jar.drv
/nix/store/rdyp3w7s5qpzi9afbzi53gigxk2kr417-gradle-test-logger-plugin-2.0.0.jar
/nix/store/n8gsbfnncklycmx689ibsmplkf7rs9gq-gradle-test-logger-plugin-2.0.0.pom

But if I strace Gradle at build time(and use --keep-failed flag for nix-build) I see no attempt to find it on the filesystem:

/tmp/nix-build-status-mobile-build-pr-android.drv-0
 > grep gradle-test-logger-plugin android/strace.log | wc -l
0

Which together with the null in Could not determine the dependencies of null. suggests some deeper issues.

@jakubgs
Copy link
Member

jakubgs commented Aug 19, 2023

Also, this change(67a4164) appears to be entirely unnecessary:

echo 'com.adarshr:gradle-test-logger-plugin:2.0.0' >> "${DEPS_LIST}"

Because the dependency is included even without it:

~/work/status-mobile upgrade/android-only-rn-0.72.x ⇣
 > g
## upgrade/android-only-rn-0.72.x...origin/upgrade/android-only-rn-0.72.x [behind 1]

~/work/status-mobile upgrade/android-only-rn-0.72.x ⇣
 > grep gradle-test-logger-plugin nix/deps/gradle/deps.json
    "path": "com/adarshr/gradle-test-logger-plugin/2.0.0",
      "gradle-test-logger-plugin-2.0.0.pom": {
      "gradle-test-logger-plugin-2.0.0.jar": {

As far as I can tell the key issue here is the null in Could not determine the dependencies of null., because if you look at other examples of such errors the name of the package should be there:

@siddarthkay
Copy link
Contributor Author

@jakubgs maybe this is related : oblador/react-native-keychain#595 (comment)

@jakubgs
Copy link
Member

jakubgs commented Aug 19, 2023

Yes, it's most likely that the issue is not in react-native-keychain but in gradle-test-logger-plugin, specifically 2.0.0.

@siddarthkay siddarthkay force-pushed the upgrade/android-only-rn-0.72.x branch 9 times, most recently from 7fc685a to 46f3645 Compare August 23, 2023 12:27
android/build.gradle Outdated Show resolved Hide resolved
@siddarthkay siddarthkay force-pushed the upgrade/android-only-rn-0.72.x branch 2 times, most recently from 68139cc to ff40abc Compare August 23, 2023 18:56
@yakimant
Copy link
Member

url2json.sh has an issue with new package.

https://repo1.maven.org/maven2/com/facebook/react/react-android/0.72.3/react-android-0.72.3.pom
has type pom, but it actually contains aar and jar files:
https://repo1.maven.org/maven2/com/facebook/react/react-android/0.72.3/

This code need to be ammended:

# Some deps are just POMs, in which case there is no JAR to fetch.
[[ "${OBJ_TYPE}" == "" ]] && fetch_and_template_file_no_fail "${PKG_NAME}.jar"
[[ "${OBJ_TYPE}" == "jar" ]] && fetch_and_template_file "${PKG_NAME}.jar"
[[ "${OBJ_TYPE}" == "bundle" ]] && fetch_and_template_file "${PKG_NAME}.jar"
[[ "${OBJ_TYPE}" =~ aar* ]] && fetch_and_template_file "${PKG_NAME}.aar"
[[ "${OBJ_TYPE}" == "aar.asc" ]] && fetch_and_template_file "${PKG_NAME}.${OBJ_TYPE}"
pom_has_nodeps_jar "${POM_PATH}" && fetch_and_template_file "${PKG_NAME}-nodeps.jar"

@yakimant
Copy link
Member

yakimant commented Aug 28, 2023

The latest issue with gradel deps:

Execution failed for task ':react-native-reanimated:configureCMakeRelWithDebInfo[arm64-v8a]'.
> Could not resolve all files for configuration ':react-native-reanimated:_internal_prefab_binary'.
   > Could not find cli-2.0.0-all.jar (com.google.prefab:cli:2.0.0).
     Searched in the following locations:
         file:/nix/store/2vlvms16hq90rz31qb9zf8i2dhdvjcm0-status-mobile-maven-deps/com/google/prefab/cli/2.0.0/cli-2.0.0-all.jar

No binary, only pom file...

@siddarthkay siddarthkay force-pushed the upgrade/android-only-rn-0.72.x branch 2 times, most recently from f3429ab to 1203834 Compare August 29, 2023 06:26
@jakubgs
Copy link
Member

jakubgs commented Aug 29, 2023

Lol, what the fuck is this?

image

Why does it have a a -release suffix? That's not something I've ever seen. Are you sure Gradle actually looks for this?

android/gradle.properties Outdated Show resolved Hide resolved
Copy link
Member

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work man. But we need to do something about all those gradle exceptions added.

Comment on lines 124 to 127
[[ "${PKG_NAME}" == react-android-* ]] && fetch_and_template_file "${PKG_NAME}.module"
[[ "${PKG_NAME}" == react-android-* ]] && fetch_and_template_file "${PKG_NAME}-release.aar"
[[ "${PKG_NAME}" == react-android-* ]] && fetch_and_template_file "${PKG_NAME}-debug.aar"
[[ "${PKG_NAME}" == cli-* ]] && fetch_and_template_file "${PKG_NAME}-all.jar"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's horrible. I don't agree with this change at all. This needs to be dealt with in a generic way. Adding more special-case exceptions is just bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this okay? : ef67791

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it to test that it helped.
As for packaging style changed, note:

  • packaging is pom, but it has aars
  • it's not only pom and aar, but also module
    I wonder if it's react-native specific, or another way of handling maven packages. Then we could make it even more generic for all new cases, which might appear in the future.

nix/deps/nodejs-patched/default.nix Outdated Show resolved Hide resolved
nix/deps/nodejs-patched/default.nix Outdated Show resolved Hide resolved
nix/deps/nodejs-patched/default.nix Outdated Show resolved Hide resolved
nix/deps/nodejs-patched/default.nix Outdated Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
android/build.gradle Show resolved Hide resolved
android/app/build.gradle Show resolved Hide resolved
@@ -134,15 +110,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
def enableHermes = hermesEnabled.toBoolean();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sets it to whatever was set in gradle.properties, in our case false
according to new template : https://github.com/facebook/react-native/blob/0.72-stable/packages/react-native/template/android/gradle.properties#L44

// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
// implementation 'com.facebook.soloader:soloader:0.10.4+'
// implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't need it lets remove it.

@siddarthkay
Copy link
Contributor Author

@jakubgs : Thanks for the review! I will clean up this PR 👍🏻

@flexsurfer
Copy link
Member

looks stale, feel free to reopen if needed

@flexsurfer flexsurfer closed this Oct 11, 2023
siddarthkay added a commit that referenced this pull request Dec 11, 2023
This PR does many things :
- Upgrade `react-native ` to `0.72.5`
- Upgrade `react-native-reanimated` to  `3.5.4`
- Upgrade `react-native-navigation` to `7.37.0`
- `ndkVersion` has been bumped to `25.2.9519653`
- `cmakeVersion` has been bumped to `3.22.1`
- `kotlinVersion` has been bumped to `1.7.22`
- `AGP` has been bumped to `7.4.2`
- `Gradle` has been upgraded to `8.0.1`
- Android `CompileSDK` and `TargetSDK` have been bumped to 33
- `@react-native-async-storage/async-storage` has been upgraded to `1.19.3`
- `@walletconnect/client` has been nuked
- some of the old `react-native-reanimated` code has been nuked
- `react-native-keychain` fork has been replaced with `8.1.2`

- On Android we are currently relying on `Hermes` Engine.
- On iOS we are currently relying on JSC
- We are not enabling new architecture for now (I have plans for that in the future) ref: #18138

IOS only PR : #16721
Android only PR : #17062

- `make run-metro` now has a target of `android` which was `clojure` earlier, this will increase the time it takes to start metro terminal but this is needed otherwise you will get a nasty error while developing for android locally.
siddarthkay added a commit that referenced this pull request Dec 11, 2023
This commit does many things :
- Upgrade `react-native ` to `0.72.5`
- Upgrade `react-native-reanimated` to  `3.5.4`
- Upgrade `react-native-navigation` to `7.37.0`
- `ndkVersion` has been bumped to `25.2.9519653`
- `cmakeVersion` has been bumped to `3.22.1`
- `kotlinVersion` has been bumped to `1.7.22`
- `AGP` has been bumped to `7.4.2`
- `Gradle` has been upgraded to `8.0.1`
- Android `CompileSDK` and `TargetSDK` have been bumped to 33
- `@react-native-async-storage/async-storage` has been upgraded to `1.19.3`
- `@walletconnect/client` has been nuked
- some of the old `react-native-reanimated` code has been nuked
- `react-native-keychain` fork has been replaced with `8.1.2`

- On Android we are currently relying on `Hermes` Engine.
- On iOS we are currently relying on JSC
- We are not enabling new architecture for now (I have plans for that in the future) ref: #18138

IOS only PR : #16721
Android only PR : #17062

- `make run-metro` now has a target of `android` which was `clojure` earlier, this will increase the time it takes to start metro terminal but this is needed otherwise you will get a nasty error while developing for android locally.
siddarthkay added a commit that referenced this pull request Dec 11, 2023
This commit does many things :
- Upgrade `react-native ` to `0.72.5`
- Upgrade `react-native-reanimated` to  `3.5.4`
- Upgrade `react-native-navigation` to `7.37.0`
- `ndkVersion` has been bumped to `25.2.9519653`
- `cmakeVersion` has been bumped to `3.22.1`
- `kotlinVersion` has been bumped to `1.7.22`
- `AGP` has been bumped to `7.4.2`
- `Gradle` has been upgraded to `8.0.1`
- Android `CompileSDK` and `TargetSDK` have been bumped to 33
- `@react-native-async-storage/async-storage` has been upgraded to `1.19.3`
- `@walletconnect/client` has been nuked
- some of the old `react-native-reanimated` code has been nuked
- `react-native-keychain` fork has been replaced with `8.1.2`

- On Android we are currently relying on `Hermes` Engine.
- On iOS we are currently relying on `JSC`
- We are not enabling new architecture for now (I have plans for that in the future) ref: #18138

IOS only PR : #16721
Android only PR : #17062

- `make run-metro` now has a target of `android` which was `clojure` earlier, this will increase the time it takes to start metro terminal but this is needed otherwise you will get a nasty error while developing for android locally.
@siddarthkay siddarthkay deleted the upgrade/android-only-rn-0.72.x branch August 23, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants