[React-Native] Expo build jsEngine

kk_jang93ยท2024๋…„ 7์›” 12์ผ
0

1. App.js ์ถ”๊ฐ€

{
	"expo": {
		"jsEngine": "hermes"
	}
}

์˜ˆ์‹œ
{
  "expo": {
    "name": "client",
    "slug": "client",
    **"jsEngine" : "hermes", <-- ์ถ”๊ฐ€**
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "bundleIdentifier": "com.rabbit.testApp",
      "supportsTablet": true,
      "buildNumber": "1.0.0"
    },
    "android": {
      "package": "com.rabbit.testApp",
      "versionCode": 1 ,
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    }
  }
}

2. Command Insert
* ํ•ด๋‹น ํ”„๋กœ์ ํŠธ์— ์ง„์ž… ํ›„ ์•„๋ž˜ ๋ช…๋ น์–ด ์‹คํ–‰ 

$ npm install -g eas-cli
$ npm install -g eas-cli-local-build-plugin

๐Ÿ˜ฎโ€๐Ÿ’จย  M1 Mac

iOS์šฉ Hermes๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ์šฉ์œผ๋กœ ๋นŒ๋“œํ•  ๋•Œ ๋‹ค์Œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์—…๋กœ๋“œ์ค‘..

--- a/ios/Podfile
+++ b/ios/Podfile
@@ -25,6 +25,22 @@ target 'HelloWorld' do
   post_install do |installer|
     react_native_post_install(installer)

+    # Workaround simulator build error for hermes with react-native 0.64 on mac m1 devices
+    arm_value = `/usr/sbin/sysctl -n hw.optional.arm64 2>&1`.to_i
+    has_hermes = has_pod(installer, 'hermes-engine')
+    if arm_value == 1 && has_hermes
+      projects = installer.aggregate_targets
+        .map{ |t| t.user_project }
+        .uniq{ |p| p.path }
+        .push(installer.pods_project)
+      projects.each do |project|
+        project.build_configurations.each do |config|
+          config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] + ' arm64'
+        end
+        project.save()
+      end
+    end
+
     # Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
     # Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
     installer.pods_project.targets.each do |target|

// ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•
Pod๋ฅผ ๋‹ค์‹œ ์„ค์น˜ํ•˜๊ณ  Xcode ๋นŒ๋“œ ์บ์‹œ๋ฅผ ์ •๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

$ npx pod-install
$ xcodebuild clean -workspace ios/{projectName}.xcworkspace -scheme {projectName}

Android build Test Result


์ตœ์ ํ™” ์ „ ๋นŒ๋“œ ์ง„ํ–‰

์ตœ์ ํ™” ํ›„ ๋นŒ๋“œ ์ง„ํ–‰


profile
์•ฑ๊ฐœ๋ฐœ์„ ์‚ฌ๋ž‘ํ•˜๋Š” ๊ฐœ๋ฐœ์ž

0๊ฐœ์˜ ๋Œ“๊ธ€