Page MenuHomePhabricator

[android] Bump Target SDK to 31 and patch `react-native-firebase`
ClosedPublic

Authored by atul on Nov 22 2022, 2:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 2:23 PM
Unknown Object (File)
Tue, Nov 19, 2:23 PM
Unknown Object (File)
Tue, Nov 19, 2:23 PM
Unknown Object (File)
Tue, Nov 19, 2:21 PM
Unknown Object (File)
Tue, Nov 19, 2:11 PM
Unknown Object (File)
Thu, Nov 7, 5:46 AM
Unknown Object (File)
Thu, Nov 7, 5:43 AM
Unknown Object (File)
Mon, Nov 4, 3:07 AM
Subscribers

Details

Summary

The Google Play Store no longer allows uploading bundles for which Target SDK <= 30. This diff:

  1. Bumps the Target SDK to 31
  2. Makes required changes to AndroidManifest.xml to support SDK v31
  3. Includes patch from @ashoat to ensure that react-native-firebase continues to work as expected (see below)

From @ashoat's commit (https://github.com/CommE2E/comm/commit/19c0e0a2f114c12dea19ae6512a86add1a03690f):

Patch react-native-firebase to specify PendingIntent.FLAG_MUTABLE

Android notifs weren't working and I was seeing this error: https://gist.github.com/Ashoat/62cf37d7b180798cf63555660c8a84a8

This was triggering because we had just started targeting SDK 31. I solved it by specifying FLAG_MUTABLE to match behavior from old version of Android. More details here.

Test Plan
  1. See if the AAB uploads properly
  2. Debug/Release Android build continue working as expected on Android Emulator

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Nov 22 2022, 2:23 PM
atul edited the summary of this revision. (Show Details)
atul edited the test plan for this revision. (Show Details)

set

android:exported="true"

I think I had to set android:exported in native/android/app/src/debug/AndroidManifest.xml as well, are you sure you don't need to do the same here?

https://github.com/CommE2E/comm/commit/0ceb49d305b135f68cd695683a71a2a1294f36f8

Changing just native/android/app/src/main/AndroidManifest.xml seems to work for me

Looks like CI (which does a bundleRelease build) passes as well

Bundle release won't touch native/android/app/src/debug/AndroidManifest.xml, only a debug build will. Your test plan says you tested debug builds, but maybe try doing some "nuclear clean" type shit before a debug build and see if it still works?

This revision is now accepted and ready to land.Nov 22 2022, 2:55 PM

Bundle release won't touch native/android/app/src/debug/AndroidManifest.xml, only a debug build will. Your test plan says you tested debug builds, but maybe try doing some "nuclear clean" type shit before a debug build and see if it still works?

Ok I'll clean everything then try a Debug build and

A. make sure it works as-is
B. update this diff with changes to native/android/app/src/debug/AndroidManifest.xml if it doesn't

before landing