App Store ConnectにアプリのビルドをアップロードしてからTestFlightで配信するまでの試行錯誤ログ

2023.02.23

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

こんにちは、CX事業本部 Delivery部の若槻です。

今回は、App Store Connectにアプリのビルドを初めてアップロードしようとした際に一筋縄では行かなかったので、試行錯誤のログを残しておきます。

試行錯誤

下記エントリで作成したアプリをTestFlightで配信するのが目的です。

ちなみに前回の下記エントリではアーカイブを作成するところまで出来ました。

ビルドをアップロードしたらIssueが検出された

こちらを参考にしながら証明書やProvisioning Profile周りの準備を行い、作成したアーカイブをXcodeからApp Store Connectにアップロードしようとしました。

するとXcode側でアップロードは成功したのですが、App Store Connet側でアプリのビルド一覧に表示されてこず、またApp Store Connectから下記のメールが届きました。

App Store Connect: Your app "wakatsuki-test" (Apple ID: XXXXXXXXXX Version: 1.0.0 Build: 2) has one or more issues

ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “Runner.app” bundle should contain a NSBluetoothPeripheralUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If your app supports multiple locales, you’re now required to provide a purpose string value in the Info.plist file in addition to a valid localized string across each of your app’s localization folders. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources.

ITMS-90078: Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the 'aps-environment' entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the 'aps-environment' entitlement. Xcode does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.

ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “Runner.app” bundle should contain a NSBluetoothAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If your app supports multiple locales, you’re now required to provide a purpose string value in the Info.plist file in addition to a valid localized string across each of your app’s localization folders. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources.

ITMS-90683およびITMS-90683は、Bluetooth通信を使用するアプリの場合に必要な記述がInfo.plistに必要とのこと。

ITMS-90078は、プッシュ通知を行うアプリの場合にPush Notificationsの権限がProvisioning profileで必要とのこと。

ITMS-90683およびITMS-90683の対処

Info.plistNSBluetoothAlwaysUsageDescriptionキーおよびNSBluetoothPeripheralUsageDescriptionキーを追加します。

ios/Runner/Info.plist

<dict>
	<key>NSBluetoothAlwaysUsageDescription</key>
	<string>flutter_nearby_connection</string>
	<key>NSBluetoothPeripheralUsageDescription</key>
	<string>BluetoothCommunicationWithOtherDevices</string>

ITMS-90078の対処

こちらを参考にXcode側で既存のProvisioning ProfileにPush Notificationsを追加しましたが、エラーとなってしまいます。

そもそもProvisioning ProfileにPush Notificationsの資格が無いようです。

Provisioning profile "WakatsukiTest AppStore Profile" doesn't support the Push Notifications capability.

Provisioning profile "WakatsukiTest AppStore Profile" doesn't include the aps-environment entitlement.

そこでこちらを参考に、App Store Connect側でProvisioning ProfileにPush Notifications機能の権限を付与。

Xcode側で再度ダウンロードしてみる。

しかし引き続きPush Notificationsの資格が無いとエラーになってしまいます。

そこでApp Store Connect側でProvisioning Profileを再作成。

Xcode側で新規作成したProvisioning Profileを選択します。するとPush Notifications機能を追加してもエラーが発生しなくなりました。

古いProvisioning Profileが使われてしまう

しかしアーカイブを実行すると引き続き同じエラーになります。古いProvisioning Profileがなぜかビルドに使われているようです。

Provisioning Profileの指定を[All]タブで行う必要がありました。これにより[Debug][Realease][Profile]すべてのタブで新しいProvisioning Profileが使われるようになり、アーカイブの実行も成功しました。

アップロードのエラー

無事アーカイブできたビルドをアップロードしようとするとエラーとなりました。

The provided entity includes a relationship with an invalid value

こちらは下記が参考になりました。

Infoで「Bundle version」および「Bundle version string (short)」をそれぞれ$(FLUTTER_BUILD_NUMBER)から0.0.1に修正。

アーカイブを作成し、再度アップロードを試みると、今度は成功しました。

少し待つとApp Store ConnectのiOS Buildsにビルドが表示されました。

TestFlightでアプリを配信してみる

さらに少し待つとビルドのステータスで[Manage]が設定できるようになったので開きます。

コンプライアンスの設定をします。

するとステータスがReady to Submitとなり配信可能状態となりました。

テスターユーザーでサインしたiPhoneでTestFlightアプリを導入し、一覧からアプリをインストールします。

TestFlightからアプリをインストールできました!

参考

以上