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?

iOS の Widget で "embedded binary’s bundle identifier is not prefixed with the parent app’s bundle identifier." エラー

Posted at

昔作った iOS Widget アプリを久しぶりにメンテしようと思ったら、エラーが出て困りました。
エラーの内容は以下。

embedded binary’s bundle identifier is not prefixed with the parent app’s bundle identifier.

問題自体は単純でしたが、解決に少し時間を食ってしまったので、備忘録として残しておきます。

原因

調べるとすぐ出てきますが、 Widget ターゲットの Bundle ID は、 App ターゲットの Bundle ID で始まる必要があります。

例えば、App の Bundle ID が com.example.ios.app ならば、 Widget の Bundle ID は com.example.ios.app.MyWidget のようにするということです。

チェックポイント①

Xcode のプロジェクト情報で、各ターゲットの General > Identity > Bundle Identifier を確認します。
ここが先述の形式を守っていない場合は、修正しましょう。

チェックポイント②

Info.plist を開き、 Bundle Identifer (CFBundleIdentifier) の値が正しくセットされているか確認します。
通常は $(PRODUCT_BUNDLE_IDENTIFIER) のような値が入っているのが正しいかと思います。

終わりに

①をいくら確認しても正しい形式で、「なんでや〜」となっていたのですが、 Info.plist を見たら情報が少なく違和感を覚え、試しに値を入れてみたら動きました。
何かの拍子に消してしまったのかもしれません。
Info.plist がどんな情報を扱っているのか把握しておくのは大切ですね。

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?