カテゴリー : Xcode

[Xcode 10] Multiple commands produce エラーの解決方法

Xcode 10 で Multiple commands produce エラーが発生したときの解決方法をご紹介します。

続きを読む

[Xcode5][CocoaPods] Apple Match-O Linker Error : ld: library not found for -lPods

Xcode5にアップデートすると、今まで通っていたビルドが失敗するようになりました。

エラーメッセージ その1

xcode5-cocoapods-error1

Apple Match-O Linker Error
Linker command failed with exit code 1 (use -v to see invocation)

エラーメッセージ その2

xcode5-cocoapods-error2

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 
Library not found for -lPods
Linker command failed with exit code 1 (use -v to see invocation)

気になるWarningメッセージ

Pods was rejected as an implicit dependency for 'libPods.a' because its architectures 'armv7 armv7s' didn't contain all required architectures 'armv7 armv7s arm64'

CocoaPodsのアップデートで解決

cocoapods をアップデートします。

gem update cocoapods

アップデート後、改めて pod install します。

pod install

再度、ビルドすると正常にビルド完了しました。


参考情報

Objective-C – CocoapodsとXcode5の組み合わせでエラー出た+解決した – Qiita [キータ]

[iOS][Xcode] ビルドエラー「While reading … pngcrush caught libpng error」の解決方法

iOSアプリのビルドエラー「While reading … pngcrush caught libpng error」の解決方法をメモ。

CopyPNGFile エラーメッセージ

Command  emitted errors but did not return a nonzero exit code to indicate failure

CopyPNGFile エラーの解決方法

Project Target -> Build Phases -> Copy Bundle Resources にて、エラーが発生している画像ファイル名が重複して登録されている場合、片方だけ削除します。

Xcode-Copy_Bundle_Resources

以上です。


参考情報

ビルドエラー「While reading … pngcrush caught libpng error」への対処方法 – 甘いものが好きです

iphone – Not a PNG filCommand copypng emitted errors but did not return a nonzero exit code to indicate failure – Stack Overflow

[iOS] ビルドエラー(CopyPNGFile Error…)の対処法: ものづくりログ

[Xcode] C++11 Standard Library : libc++ (LLVM C++ standard library with C++11 support)

iOSアプリ開発で、QRコード用のライブラリ「ZXing」を使う場合にそのままではビルドが通りませんでした。

ビルド時に LLVM C++ を利用する必要があるそうで、その設定をメモ。


LLVM C++ の利用手順

Podsプロジェクトにて、Pods-ZXingを選択した状態で、

  • Build Settings
    • Apple LLVM 5.0 – Language – C++
      • C++ Standard Library

の項目を、Compiler Default から libc++(LLVM C++ standard library with C++ 11 support)に変更すればOKです。

Xcode-LLVM-Cpp


参考情報

XCodeでC++11を使う方法 – 亀岡的プログラマ日記

[Xcode] Archive が選択できない問題の解決方法

Xcode4 で Archive が選択できない問題が発生しました。

解決方法は [Scheme] を [iOS Device] など実機の項目に選択するだけです。

これで、[Product] > [Archive] が選択できるようになります。

[参考]

Xcode4でArchiveが選択できない | 6oolab

[Xcode][iOS] error: PCH file built from a different branch ((clang-425.0.27)) than the compiler ((clang-425.0.28))

iOS アプリ開発にて、Xcode のバージョンアップ後に下記のようなエラーが発生しました。

エラーメッセージ

error: PCH file built from a different branch ((clang-425.0.27)) than the compiler ((clang-425.0.28))

Clean 後、再 Build すればOKです。

[参考]

エラー:PCH file built from a different branch – アプリ開発のメモ帳

[Xcode] fatal error: file ‘xxx’ has been modified since the precompiled header was built 1 error generated.

iOS アプリ開発で、外部SDK opencv2.framework のファイル一式を入れ替えた後に、ビルドしたらエラーが発生しました。

続きを読む

[Xcode] Copyright表記をプロジェクト毎に設定する方法

Xcode で、Copyright表記をプロジェクト毎に設定する方法をメモ。

Xcode4でファイルヘッダのCopyright表記をプロジェクトごとに設定する方法 – やらなイカ?

[iOS] xcode cannot run using the selected device – No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination.

Xcode でアプリを iPhone へ実機転送しようとしたらエラーが発生して、転送できませんでした。

■ エラー内容

Xcode cannot run using the selected device.

No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination.

■ 解決方法

  1. Organize を開く
  2. 左メニューの実機転送したい端末(iPhoneなど)をクリック
  3. 「Use for Development」ボタンをクリック

[参考]

ブランク復帰エンジニアの開発メモ No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination.

[Xcode] iOSシミュレータは、SDKを見つけられませんでした。

Xcode で下記のようなエラーが発生する場合、プロジェクトのビルド設定で過去のバージョンの Simulator で起動していないか確認しましょう。

iOSシミュレータは、SDKを見つけられませんでした。SDKを見つけられませんでした。SDKの再インストールが必要である可能性があります。

僕の場合は「iPhone 6.0 Simulator」で起動しなければならないところを、「iPhone 5.0 Simulator」で起動していたのが原因でした。

以上です。

【参考】Xcode4 – src’s wiki はてなブックマーク - Xcode4 - src's wiki