Skip to content

Commit

Permalink
upgrade react-native to 0.73.4
Browse files Browse the repository at this point in the history
fixes #18291

Changes worth mentioning are :
- More hacks/patches
- Force app to use `Java 17` everywhere to compile `kotlin,java`
- `gems` were upgraded after a long time
- `aapt2` was bumped to `8.1.1`
- `metro` is now at `0.80.4`
- `xcbeautify` was bumped to `1.4.0`
- `@react-native-community/clipboard` lib was replaced with `@react-native-clipboard/clipboard`
- `react-native-dialogs` lib was upgraded to `1.1.2`
- `react-native-gesture-handler` lib was upgraded to `2.14.1`
- `react-native-navigation` was upgraded to `7.37.2`

- Android
- iOS

every other iOS build locally with `make run-ios` would fail with this error message :

```
[React-RCTFabric] Compiling RCTThirdPartyFabricComponentsProvider.mm
❌ error: Build input file cannot be found: '/Users/siddarthkumar/code/experiments/status-mobile/
node_modules/react-native/React/Fabric/RCTThirdPartyFabricComponentsProvider.mm'.
Did you forget to declare this file as an output of a script phase or custom build rule which
produces it? (in target 'React-RCTFabric' from project 'Pods')
[React-RCTFabric] Compiling RCTTextInputComponentView.mm
⚠️ Run script build phase 'Bundle React Native code and images' will be run during every build
because it does not specify any outputs. To address this warning, either add output dependencies
to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis"
 in the script phase. (in target 'StatusIm' from project 'StatusIm')
```

This gets fixed with :
- `make xcode-clean`
- `make clean`

However it is frustrating how often this happens now after upgrading to react-native 0.73 🥲
  • Loading branch information
siddarthkay authored and yevh-berdnyk committed Mar 15, 2024
1 parent aa7db8b commit 89f35fc
Show file tree
Hide file tree
Showing 35 changed files with 5,077 additions and 2,220 deletions.
12 changes: 9 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,16 @@ def getEnvOrConfig = { varName ->
android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

namespace "im.status.ethereum"
Expand Down Expand Up @@ -286,6 +291,7 @@ dependencies {
implementation("com.facebook.fresco:animated-gif:2.5.0")
implementation("com.squareup.okhttp3:okhttp-tls:4.9.2")
implementation("com.google.prefab:cli:2.0.0")
implementation("com.android.tools.build:aapt2:8.1.1-10154469")
}


Expand Down
4 changes: 1 addition & 3 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
<!-- Remove licensing permission since we don't license our app and it blocks F-Droid submissions. -->
<uses-permission tools:node="remove" android:name="com.android.vending.CHECK_LICENSE"/>

<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:usesCleartextTraffic="true" >
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:usesCleartextTraffic="true" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class MainActivity : NavigationActivity(), ActivityCompat.OnRequestPermissionsRe

private fun tryToEmit(eventName: String, event: WritableMap) {
try {
(getApplication() as MainApplication).getReactNativeHost()
(getApplication() as MainApplication).reactNativeHost
.getReactInstanceManager()
.getCurrentReactContext()
?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
Expand Down
20 changes: 9 additions & 11 deletions android/app/src/main/java/im/status/ethereum/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ class MainApplication : NavigationApplication() {
return BuildConfig.DEBUG
}

override fun getPackages(): List<ReactPackage> {
val statusPackage = StatusPackage(RootUtil.isDeviceRooted())
val packages = PackageList(this).getPackages()
packages.add(statusPackage)
packages.add(RNStatusKeycardPackage())
packages.add(PushNotificationPackage())
packages.add(BlurViewPackage())
return packages
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here
add(StatusPackage(RootUtil.isDeviceRooted()))
add(RNStatusKeycardPackage())
add(PushNotificationPackage())
add(BlurViewPackage())
}

override fun getJSMainModuleName(): String = "index"
Expand All @@ -42,9 +41,8 @@ class MainApplication : NavigationApplication() {
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}

override fun getReactNativeHost(): ReactNativeHost {
return mReactNativeHost
}
override val reactNativeHost: ReactNativeHost
get() = mReactNativeHost

override fun onCreate() {
super.onCreate()
Expand Down
5 changes: 5 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ext {
supportLibVersion = project.supportLibVersion
gradlePluginVersion = project.gradlePluginVersion
kotlinVersion = project.kotlinPluginVersion
kotlinPluginVersion = project.kotlinPluginVersion
kotlinToolsVersion = project.kotlinPluginVersion
ndkVersion = "25.2.9519653"
}

Expand All @@ -28,6 +30,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinPluginVersion}"
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}

Expand All @@ -46,6 +49,8 @@ subprojects {
}
}

apply plugin: "com.facebook.react.rootproject"

allprojects {
beforeEvaluate {
if (System.env.STATUS_GO_ANDROID_LIBDIR == null || System.env.STATUS_GO_ANDROID_LIBDIR == "") {
Expand Down
6 changes: 3 additions & 3 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

# Version requirements used throughout the Gradle scripts
minSdkVersion=24
compileSdkVersion=33
targetSdkVersion=33
buildToolsVersion=33.0.0
compileSdkVersion=34
targetSdkVersion=34
buildToolsVersion=34.0.0
supportLibVersion=28.0.0
# This should match version from nix/pkgs/aapt2/default.nix
gradlePluginVersion=7.4.2
Expand Down
17 changes: 1 addition & 16 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:@react-native/babel-preset'],
plugins: ['react-native-reanimated/plugin', '@babel/plugin-transform-named-capturing-groups-regex'],
env: {
test: {
presets: [
'@babel/preset-react',
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
},
},
};
1 change: 1 addition & 0 deletions fastlane/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source 'https://rubygems.org'

gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
gem 'fastlane', '>= 2.131.0'
110 changes: 59 additions & 51 deletions fastlane/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,45 @@ GEM
specs:
CFPropertyList (3.0.6)
rexml
addressable (2.8.4)
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.768.0)
aws-sdk-core (3.173.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-eventstream (1.3.0)
aws-partitions (1.872.0)
aws-sdk-core (3.190.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.64.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (1.75.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.122.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-s3 (1.141.0)
aws-sdk-core (~> 3, >= 3.189.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.2)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.1.0)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.2.2)
declarative (0.0.20)
digest-crc (0.6.4)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
domain_name (0.6.20231109)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.99.0)
excon (0.108.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand Down Expand Up @@ -66,7 +71,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.7)
fastlane (2.212.2)
fastlane (2.217.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand All @@ -87,28 +92,29 @@ GEM
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
http-cookie (~> 1.0.5)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
multipart-post (>= 2.0.0, < 3.0.0)
naturally (~> 2.2)
optparse (~> 0.1.1)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
terminal-table (~> 3)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.42.0)
google-apis-androidpublisher_v3 (0.54.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.0)
google-apis-core (0.11.2)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
Expand All @@ -121,59 +127,61 @@ GEM
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.19.0)
google-apis-core (>= 0.9.0, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-apis-storage_v1 (0.29.0)
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-core (1.6.1)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-env (2.1.0)
faraday (>= 1.0, < 3.a)
google-cloud-errors (1.3.1)
google-cloud-storage (1.44.0)
google-cloud-storage (1.45.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.19.0)
google-apis-storage_v1 (~> 0.29.0)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.5.2)
faraday (>= 0.17.3, < 3.a)
googleauth (1.9.1)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.1)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.5)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jmespath (1.6.2)
json (2.6.3)
jwt (2.7.0)
memoist (0.16.2)
json (2.7.1)
jwt (2.7.1)
mini_magick (4.12.0)
mini_mime (1.1.2)
mini_mime (1.1.5)
minitest (5.20.0)
multi_json (1.15.0)
multipart-post (2.0.0)
multipart-post (2.3.0)
nanaimo (0.3.0)
naturally (2.2.1)
optparse (0.1.1)
os (1.1.4)
plist (3.7.0)
public_suffix (5.0.1)
rake (13.0.6)
public_suffix (5.0.4)
rake (13.1.0)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.5)
rexml (3.2.6)
rouge (2.0.7)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.3)
signet (0.17.0)
signet (0.18.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
Expand All @@ -182,21 +190,20 @@ GEM
CFPropertyList
naturally
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
trailblazer-option (0.1.2)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-screen (0.8.2)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
word_wrap (1.0.0)
xcodeproj (1.22.0)
xcodeproj (1.23.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -209,10 +216,11 @@ GEM
xcpretty (~> 0.2, >= 0.0.7)

PLATFORMS
ruby
arm64-darwin-22

DEPENDENCIES
activesupport (>= 6.1.7.3, < 7.1.0)
fastlane (>= 2.131.0)

BUNDLED WITH
2.3.9
2.4.13
Loading

0 comments on commit 89f35fc

Please sign in to comment.