4

反応ネイティブ プロジェクトのソース コードをレビューしていますが、ビルドに問題があります。

以下を実行した後

  1. npm installプロジェクトのルートで
  2. pod installiosフォルダに

ターミナルに次のメッセージが表示されました。

sh: -c: line 0: syntax error near unexpected token `('

sh: -c: line 0: `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' /Users/myUser/dev/ReactExplorerApp(Android)/ios/Pods/RCT-Folly/folly/portability/Time.h'

XCode でアプリケーションをビルドすると、Time.h (...Pods/RCT-Folly/folly/portability/Time.h) で次のエラー メッセージが表示されます。

Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t')

アプリは "react-native": "0.66.1" を使用します。ココアポッド バージョン 1.11.2、ノード バージョン 14.17.2、および XCode バージョン 13.1 を使用しています。

Podfile の内容:

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'ExplorerApp' do
  config = use_native_modules!
  pod 'GoogleSignIn'
  pod 'RNI18n', :path => '../node_modules/react-native-i18n'
  pod 'react-native-version-check', :path => '../node_modules/react-native-version-check'
  pod 'react-native-camera', path: '../node_modules/react-native-camera', subspecs: [
    'FaceDetectorMLKit',
    'BarcodeDetectorMLKit'
  ]

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )


  target 'ExplorerAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_native_modules!
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

同様の問題に対して多くの解決策を試しましたが、うまくいきませんでした。ポッドファイルでFlipperをコメントアウトして無効にしてみました。また、ターゲットをiOS 12に変更してみました。また、podfile.lockを削除して実行した後、ポッドをインストールしようとしましたが、実行pod install --repo-updateしましたpod cache clean --all

私もここで解決策を試しましたhttps://github.com/facebook/react-native/issues/31480のために"react-native": "0.64.1" // or higher しかし、それは私にとってはうまくいきませんでした。 podfile.lock" それでもエラーが発生する場合。

編集: [解決策] git clone [repo url]VSCode と連携する Azure DevOps の [クローン] ボタンを使用する代わりに、実際にターミナルで実行することで、このエラーを取り除きました。

4

1 に答える 1