-
-
Notifications
You must be signed in to change notification settings - Fork 660
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
Target Android 14 (set targetSdkVersion to 34), by 2024-10 deadline #5877
Comments
From that potentially-breaking changes article:
|
Quick manual testing on the office Android device (Android 9) showed no problems, which I guess isn't surprising because it's not Android 14. The app opened without crashing; notifications worked, with the app foregrounded/backgrounded/closed; and image uploads worked, both from the camera and the media library. (We don't support video uploads from the media library prior to Android 13, and we don't support video uploads from the camera on Android at all.) |
As we said on the last one of these, fc2dab7: This setting is not to be confused with the targetSdkVersion. The latter goes into the built manifest, and affects a wide range of behavior, so bumping it requires careful testing. This is used purely at build time, and should have no effect on runtime behavior. This value needs to be at least as high as targetSdkVersion, and we need to bump that to 34 soon (zulip#5877). So, do this to prepare for that. No build failures or warnings appeared for me with tools/test native --all-files .
As we said on the last one of these, fc2dab7: This setting is not to be confused with the targetSdkVersion. The latter goes into the built manifest, and affects a wide range of behavior, so bumping it requires careful testing. This is used purely at build time, and should have no effect on runtime behavior. This value needs to be at least as high as targetSdkVersion, and we need to bump that to 34 soon (zulip#5877). So, do this to prepare for that. No build failures or warnings appeared for me with tools/test native --all-files . Related: zulip#5877
Yeah — once |
Thanks for the detailed read through the breaking-changes page! I'll do a separate read too, for a cross-check. |
OK, doing my own read-through. After I read each of these items I'm also going and reading your notes on them — thanks for the thorough validation of where some of these APIs are used!
In short:
|
After our experience last year with the doc that's supposed to describe the effects of targetSdkVersion being deficient, I also read through the "Behavior changes: all apps" doc.
In short: I think there's nothing further to investigate from that doc. |
The deadline for this is now just over six weeks away (2024-10-31). The next steps are to try the upgrade and do some manual testing.
|
As we said on the last one of these, fc2dab7: This setting is not to be confused with the targetSdkVersion. The latter goes into the built manifest, and affects a wide range of behavior, so bumping it requires careful testing. This is used purely at build time, and should have no effect on runtime behavior. This value needs to be at least as high as targetSdkVersion, and we need to bump that to 34 soon (zulip#5877). So, do this to prepare for that. The build warnings change slightly, but the new warnings all seem acceptable. Details and discussion starting at: zulip#5879 (comment) Related: zulip#5877
I tested the targetSdkVersion 34 bump in a release build on my Pixel 8 running Android 14. Both of the areas above work fine: the photo picker, and notifications, in a fresh install of the app. The photo picker working is consistent with what I found above at #5877 (comment) in testing the current released version of the app. It's a bit puzzling how it's working — there's that issue react-native-image-picker/react-native-image-picker#2299 discussed above, and it sure does look in the code like it's using the MediaStore API. But I don't see the symptoms reported in that issue; I get just one modal for picking an image, and the image I pick there successfully gets uploaded. So that all looks good. However. When I try to launch a debug build, it crashes. The stack trace says:
Full stack trace
So the key line is here: mApplicationContext.registerReceiver(mReloadAppBroadcastReceiver, filter); That's exactly the "runtime-registered broadcast receivers" or "context-registered receivers" item that was mentioned in the release notes. I concluded above we didn't use it because our So we'll need to deal with that — it's debug-only, but it completely breaks debug builds, and we do need the ability to run debug builds so we can develop changes when necessary. Presumably RN dealt with this upstream sometime in the last year or two. It's unlikely we'll upgrade RN to that version, because upgrading RN has always been a lot of work and for this legacy codebase that's no longer worth it. It's possible that the solution will look like running our own little fork of RN that just backports one small patch atop v0.68.7, which is (still) the latest v0.68.x and is the version we're using. |
Thanks for all that investigation and writeup! As discussed in the office just now, we should be able to apply the patch using |
…n = 34 This cherry-picks facebook/react-native@177d97d8e (released in RN v0.73), using `patch-package`. Prompted by Greg's investigation: zulip#5877 (comment)
This change will be required in order to upload new releases to the Play Store, effective 2024-10-31, which includes the extension we requested. This change causes Android 14 and later to apply to our app a number of behavior changes introduced in that version, documented here: https://developer.android.com/about/versions/14/behavior-changes-14 Fixes: zulip#5877
…n = 34 This cherry-picks facebook/react-native@177d97d8e (released in RN v0.73). Thanks to Greg for investigating the build failure that this fixes: zulip#5877 (comment) I: - Cherry-picked that commit into our own RN fork, zulip/react-native, on the branch 0.68.7-zulip, and pushed. - (Updated/rearranged that branch to incorporate an unrelated patch, 3e84405, and force-pushed.) - Ran this command (the one I wrote down in a doc in a recent commit): git diff --abbrev=7 \ --src-prefix=a/node_modules/react-native/ \ --dst-prefix=b/node_modules/react-native/ \ v0.68.7 \ > ../zulip-mobile/patches/react-native+0.68.7.patch which cleanly reproduced what the patch-package command did when I used that for an earlier draft of this cherry-pick.
This change will be required in order to upload new releases to the Play Store, effective 2024-10-31, which includes the extension we requested. This change causes Android 14 and later to apply to our app a number of behavior changes introduced in that version, documented here: https://developer.android.com/about/versions/14/behavior-changes-14 Fixes: zulip#5877
This gets us zulip/react-native@5c36f102f and its fixup commit zulip/react-native@b7b2f6c22 (on the `0.68.7-zulip` branch), to fix a build failure with `targetSdkVersion = 34` without having to upgrade to RN v0.73. (The build failure is in debug builds only, but we still need to make those to develop fixes in this legacy project as needed.) Thanks to Greg for investigating the build failure: zulip#5877 (comment) Since (as part of working on this) the `0.68.7-zulip` branch also includes the things that were in the patch-package patch, that patch becomes redundant and we delete it here. Done by digesting the history of RN's doc on building RN from source: facebook/react-native-website@22da0cc63 and making some simplifications. The line `ndkVersion = 24…` sets a variable that ReactAndroid reads, to control the NDK version it builds with. It would otherwise build with NDK 21, which is old and chosen automatically based on ReactAndroid's targetSdkVersion of 31. We need it to be at least 24 for Apple Silicon support.
This change will be required in order to upload new releases to the Play Store, effective 2024-10-31, which includes the extension we requested. This change causes Android 14 and later to apply to our app a number of behavior changes introduced in that version, documented here: https://developer.android.com/about/versions/14/behavior-changes-14 Fixes: zulip#5877
This gets us zulip/react-native@5c36f102f and its fixup commit zulip/react-native@b7b2f6c22 (on the `0.68.7-zulip` branch), to fix a build failure with `targetSdkVersion = 34` without having to upgrade to RN v0.73. (The build failure is in debug builds only, but we still need to make those to develop fixes in this legacy project as needed.) Thanks to Greg for investigating the build failure: zulip#5877 (comment) Since (as part of working on this) the `0.68.7-zulip` branch also includes the things that were in the patch-package patch, that patch becomes redundant and we delete it here. Done by digesting the history of RN's doc on building RN from source: facebook/react-native-website@22da0cc63 and making some simplifications. The line `ndkVersion = 24…` sets a variable that ReactAndroid reads, to control the NDK version it builds with. It would otherwise build with NDK 21, which is old and chosen automatically based on ReactAndroid's targetSdkVersion of 31. We need it to be at least 24 for Apple Silicon support.
This change will be required in order to upload new releases to the Play Store, effective 2024-10-31, which includes the extension we requested. This change causes Android 14 and later to apply to our app a number of behavior changes introduced in that version, documented here: https://developer.android.com/about/versions/14/behavior-changes-14 Fixes: zulip#5877
This gets us zulip/react-native@5c36f102f and its fixup commit zulip/react-native@b7b2f6c22 (on the `0.68.7-zulip` branch), to fix a build failure with `targetSdkVersion = 34` without having to upgrade to RN v0.73. (The build failure is in debug builds only, but we still need to make those to develop fixes in this legacy project as needed.) Thanks to Greg for investigating the build failure: zulip#5877 (comment) Since (as part of working on this) the `0.68.7-zulip` branch also includes the things that were in the patch-package patch, that patch becomes redundant and we delete it here. Done by digesting the history of RN's doc on building RN from source: facebook/react-native-website@22da0cc63 and making some simplifications. The line `ndkVersion = 24…` sets a variable that ReactAndroid reads, to control the NDK version it builds with. It would otherwise build with NDK 21, which is old and chosen automatically based on ReactAndroid's targetSdkVersion of 31. We need it to be at least 24 for Apple Silicon support.
This is the successor to #5453 (and an annual series of previous issues linked from there). We should update our
targetSdkVersion
to 34, meaning Android 14.The deadline
is earlier this year than in some previous years: it's 2024-08-31. (Much like last year, we can request an extension to 2024-11-01.)is 2024-10-31, after I requested an extension.The important steps for this upgrade are:
(edit: Also the changes not tied to targetSdkVersion, because for Android 13 last year a change that should have been in the first doc wasn't, and bit us, and the latter doc had an item that would have raised our suspicions if we'd read that doc closely.)
targetSdkVersion
.The text was updated successfully, but these errors were encountered: