Skip to content

Commit 922b011

Browse files
committed
chore: upgrade react native to 0.84.1
Works on Android
1 parent 6f0c2e7 commit 922b011

11 files changed

Lines changed: 1723 additions & 1986 deletions

File tree

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ react {
2424

2525
/* Variants */
2626
// The list of variants to that are debuggable. For those we're going to
27-
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
27+
// skip the bundling of the JS bundle and the assets. Default is "debug", "debugOptimized".
2828
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
29-
// debuggableVariants = ["liteDebug", "prodDebug"]
29+
// debuggableVariants = ["liteDebug", "liteDebugOptimized", "prodDebug", "prodDebugOptimized"]
3030

3131
/* Bundling */
3232
// A list containing the node command and its flags. Default is just 'node'.

android/app/src/debug/AndroidManifest.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
android:roundIcon="@mipmap/ic_launcher_round"
1818
android:allowBackup="false"
1919
android:theme="@style/AppTheme"
20+
android:usesCleartextTraffic="${usesCleartextTraffic}"
2021
android:supportsRtl="true"
2122
>
2223

android/app/src/main/java/fr/amicaleinsat/application/MainActivity.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package fr.amicaleinsat.application
22

33
import com.facebook.react.ReactActivity
44
import com.facebook.react.ReactActivityDelegate
5-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
65
import com.facebook.react.defaults.DefaultReactActivityDelegate
76

87
class MainActivity : ReactActivity() {
@@ -12,12 +11,5 @@ class MainActivity : ReactActivity() {
1211
* rendering of the component.
1312
*/
1413
override fun getMainComponentName(): String = "Campus"
15-
16-
/**
17-
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18-
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19-
*/
20-
override fun createReactActivityDelegate(): ReactActivityDelegate =
21-
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
2214
}
2315

android/app/src/main/java/fr/amicaleinsat/application/MainApplication.kt

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,25 @@ import android.app.Application
44
import com.facebook.react.PackageList
55
import com.facebook.react.ReactApplication
66
import com.facebook.react.ReactHost
7-
import com.facebook.react.ReactNativeHost
8-
import com.facebook.react.ReactPackage
9-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
7+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
108
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11-
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.soloader.OpenSourceMergedSoMapping
13-
import com.facebook.soloader.SoLoader
149

1510
class MainApplication : Application(), ReactApplication {
1611

17-
override val reactNativeHost: ReactNativeHost =
18-
object : DefaultReactNativeHost(this) {
19-
override fun getPackages(): List<ReactPackage> =
20-
PackageList(this).packages.apply {
21-
// Packages that cannot be autolinked yet can be added manually here, for example:
22-
// add(MyReactNativePackage())
23-
}
24-
25-
override fun getJSMainModuleName(): String = "index"
26-
27-
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
28-
29-
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
30-
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
31-
}
32-
33-
override val reactHost: ReactHost
34-
get() = getDefaultReactHost(applicationContext, reactNativeHost)
12+
override val reactHost: ReactHost by lazy {
13+
getDefaultReactHost(
14+
context = applicationContext,
15+
packageList =
16+
PackageList(this).packages.apply {
17+
// Packages that cannot be autolinked yet can be added manually here, for example:
18+
// add(MyReactNativePackage())
19+
},
20+
)
21+
}
3522

3623
override fun onCreate() {
3724
super.onCreate()
38-
SoLoader.init(this, OpenSourceMergedSoMapping)
39-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40-
// If you opted-in for the New Architecture, we load the native entry point for this app.
41-
load()
42-
}
25+
loadReactNative(this)
4326
}
4427
}
4528

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "35.0.0"
5+
buildToolsVersion = "36.0.0"
66
minSdkVersion = 24
7-
compileSdkVersion = 35
8-
targetSdkVersion = 35
7+
compileSdkVersion = 36
8+
targetSdkVersion = 36
99
ndkVersion = "27.1.12297006"
10-
kotlinVersion = "2.0.21"
10+
kotlinVersion = "2.1.20"
1111
}
1212
repositories {
1313
google()

android/gradle.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3434
# your application. You should enable this flag either if you want
3535
# to write custom TurboModules/Fabric components OR use libraries that
3636
# are providing them.
37+
# Note: In React Native 0.84+, the new architecture is enabled by default
38+
# and cannot be disabled. This setting is ignored.
3739
newArchEnabled=true
3840

3941
# Use this property to enable or disable the Hermes JS engine.
4042
# If set to false, you will be using JSC instead.
4143
hermesEnabled=true
44+
45+
# Use this property to enable edge-to-edge display support.
46+
# This allows your app to draw behind system bars for an immersive UI.
47+
# Note: Only works with ReactActivity and should not be used with custom Activity.
48+
edgeToEdgeEnabled=false

ios/Campus/Info.plist

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>en</string>
79
<key>CFBundleDisplayName</key>
@@ -32,19 +34,21 @@
3234
<key>CFBundleVersion</key>
3335
<string>44</string>
3436
<key>FacebookAdvertiserIDCollectionEnabled</key>
35-
<false />
37+
<false/>
3638
<key>FacebookAutoInitEnabled</key>
37-
<false />
39+
<false/>
3840
<key>FacebookAutoLogAppEventsEnabled</key>
39-
<false />
41+
<false/>
42+
<key>ITSAppUsesNonExemptEncryption</key>
43+
<false/>
4044
<key>LSRequiresIPhoneOS</key>
41-
<true />
45+
<true/>
4246
<key>NSAppTransportSecurity</key>
4347
<dict>
4448
<key>NSAllowsArbitraryLoads</key>
45-
<false />
49+
<false/>
4650
<key>NSAllowsLocalNetworking</key>
47-
<true />
51+
<true/>
4852
</dict>
4953
<key>UIAppFonts</key>
5054
<array>
@@ -57,17 +61,21 @@
5761
<string>arm64</string>
5862
</array>
5963
<key>UIRequiresFullScreen</key>
60-
<true />
64+
<true/>
6165
<key>UISupportedInterfaceOrientations</key>
6266
<array>
6367
<string>UIInterfaceOrientationPortrait</string>
68+
</array>
69+
<key>UISupportedInterfaceOrientations~ipad</key>
70+
<array>
71+
<string>UIInterfaceOrientationLandscapeLeft</string>
72+
<string>UIInterfaceOrientationLandscapeRight</string>
73+
<string>UIInterfaceOrientationPortrait</string>
6474
<string>UIInterfaceOrientationPortraitUpsideDown</string>
6575
</array>
6676
<key>UIUserInterfaceStyle</key>
6777
<string>Automatic</string>
6878
<key>UIViewControllerBasedStatusBarAppearance</key>
69-
<false />
70-
<key>ITSAppUsesNonExemptEncryption</key>
71-
<false />
79+
<false/>
7280
</dict>
7381
</plist>

ios/Podfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ target 'Campus' do
2424
)
2525

2626
post_install do |installer|
27-
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
2827
react_native_post_install(
2928
installer,
3029
config[:reactNativePath],
31-
:mac_catalyst_enabled => false,
32-
# :ccache_enabled => true
30+
:mac_catalyst_enabled => false
3331
)
3432
end
3533
end

0 commit comments

Comments
 (0)