📝 docs(README.md): remove extra newline for cleaner formatting
🔧 refactor(MainActivity.java, MainApplication.java): wrap ReactActivityDelegate and ReactNativeHost with Expo wrappers for better Expo compatibility 🔧 refactor(MyAwesomeProject.xcodeproj): update project settings for better compatibility with newer iOS versions and Expo 🔧 refactor(AppDelegate.h): change AppDelegate superclass to EXAppDelegateWrapper for Expo compatibility 🔧 refactor(Podfile): add Expo autolinking and patching, update iOS platform version for Expo compatibility 🔧 refactor(package.json): update Expo and related packages versions for better compatibility and add new Expo related dependencies 🔧 refactor(build.gradle, settings.gradle): update Android build tools and NDK versions, add Expo autolinking for better Expo compatibility
This commit is contained in:
parent
871fabefc0
commit
11035e3a05
@ -1,4 +1,5 @@
|
|||||||
package com.myawesomeproject;
|
package com.myawesomeproject;
|
||||||
|
import expo.modules.ReactActivityDelegateWrapper;
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity;
|
import com.facebook.react.ReactActivity;
|
||||||
import com.facebook.react.ReactActivityDelegate;
|
import com.facebook.react.ReactActivityDelegate;
|
||||||
@ -23,13 +24,13 @@ public class MainActivity extends ReactActivity {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected ReactActivityDelegate createReactActivityDelegate() {
|
protected ReactActivityDelegate createReactActivityDelegate() {
|
||||||
return new DefaultReactActivityDelegate(
|
return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(
|
||||||
this,
|
this,
|
||||||
getMainComponentName(),
|
getMainComponentName(),
|
||||||
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
||||||
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
|
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
|
||||||
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
|
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
|
||||||
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
|
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
package com.myawesomeproject;
|
package com.myawesomeproject;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import expo.modules.ApplicationLifecycleDispatcher;
|
||||||
|
import expo.modules.ReactNativeHostWrapper;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import com.facebook.react.PackageList;
|
import com.facebook.react.PackageList;
|
||||||
@ -13,7 +16,7 @@ import java.util.List;
|
|||||||
public class MainApplication extends Application implements ReactApplication {
|
public class MainApplication extends Application implements ReactApplication {
|
||||||
|
|
||||||
private final ReactNativeHost mReactNativeHost =
|
private final ReactNativeHost mReactNativeHost =
|
||||||
new DefaultReactNativeHost(this) {
|
new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {
|
||||||
@Override
|
@Override
|
||||||
public boolean getUseDeveloperSupport() {
|
public boolean getUseDeveloperSupport() {
|
||||||
return BuildConfig.DEBUG;
|
return BuildConfig.DEBUG;
|
||||||
@ -42,7 +45,7 @@ public class MainApplication extends Application implements ReactApplication {
|
|||||||
protected Boolean isHermesEnabled() {
|
protected Boolean isHermesEnabled() {
|
||||||
return BuildConfig.IS_HERMES_ENABLED;
|
return BuildConfig.IS_HERMES_ENABLED;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ReactNativeHost getReactNativeHost() {
|
public ReactNativeHost getReactNativeHost() {
|
||||||
@ -58,5 +61,12 @@ public class MainApplication extends Application implements ReactApplication {
|
|||||||
DefaultNewArchitectureEntryPoint.load();
|
DefaultNewArchitectureEntryPoint.load();
|
||||||
}
|
}
|
||||||
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
||||||
|
ApplicationLifecycleDispatcher.onApplicationCreate(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
|
super.onConfigurationChanged(newConfig);
|
||||||
|
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,16 +6,16 @@ buildscript {
|
|||||||
minSdkVersion = 21
|
minSdkVersion = 21
|
||||||
compileSdkVersion = 33
|
compileSdkVersion = 33
|
||||||
targetSdkVersion = 33
|
targetSdkVersion = 33
|
||||||
|
cmakeVersion = "3.28.1"
|
||||||
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
|
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
|
||||||
ndkVersion = "23.1.7779620"
|
ndkVersion = "26.1.10909125"
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:7.3.1")
|
classpath("com.android.tools.build:gradle:7.4.1")
|
||||||
classpath("com.facebook.react:react-native-gradle-plugin")
|
classpath("com.facebook.react:react-native-gradle-plugin")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,3 +2,6 @@ rootProject.name = 'MyAwesomeProject'
|
|||||||
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
|
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
|
||||||
include ':app'
|
include ':app'
|
||||||
includeBuild('../node_modules/react-native-gradle-plugin')
|
includeBuild('../node_modules/react-native-gradle-plugin')
|
||||||
|
|
||||||
|
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
|
||||||
|
useExpoModules()
|
@ -19,7 +19,7 @@
|
|||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
|
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
|
||||||
isa = PBXContainerItemProxy;
|
isa = PBXContainerItemProxy;
|
||||||
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
containerPortal = 83CBB9F71A601CBA00E9B192;
|
||||||
proxyType = 1;
|
proxyType = 1;
|
||||||
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
|
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
|
||||||
remoteInfo = MyAwesomeProject;
|
remoteInfo = MyAwesomeProject;
|
||||||
@ -113,7 +113,7 @@
|
|||||||
name = Libraries;
|
name = Libraries;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
83CBB9F61A601CBA00E9B192 = {
|
83CBB9F61A601CBA00E9B192 /* PBXGroup */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
13B07FAE1A68108700A75B9A /* MyAwesomeProject */,
|
13B07FAE1A68108700A75B9A /* MyAwesomeProject */,
|
||||||
@ -197,14 +197,14 @@
|
|||||||
/* End PBXNativeTarget section */
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
/* Begin PBXProject section */
|
/* Begin PBXProject section */
|
||||||
83CBB9F71A601CBA00E9B192 /* Project object */ = {
|
83CBB9F71A601CBA00E9B192 = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastUpgradeCheck = 1210;
|
LastUpgradeCheck = 1210;
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
00E356ED1AD99517003FC87E = {
|
00E356ED1AD99517003FC87E = {
|
||||||
CreatedOnToolsVersion = 6.2;
|
CreatedOnToolsVersion = 6.2;
|
||||||
TestTargetID = 13B07F861A680F5B00A75B9A;
|
TestTargetID = 13B07F861A680F5B00A75B9A /* MyAwesomeProject */;
|
||||||
};
|
};
|
||||||
13B07F861A680F5B00A75B9A = {
|
13B07F861A680F5B00A75B9A = {
|
||||||
LastSwiftMigration = 1120;
|
LastSwiftMigration = 1120;
|
||||||
@ -219,7 +219,7 @@
|
|||||||
en,
|
en,
|
||||||
Base,
|
Base,
|
||||||
);
|
);
|
||||||
mainGroup = 83CBB9F61A601CBA00E9B192;
|
mainGroup = 83CBB9F61A601CBA00E9B192 /* PBXGroup */;
|
||||||
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
|
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
|
||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
@ -438,7 +438,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
);
|
);
|
||||||
INFOPLIST_FILE = MyAwesomeProjectTests/Info.plist;
|
INFOPLIST_FILE = MyAwesomeProjectTests/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
@ -462,7 +462,7 @@
|
|||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
INFOPLIST_FILE = MyAwesomeProjectTests/Info.plist;
|
INFOPLIST_FILE = MyAwesomeProjectTests/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
@ -580,7 +580,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
/usr/lib/swift,
|
/usr/lib/swift,
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@ -644,7 +644,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
/usr/lib/swift,
|
/usr/lib/swift,
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@ -698,5 +698,5 @@
|
|||||||
};
|
};
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
};
|
};
|
||||||
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
rootObject = 83CBB9F71A601CBA00E9B192;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#import <RCTAppDelegate.h>
|
#import <RCTAppDelegate.h>
|
||||||
|
#import <Expo/Expo.h>
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
@interface AppDelegate : RCTAppDelegate
|
@interface AppDelegate : EXAppDelegateWrapper
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
16
ios/Podfile
16
ios/Podfile
@ -1,7 +1,8 @@
|
|||||||
|
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
|
||||||
require_relative '../node_modules/react-native/scripts/react_native_pods'
|
require_relative '../node_modules/react-native/scripts/react_native_pods'
|
||||||
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
||||||
|
|
||||||
platform :ios, min_ios_version_supported
|
platform :ios, '13.0'
|
||||||
prepare_react_native_project!
|
prepare_react_native_project!
|
||||||
|
|
||||||
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
|
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
|
||||||
@ -22,6 +23,19 @@ if linkage != nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
target 'MyAwesomeProject' do
|
target 'MyAwesomeProject' do
|
||||||
|
use_expo_modules!
|
||||||
|
post_integrate do |installer|
|
||||||
|
begin
|
||||||
|
expo_patch_react_imports!(installer)
|
||||||
|
rescue => e
|
||||||
|
Pod::UI.warn e
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
expo_patch_react_imports!(installer)
|
||||||
|
rescue => e
|
||||||
|
Pod::UI.warn e
|
||||||
|
end
|
||||||
|
end
|
||||||
config = use_native_modules!
|
config = use_native_modules!
|
||||||
|
|
||||||
# Flags change depending on the env values.
|
# Flags change depending on the env values.
|
||||||
|
@ -16,12 +16,16 @@
|
|||||||
"@react-navigation/native-stack": "^6.9.12",
|
"@react-navigation/native-stack": "^6.9.12",
|
||||||
"@reduxjs/toolkit": "^1.9.3",
|
"@reduxjs/toolkit": "^1.9.3",
|
||||||
"axios": "^1.3.4",
|
"axios": "^1.3.4",
|
||||||
"expo": "^48.0.9",
|
"expo": "^48.0.0",
|
||||||
"expo-cli": "^6.3.2",
|
"expo-cli": "^6.3.2",
|
||||||
|
"expo-constants": "^14.4.2",
|
||||||
|
"expo-modules-core": "^1.5.12",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-native": "0.71.4",
|
"react-native": "0.71.4",
|
||||||
"react-native-async-storage": "^0.0.1",
|
"react-native-async-storage": "^0.0.1",
|
||||||
"react-native-paper": "^5.6.0",
|
"react-native-paper": "^5.6.0",
|
||||||
|
"react-native-safe-area-context": "^4.9.0",
|
||||||
|
"react-native-safe-area-view": "^1.1.1",
|
||||||
"react-native-simple-toast": "^2.0.0",
|
"react-native-simple-toast": "^2.0.0",
|
||||||
"react-native-vector-icons": "^9.2.0",
|
"react-native-vector-icons": "^9.2.0",
|
||||||
"react-redux": "^8.0.5",
|
"react-redux": "^8.0.5",
|
||||||
|
Loading…
Reference in New Issue
Block a user