Skip to content

Commit d17ad82

Browse files
authored
chore: bump expo example (#33)
1 parent 96e5bd3 commit d17ad82

File tree

66 files changed

+2142
-2821
lines changed

Some content is hidden

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

66 files changed

+2142
-2821
lines changed

example-expo/android/app/build.gradle

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@ apply plugin: "com.facebook.react"
44

55
def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
66

7-
static def versionToNumber(major, minor, patch) {
8-
return patch * 100 + minor * 10000 + major * 1000000
9-
}
10-
11-
def getRNVersion() {
12-
def version = providers.exec {
13-
workingDir(projectDir)
14-
commandLine("node", "-e", "console.log(require('react-native/package.json').version);")
15-
}.standardOutput.asText.get().trim()
16-
17-
def coreVersion = version.split("-")[0]
18-
def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() }
19-
20-
return versionToNumber(
21-
major,
22-
minor,
23-
patch
24-
)
25-
}
26-
def rnVersion = getRNVersion()
27-
287
/**
298
* This is the configuration block to customize your React Native Android app.
309
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -41,12 +20,12 @@ react {
4120
bundleCommand = "export:embed"
4221

4322
/* Folders */
44-
// The root of your project, i.e. where "package.json" lives. Default is '..'
45-
// root = file("../")
46-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
47-
// reactNativeDir = file("../node_modules/react-native")
48-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
49-
// 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")
5029

5130
/* Variants */
5231
// The list of variants to that are debuggable. For those we're going to
@@ -79,10 +58,8 @@ react {
7958
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
8059
// hermesFlags = ["-O", "-output-source-map"]
8160

82-
if (rnVersion >= versionToNumber(0, 75, 0)) {
83-
/* Autolinking */
84-
autolinkLibrariesWithApp()
85-
}
61+
/* Autolinking */
62+
autolinkLibrariesWithApp()
8663
}
8764

8865
/**
@@ -144,6 +121,9 @@ android {
144121
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
145122
}
146123
}
124+
androidResources {
125+
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
126+
}
147127
}
148128

149129
// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -194,8 +174,3 @@ dependencies {
194174
implementation jscFlavor
195175
}
196176
}
197-
198-
if (rnVersion < versionToNumber(0, 75, 0)) {
199-
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");
200-
applyNativeModulesAppBuildGradle(project)
201-
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<data android:scheme="https"/>
1212
</intent>
1313
</queries>
14-
<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:localeConfig="@xml/locales_config">
14+
<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" android:localeConfig="@xml/locales_config">
1515
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
1616
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
1717
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
@@ -27,6 +27,5 @@
2727
<data android:scheme="pl.jakubgrzywacz.exampleexpo"/>
2828
</intent-filter>
2929
</activity>
30-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
3130
</application>
3231
</manifest>

example-expo/android/app/src/main/java/pl/jakubgrzywacz/exampleexpo/MainApplication.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ 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
1415

1516
import expo.modules.ApplicationLifecycleDispatcher
@@ -21,9 +22,10 @@ class MainApplication : Application(), ReactApplication {
2122
this,
2223
object : DefaultReactNativeHost(this) {
2324
override fun getPackages(): List<ReactPackage> {
25+
val packages = PackageList(this).packages
2426
// Packages that cannot be autolinked yet can be added manually here, for example:
2527
// packages.add(new MyReactNativePackage());
26-
return PackageList(this).packages
28+
return packages
2729
}
2830

2931
override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"
@@ -40,7 +42,7 @@ class MainApplication : Application(), ReactApplication {
4042

4143
override fun onCreate() {
4244
super.onCreate()
43-
SoLoader.init(this, false)
45+
SoLoader.init(this, OpenSourceMergedSoMapping)
4446
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
4547
// If you opted-in for the New Architecture, we load the native entry point for this app.
4648
load()
5 KB
2.95 KB
Binary file not shown.
7.15 KB
Binary file not shown.
12.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)