Skip to content

Commit 961233c

Browse files
committed
🎬 Update example app for RN version
1 parent 2b929f4 commit 961233c

17 files changed

Lines changed: 5602 additions & 7780 deletions

File tree

‎example/App.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ function RootView() {
4747
background: `#FFFFFF`,
4848
border: `#FFFFFF`,
4949
},
50+
fonts: DefaultTheme.fonts,
5051
}}
5152
>
5253
<RootStack.Navigator>

‎example/android/app/build.gradle‎

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,8 @@ apply plugin: "com.facebook.react"
88
*/
99

1010
react {
11-
/* Folders */
12-
// The root of your project, i.e. where "package.json" lives. Default is '..'
13-
root = file("../../")
14-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
15-
// reactNativeDir = file("../node_modules/react-native")
16-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
17-
// codegenDir = file("../node_modules/@react-native/codegen")
18-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
19-
// cliFile = file("../node_modules/react-native/cli.js")
20-
/* Variants */
21-
// The list of variants to that are debuggable. For those we're going to
22-
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
23-
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
24-
// debuggableVariants = ["liteDebug", "prodDebug"]
25-
/* Bundling */
26-
// A list containing the node command and its flags. Default is just 'node'.
27-
// nodeExecutableAndArgs = ["node"]
28-
//
29-
// The command to run when bundling. By default is 'bundle'
30-
// bundleCommand = "ram-bundle"
31-
//
32-
// The path to the CLI configuration file. Default is empty.
33-
// bundleConfig = file(../rn-cli.config.js)
34-
//
35-
// The name of the generated asset file containing your JS bundle
36-
// bundleAssetName = "MyApplication.android.bundle"
37-
//
38-
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
39-
// entryFile = file("../js/MyApplication.android.js")
40-
//
41-
// A list of extra flags to pass to the 'bundle' commands.
42-
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
43-
// extraPackagerArgs = []
44-
/* Hermes Commands */
45-
// The hermes compiler command to run. By default it is 'hermesc'
46-
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
47-
//
48-
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
49-
// hermesFlags = ["-O", "-output-source-map"]
11+
/* Autolinking */
12+
autolinkLibrariesWithApp()
5013
}
5114

5215
/**
@@ -113,8 +76,6 @@ dependencies {
11376
}
11477
}
11578

116-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
117-
11879
project.ext.vectoricons = [
11980
iconFontNames: [ 'Ionicons.ttf' ] // Name of the font files you want to copy
12081
]

‎example/android/app/src/main/java/com/appcues/samples/segment/reactnative/MainApplication.kt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +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.soloader.OpenSourceMergedSoMapping
1213
import com.facebook.soloader.SoLoader
1314

1415
class MainApplication : Application(), ReactApplication {
@@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {
3435

3536
override fun onCreate() {
3637
super.onCreate()
37-
SoLoader.init(this, false)
38+
SoLoader.init(this, OpenSourceMergedSoMapping)
3839
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
3940
// If you opted-in for the New Architecture, we load the native entry point for this app.
4041
load()

‎example/android/build.gradle‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
buildscript {
44
ext {
55
buildToolsVersion = "34.0.0"
6-
minSdkVersion = 23
7-
compileSdkVersion = 34
8-
targetSdkVersion = 34
6+
minSdkVersion = 24
7+
compileSdkVersion = 35
8+
targetSdkVersion = 35
99
ndkVersion = "26.1.10909125"
1010
kotlinVersion = "1.9.22"
1111
}

‎example/android/gradle.properties‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,27 @@
99

1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
12-
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14-
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
12+
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13+
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
1514

1615
# When configured, Gradle will run in incubating parallel mode.
1716
# This option should only be used with decoupled projects. More details, visit
1817
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1918
# org.gradle.parallel=true
2019

20+
# AndroidX package structure to make it clearer which packages are bundled with the
21+
# Android operating system, and which are packaged with your app's APK
22+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2123
android.useAndroidX=true
22-
android.enableJetifier=true
23-
android.defaults.buildfeatures.buildconfig=true
24-
android.nonTransitiveRClass=false
25-
android.nonFinalResIds=false
24+
25+
# Use this property to specify which architecture you want to build.
26+
# You can also override it from the CLI using
27+
# ./gradlew -PreactNativeArchitectures=x86_64
28+
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
29+
30+
# Use this property to enable support to the new architecture.
31+
newArchEnabled=true
2632

2733
# Use this property to enable or disable the Hermes JS engine.
2834
# If set to false, you will be using JSC instead.
29-
hermesEnabled=false
35+
hermesEnabled=true

‎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.6-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
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
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 = 'SegmentAppcuesReactNativeExample'
2-
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
35
include ':app'
46

5-
includeBuild('../node_modules/@react-native/gradle-plugin')
7+
includeBuild('../node_modules/@react-native/gradle-plugin')

‎example/ios/Podfile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ENV['RCT_NEW_ARCH_ENABLED'] = '1'
2+
13
# Resolve react_native_pods.rb with node to allow for hoisting
24
require Pod::Executable.execute_command('node', ['-p',
35
'require.resolve(

0 commit comments

Comments
 (0)