Expoを[React-Native]M 1にイジェクト


BareWorkflowプロジェクトを作成した以上、今からExpo ejectに挑戦してみましょう.
エッジプロジェクトで行われるTypescriptプロジェクトbodaを例に挙げます.

eject

expo eject
sudo gem install cocoapods
sudo arch -x86_64 gem install ffi
npx pod-install

不明なUIID警告が表示されます.
助けてくれグーグル神様
podを更新していないので、podをインストールしました.鉄くずの跡
arch -x86_64 pod deintegrate boda.XCODEPROJ
arch -x86_64 pod install
(bodaはディレクトリ名)

構築と実行


iOSを基準として、2つの方法があります.

コマンドを使用して実行

yarn ios
yarn start

xcodeで実行

open . Finderを開いてiosディレクトリに入ります.
.xcworkspaceを開けてスタートボタンを押せばいいです.
xcodeがない場合は、インストールが必要です.

発生したエラー


cannot find the node binary

  Error: cannot find the node binary. Try setting the NODE_BINARY variable in the  "Bundle React Native code and images" Build Phase to the absolute path to your node binary.  You can find it by executing "which node" in a terminal window.
生成されたPhases/Bundle React Nativeコードと画像で
ノードの位置を教えます.
which node
export NODE_BINARY=/Users/bepyan/.nvm/versions/node/v14.17.3/bin/node
幸せがあれば笑う!

Expected fromDir to be of type string , got undefined

Error: @build-script-error-begin
Error loading Metro config and Expo app config: Expected `fromDir` to be of type `string`, got `undefined`

Make sure your project is configured properly and your app.json / app.config.js is valid.
@build-script-error-end
app.jsonに問題があるそうですが...助けて、グーグル神1
"ios": {
      "supportsTablet": false,
      "bundleIdentifier": "com.boda.app",
      "buildNumber": "1.0.1"
 },
😢 だめだよ...metro.config.js__dirname題ですか?助けてください、グーグル神2
import path from 'path';
const __dirname = path.resolve();
😢 だめだよ...
この役に立たないグーグルの新しいプッシュは
以前に正常に構築されたヌードプロジェクトのコードを確認しました.
結論:index.js(AppEntery)はプロジェクトルートにあるはずです.
以前はsrc/index.tsに置いていましたが、カスタマイズだと言っていました.srcに入らないとちょっと不便です.index.tsに移動してみましたが、ダメですが、.jsファイルに変えればいいです.package.json
{
  "main": "index.js",
  //...
}

結果


3時間の血のつづりを経て、ついにそれを弾き出すことに成功した.
実際、今からアプリケーション設定戦争が始まりました.