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?

macPC入れ替えでXcodeProjectのワークスペースを移動したら動かなくなった時の解決策

Posted at

急に mac mini が再起動を繰り返す現象が1年近く治りそうで治らなかったので、仕方なく新しい mac mini を購入しました。
macの機能を使ってそのまま移行すると、また再起動を繰り返しそうだなと思い、新規に入れ直しました。
その中で XcodeProject のワークスペースをコピペで移動したところ、起動時にエラーとなってしまいました。

エラーメッセージ
Showing Recent Issues Could not determine generated file paths for Core Data code generation: The command `(cd /Users/ /Desktop/XcodeProject/ && /Applications/Xcode.app/Contents/Developer/usr/bin/momc --dry-run --action generate --swift-version 4.0 --sdkroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk --iphonesimulator-deployment-target 16.0 --module アプリ名 /Users/ユーザー名/Desktop/XcodeProject/ /coredata/CoreDataModel.xcdatamodeld /Users/ユーザー名/Library/Developer/Xcode/DerivedData/ /Build/Intermediates.noindex/ .build/Debug-iphonesimulator/アプリ名.build/DerivedSources/CoreDataGenerated/CoreDataModel)` exited with status 1. The command's standard error was: /Users/ユーザー名/Desktop/XcodeProject/ /coredata/CoreDataModel.xcdatamodeld:: error: Could not fetch generated file paths: No current version for model at path /Users/ユーザー名/Desktop/XcodeProject/ /coredata/CoreDataModel.xcdatamodeld: [0]

エラー内容としては、ユーザー名が異なることで CoreData が参照できないというもののようです。

プロジェクト名.xcodeproj のアイコンを右クリックして「パッケージの内容を表示」を選択、 project.pbxproj アイコンをテキストエディタ等で開き、
下の方にあるユーザー名を変更して再起動すれば解決しました。

前にアプリのワークスペース毎コピーした際もこの プロジェクト名.xcodeproj を編集したなぁと思い出したので、備忘録として残しておきます。

ご参考になれば幸いです。

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?