Skip to content

Commit ee7b64d

Browse files
authored
upgrade to latest react native version (#36)
1 parent f2fff48 commit ee7b64d

File tree

21 files changed

+3934
-729
lines changed

21 files changed

+3934
-729
lines changed

example/Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ ruby ">= 2.6.10"
55

66
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
77
# bound in the template on Cocoapods with next React Native release.
8-
gem 'cocoapods', '>= 1.13', '< 1.15'
9-
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
8+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
9+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
10+
gem 'xcodeproj', '< 1.26.0'
11+
gem 'concurrent-ruby', '< 1.3.4'

example/android/app/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ react {
4949
//
5050
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5151
// hermesFlags = ["-O", "-output-source-map"]
52+
autolinkLibrariesWithApp()
5253
}
5354

5455
/**
@@ -107,13 +108,10 @@ android {
107108
dependencies {
108109
// The version of react-native is set by the React Native Gradle Plugin
109110
implementation("com.facebook.react:react-android")
110-
implementation("com.facebook.react:flipper-integration")
111111

112112
if (hermesEnabled.toBoolean()) {
113113
implementation("com.facebook.react:hermes-android")
114114
} else {
115115
implementation jscFlavor
116116
}
117117
}
118-
119-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

example/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
android:icon="@mipmap/ic_launcher"
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:allowBackup="false"
11-
android:theme="@style/AppTheme">
11+
android:theme="@style/AppTheme"
12+
android:supportsRtl="true">
1213
<activity
1314
android:name=".MainActivity"
1415
android:label="@string/app_name"

example/android/app/src/main/java/com/wearconnectivityexample/MainApplication.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.facebook.react.ReactPackage
99
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.flipper.ReactNativeFlipper
12+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1313
import com.facebook.soloader.SoLoader
1414

1515
class MainApplication : Application(), ReactApplication {
@@ -31,15 +31,14 @@ class MainApplication : Application(), ReactApplication {
3131
}
3232

3333
override val reactHost: ReactHost
34-
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
34+
get() = getDefaultReactHost(applicationContext, reactNativeHost)
3535

3636
override fun onCreate() {
3737
super.onCreate()
38-
SoLoader.init(this, false)
38+
SoLoader.init(this, OpenSourceMergedSoMapping)
3939
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
4040
// If you opted-in for the New Architecture, we load the native entry point for this app.
4141
load()
4242
}
43-
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
4443
}
4544
}

example/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
buildscript {
22
ext {
3-
buildToolsVersion = "34.0.0"
4-
minSdkVersion = 21
5-
compileSdkVersion = 34
3+
buildToolsVersion = "35.0.0"
4+
minSdkVersion = 24
5+
compileSdkVersion = 35
66
targetSdkVersion = 34
7-
ndkVersion = "25.1.8937393"
8-
kotlinVersion = "1.8.0"
7+
ndkVersion = "27.1.12297006"
8+
kotlinVersion = "2.0.21"
99
}
1010
repositories {
1111
google()

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/android/gradlew.bat

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

example/android/settings.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
2+
plugins { id("com.facebook.react.settings") }
3+
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
14
rootProject.name = 'WearConnectivityExample'
25
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
36
include ':app'

example/ios/AppDelegate.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import UIKit
2+
import React
3+
import React_RCTAppDelegate
4+
import ReactAppDependencyProvider
5+
6+
@main
7+
class AppDelegate: RCTAppDelegate {
8+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
9+
self.moduleName = "WearConnectivityExample"
10+
self.dependencyProvider = RCTAppDependencyProvider()
11+
12+
// You can add your custom initial props in the dictionary below.
13+
// They will be passed down to the ViewController used by React Native.
14+
self.initialProps = [:]
15+
16+
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
17+
}
18+
19+
override func sourceURL(for bridge: RCTBridge) -> URL? {
20+
self.bundleURL()
21+
}
22+
23+
override func bundleURL() -> URL? {
24+
#if DEBUG
25+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
26+
#else
27+
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
28+
#endif
29+
}
30+
}

example/ios/Podfile

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,6 @@ require Pod::Executable.execute_command('node', ['-p',
88
platform :ios, min_ios_version_supported
99
prepare_react_native_project!
1010

11-
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
12-
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
13-
#
14-
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
15-
# ```js
16-
# module.exports = {
17-
# dependencies: {
18-
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
19-
# ```
20-
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
21-
2211
linkage = ENV['USE_FRAMEWORKS']
2312
if linkage != nil
2413
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
@@ -30,26 +19,17 @@ target 'WearConnectivityExample' do
3019

3120
use_react_native!(
3221
:path => config[:reactNativePath],
33-
# Enables Flipper.
34-
#
35-
# Note that if you have use_frameworks! enabled, Flipper will not work and
36-
# you should disable the next line.
37-
:flipper_configuration => flipper_config,
3822
# An absolute path to your application root.
3923
:app_path => "#{Pod::Config.instance.installation_root}/.."
4024
)
4125

42-
target 'WearConnectivityExampleTests' do
43-
inherit! :complete
44-
# Pods for testing
45-
end
46-
4726
post_install do |installer|
4827
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
4928
react_native_post_install(
5029
installer,
5130
config[:reactNativePath],
52-
:mac_catalyst_enabled => false
31+
:mac_catalyst_enabled => false,
32+
# :ccache_enabled => true
5333
)
5434
end
5535
end

0 commit comments

Comments
 (0)