0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

React Native + ExpoアプリをiOS用にビルドする際に発生したエラーの対処法

Posted at

概要

React NativeアプリをExpoで作成し、iOS向けにビルドする際発生したエラーの解決方法を記す。

前提

  • Mac開発
  • AppStoreからXcodeをインストール済み
  • Node.jsがインストールされており、npxコマンドが使用できる

テンプレート作成

以下のコマンドを使用してExpoテンプレートプロジェクトを作成する。

terminal
npx create-expo-app@latest . --template blank-typescript
  • npx
    パッケージをインストールせずにコマンドを実行する。
  • create-expo-app@latest
    最新バージョンのExpoプロジェクトを作成するコマンンドラインツール。
  • .
    作成場所をカレントディレクトリとする。
  • --template blank-typescript
    プロジェクトのテンプレートを指定する。
    blankで最も基本的なテンプレートを作成することを指定し、typescriptでTypeScriptを使用することを明示する。

実行とエラー発生

以下のコマンドでExpoアプリケーションを実行する。

terminal
npx expo start

すると以下のエラーが出力される。

terminal
Xcode must be fully installed before you can continue. Continue to the App Store? › (Y/n)

Xcodeは既にインストール済みだが、完全にインストールされていないと表示される、、

原因と解決策

原因

Xcodeのデベロッパディレクトリが正しく指定されていなかったため、iOSシミュレータが起動しなかった。

解決策

Xcodeのコマンドラインツールを指定する。

terminal
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
  • sudo
    スーパーユーザで実行。
  • xcode-select -s
    指定されたパスをアクティブなデベロッパディレクトリとして設定する。(--switchオプション)
  • /Applications/Xcode.app/Contents/Developer
    Xcodeの標準デベロッパディレクトリ。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?