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

Upgrade React Native 0.66.4 #1697

Merged
merged 42 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a02742c
update react native to 0.65.2, working for android debug
kathaypacific Dec 28, 2021
3e1dccc
update react and react native types, remove AppState.removeEventListe…
kathaypacific Dec 28, 2021
88a0196
update test config for RN upgrade
kathaypacific Dec 28, 2021
b108d70
update test snapshots
kathaypacific Dec 28, 2021
1acf18b
upgrade to RN 0.66.4, working for android debug
kathaypacific Dec 29, 2021
afad186
fix failing tests
kathaypacific Dec 29, 2021
611bdfd
update types
kathaypacific Dec 29, 2021
50021ad
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Dec 29, 2021
04e97d9
disable lintVitalApptestRelease for now, to test CI
kathaypacific Dec 30, 2021
4f4da66
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Dec 30, 2021
7cb09ca
update snapshots in react components package
kathaypacific Dec 30, 2021
3bc990e
update yarn audit known issues to fix vulnerabilities pipeline
kathaypacific Dec 30, 2021
9f6c78b
remove lintOptions to observe the android lint error in CI again
kathaypacific Jan 3, 2022
1353d4b
test ios upgrade
kathaypacific Jan 3, 2022
1b23e22
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Jan 3, 2022
1282a66
update hermes for RN 0.66
kathaypacific Jan 3, 2022
26f8594
Fix build issue related to "error: could not build module 'Foundation'"
jeanregisser Jan 3, 2022
418200d
update how we set EXCLUDED_ARCHS in podfile for M1 machines
kathaypacific Jan 3, 2022
a45e3fc
fix user_project pod install error
kathaypacific Jan 3, 2022
c4e601e
update correct checksum in podfile
kathaypacific Jan 4, 2022
94fbac3
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Jan 4, 2022
655d050
update outdated snapshot
kathaypacific Jan 4, 2022
557e8f9
attempt to fix persistent build error by clearing yarn cache
kathaypacific Jan 4, 2022
1363db1
add step in android CI to clean build cache, to avoid app:mergeExtDex…
kathaypacific Jan 4, 2022
d3f3282
update react-native-geth dependency
kathaypacific Jan 4, 2022
216f62e
remove gradle cache clean for android e2e
kathaypacific Jan 5, 2022
15f2d8d
remove explicit dependency on viewpager that was causing intermittent…
kathaypacific Jan 5, 2022
cf4c0a2
put back plaid package in android manifest
kathaypacific Jan 6, 2022
c6d0a1a
update kotlin version to fix plaid build error
kathaypacific Jan 6, 2022
50c0681
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Jan 6, 2022
18e0835
update snapshots from main
kathaypacific Jan 6, 2022
b67c9c8
exclude material dependency from detox for android build to stop inte…
kathaypacific Jan 6, 2022
5daa86a
remove plaid import in android manifest to avoid runtime error 'nativ…
kathaypacific Jan 6, 2022
4fee9d9
put back viewpager in android dependency
kathaypacific Jan 6, 2022
d4f82bc
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Jan 6, 2022
f512f33
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Jan 11, 2022
2b4f016
Merge branch 'main' into kathy/upgrade-RN-65
MuckT Jan 11, 2022
58e4873
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Jan 12, 2022
5ee7ac1
update snapshots from main
kathaypacific Jan 12, 2022
2deece0
Merge branch 'main' into kathy/upgrade-RN-65
mergify[bot] Jan 12, 2022
029387a
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Jan 12, 2022
8192581
Merge branch 'main' into kathy/upgrade-RN-65
kathaypacific Jan 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
},
"devDependencies": {
"@actions/github": "^5.0.0",
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@types/jest": "^26.0.20",
"babel-jest": "^26.6.3",
"codecov": "^3.6.5",
Expand Down
14 changes: 13 additions & 1 deletion packages/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ def jscFlavor = 'org.webkit:android-jsc:+'
*/
def enableHermes = project.ext.react.get("enableHermes", false);

/**
* Architectures to build native code for in debug.
*/
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")

def appVersionCode = Integer.valueOf(System.env.CIRCLE_BUILD_NUM ?: VERSION_CODE)

android {
Expand Down Expand Up @@ -209,6 +214,11 @@ android {
// minifyEnabled true
// proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro", "devsupport.pro"
signingConfig signingConfigs.debug
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}

release {
Expand Down Expand Up @@ -268,7 +278,9 @@ android {


dependencies {
androidTestImplementation('com.wix:detox:+')
androidTestImplementation('com.wix:detox:+') {
exclude group: 'com.google.android.material'
}
androidTestImplementation('com.linkedin.testbutler:test-butler-library:2.2.1')

implementation 'androidx.multidex:multidex:2.0.1'
Expand Down
4 changes: 3 additions & 1 deletion packages/mobile/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application android:usesCleartextTraffic="true" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/network_security_config" />
<application android:usesCleartextTraffic="true" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/network_security_config" >
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
3 changes: 0 additions & 3 deletions packages/mobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />

<uses-sdk android:minSdkVersion="21" />

<application android:name=".MainApplication" android:allowBackup="false" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:label="@string/app_name" android:theme="@style/AppTheme" android:networkSecurityConfig="@xml/network_security_config">
<activity android:name=".MainActivity" android:screenOrientation="portrait" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:label="@string/app_name" android:launchMode="singleTop" android:theme="@style/AppTheme" android:windowSoftInputMode="adjustResize">
<intent-filter>
Expand All @@ -39,7 +37,6 @@
<data android:scheme="http" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
See README(https://goo.gl/l4GJaQ) for more. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.facebook.react.bridge.JSIModulePackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.plaid.PlaidPackage;
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
import io.sentry.react.RNSentryPackage;
import java.lang.reflect.InvocationTargetException;
Expand All @@ -38,7 +37,6 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new PlaidPackage());
return packages;
}

Expand Down
3 changes: 1 addition & 2 deletions packages/mobile/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<style name="AppTheme" parent="Base.V0.AppTheme"/>

<!-- Base theme, also see API specific overrides in values-vXX/styles.xml -->
<style name="Base.V0.AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="Base.V0.AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to change this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i don't have a better answer than i tried to copy the changes here https://react-native-community.github.io/upgrade-helper/?from=0.63.4&to=0.66.4 - my naive thinking is that newer versions of android has light/dark themes but i didn't look into it much. do you prefer to keep it unchanged?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. Maybe we should double check how the app is impacted when the dark theme is selected (Settings -> Display -> Theme).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I quickly checked this, the app looks the same as usual in dark mode (except for the native things like keyboard and alerts which are dark) 🙈

<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/black</item>
<!-- The window is always allowed to extend into then notch area -->
Expand All @@ -11,7 +11,6 @@
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<!-- Without this we briefly see the theme preview before our own splash screen -->
<item name="android:windowDisablePreview">true</item>
<item name="android:textColor">#000000</item>
jeanregisser marked this conversation as resolved.
Show resolved Hide resolved
</style>

<!-- Theme for the splash screen, based on AppTheme -->
Expand Down
14 changes: 10 additions & 4 deletions packages/mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ buildscript {
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
supportLibVersion = "30.0.0"
kotlinVersion = "1.5.10"
kotlinVersion = "1.5.21"
// Change this to change the geth version
celoClientDirectory = new File(rootProject.projectDir, '../../../node_modules/@celo/client/build/bin')
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.4'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlinVersion"
Expand All @@ -28,6 +29,7 @@ buildscript {

allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
Expand All @@ -44,7 +46,11 @@ allprojects {
dirs celoClientDirectory
}
google()
jcenter()
jcenter() {
content {
includeGroup("com.google.android.exoplayer")
}
}
maven { url 'https://www.jitpack.io' }
maven {
url 'https://sdk.withpersona.com/android/releases'
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ android.useAndroidX=true
android.enableJetifier=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.69.0
FLIPPER_VERSION=0.99.0
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
21 changes: 3 additions & 18 deletions packages/mobile/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -35,7 +35,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -45,28 +45,13 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
31 changes: 21 additions & 10 deletions packages/mobile/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ $static_framework = [
'Flipper-Glog',
'Flipper-PeerTalk',
'Flipper-RSocket',
'Flipper-Fmt',
]

require_relative "../../../node_modules/react-native/scripts/react_native_pods"
Expand Down Expand Up @@ -49,7 +50,7 @@ target "celo" do
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
use_flipper!()
end

target 'NotificationService' do
Expand All @@ -69,7 +70,8 @@ pre_install do |installer|
end

post_install do |installer|
flipper_post_install(installer)
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)

installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
Expand All @@ -80,14 +82,23 @@ post_install do |installer|
end
end

installer.pods_project.build_configurations.each do |config|
# Needed for now as Xcode 12 now tries to build/link both arm64 and x86_64 slices for the simulator
# but some of our prebuilt deps don't support this
# See:
# - https://stackoverflow.com/a/63955114/158525
# - https://github.com/facebook/react-native/issues/29984
# - https://apontious.com/2020/08/23/arm-wrestling-your-ios-simulator-builds/
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
projects = installer.aggregate_targets
.map{ |t| t.user_project }
.uniq{ |p| p.path }
.push(installer.pods_project)

# This block is needed for preserving the EXCLUDED_ARCHS setting on M1 machines
projects.each do |project|
project.build_configurations.each do |config|
# Needed for now as Xcode 12 now tries to build/link both arm64 and x86_64 slices for the simulator
# but some of our prebuilt deps don't support this
# See:
# - https://stackoverflow.com/a/63955114/158525
# - https://github.com/facebook/react-native/issues/29984
# - https://apontious.com/2020/08/23/arm-wrestling-your-ios-simulator-builds/
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64 "
end
project.save()
end

# Include env xccconfig generated by React Native Config
Expand Down
Loading