Skip to content

Commit df7067e

Browse files
Upgrade to expo 52 in example app (#1025)
* update deps * apply change * migration * fix build * fix build * fix build * update ios --------- Co-authored-by: tim.lin <[email protected]>
1 parent 97fbc6e commit df7067e

File tree

61 files changed

+3149
-3396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3149
-3396
lines changed

example-app/android/app/build.gradle

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ react {
2020
bundleCommand = "export:embed"
2121

2222
/* Folders */
23-
// The root of your project, i.e. where "package.json" lives. Default is '..'
24-
// root = file("../")
25-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
26-
// reactNativeDir = file("../node_modules/react-native")
27-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
28-
// codegenDir = file("../node_modules/@react-native/codegen")
23+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
24+
// root = file("../../")
25+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
26+
// reactNativeDir = file("../../node_modules/react-native")
27+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
28+
// codegenDir = file("../../node_modules/@react-native/codegen")
2929

3030
/* Variants */
3131
// The list of variants to that are debuggable. For those we're going to
@@ -57,6 +57,9 @@ react {
5757
//
5858
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5959
// hermesFlags = ["-O", "-output-source-map"]
60+
61+
/* Autolinking */
62+
autolinkLibrariesWithApp()
6063
}
6164

6265
/**
@@ -110,13 +113,17 @@ android {
110113
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
111114
minifyEnabled enableProguardInReleaseBuilds
112115
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
116+
crunchPngs (findProperty('android.enablePngCrunchInReleaseBuilds')?.toBoolean() ?: true)
113117
}
114118
}
115119
packagingOptions {
116120
jniLibs {
117121
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
118122
}
119123
}
124+
androidResources {
125+
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
126+
}
120127
}
121128

122129
// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -167,6 +174,3 @@ dependencies {
167174
implementation jscFlavor
168175
}
169176
}
170-
171-
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
172-
applyNativeModulesAppBuildGradle(project)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<data android:scheme="https"/>
1616
</intent>
1717
</queries>
18-
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme">
18+
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true">
1919
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
2020
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
2121
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
@@ -31,6 +31,5 @@
3131
<data android:scheme="com.example.stripeterminalreactnative"/>
3232
</intent-filter>
3333
</activity>
34-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
3534
</application>
3635
</manifest>

example-app/android/app/src/main/java/com/example/stripeterminalreactnative/MainApplication.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,23 @@ import com.facebook.react.ReactPackage
1010
import com.facebook.react.ReactHost
1111
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1212
import com.facebook.react.defaults.DefaultReactNativeHost
13+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1314
import com.facebook.soloader.SoLoader
14-
import com.stripeterminalreactnative.TerminalApplicationDelegate;
1515

1616
import expo.modules.ApplicationLifecycleDispatcher
1717
import expo.modules.ReactNativeHostWrapper
18+
import com.stripeterminalreactnative.TerminalApplicationDelegate
1819

1920
class MainApplication : Application(), ReactApplication {
2021

2122
override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(
2223
this,
2324
object : DefaultReactNativeHost(this) {
2425
override fun getPackages(): List<ReactPackage> {
26+
val packages = PackageList(this).packages
2527
// Packages that cannot be autolinked yet can be added manually here, for example:
2628
// packages.add(new MyReactNativePackage());
27-
return PackageList(this).packages
29+
return packages
2830
}
2931

3032
override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"
@@ -42,7 +44,7 @@ class MainApplication : Application(), ReactApplication {
4244
override fun onCreate() {
4345
super.onCreate()
4446
TerminalApplicationDelegate.onCreate(this);
45-
SoLoader.init(this, false)
47+
SoLoader.init(this, OpenSourceMergedSoMapping)
4648
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
4749
// If you opted-in for the New Architecture, we load the native entry point for this app.
4850
load()
20.3 KB
12.6 KB
28.4 KB
46 KB
65 KB
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
2+
<item android:drawable="@color/splashscreen_background"/>
3+
<item>
4+
<bitmap android:gravity="center" android:src="@drawable/splashscreen_logo"/>
5+
</item>
6+
</layer-list>
-8.18 KB
Binary file not shown.

0 commit comments

Comments
 (0)