Skip to content

Commit ae5e8bb

Browse files
authored
fix(Expo): use correct string to identify MainApplication.kt in SDK 55 (#100)
* fix(Expo): use correct string to identify MainApplication.kt in SDK 55 * fix(CLI): loosen regex for identifying MainApplication.kt in RN 0.82 during init command
1 parent d28f212 commit ae5e8bb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cli/commands/initCommand/initAndroid.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function modifyMainApplicationKt(mainApplicationContent: string) {
4444
}
4545

4646
function addJsBundleFilePathArgument(mainApplicationContent: string) {
47-
const packageListArgumentPattern = /(packageList\s*=\s*\n\s*PackageList\(this\)[\s\S]+?\},\s*\n)/;
47+
const packageListArgumentPattern = /(packageList\s*=\s*\n\s*PackageList\(this\)[\s\S]+?\},?\s*\n)/;
4848

4949
if (!packageListArgumentPattern.test(mainApplicationContent)) {
5050
console.log('log: Could not find packageList argument while updating MainApplication.kt.');

expo/plugin/withCodePushAndroid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { withMainApplication, WarningAggregator } = require('expo/config-plugins');
22

33
const IMPORT_CODE_PUSH = 'import com.microsoft.codepush.react.CodePush';
4-
const RN_082_MARKER = ' getDefaultReactHost(';
4+
const RN_082_MARKER = 'ExpoReactHostFactory.getDefaultReactHost(';
55
const JS_BUNDLE_FILE_PATH_ARGUMENT = 'jsBundleFilePath = CodePush.getJSBundleFile()';
66

77
function androidMainApplicationApplyImplementation(mainApplication, find, add, reverse = false) {
@@ -32,7 +32,7 @@ function addJsBundleFilePathArgument(mainApplication) {
3232
return mainApplication;
3333
}
3434

35-
const packageListArgumentPattern = /(packageList\s*=\s*\n\s*PackageList\(this\)[\s\S]+?\},\s*\n)/;
35+
const packageListArgumentPattern = /(packageList\s*=\s*\n\s*PackageList\(this\)[\s\S]+?\},?\s*\n)/;
3636

3737
if (!packageListArgumentPattern.test(mainApplication)) {
3838
WarningAggregator.addWarningAndroid(

0 commit comments

Comments
 (0)