2017-01-13 7 views
10

私はコード・アプリケーションの開発にVisual Studioを使用しています。Visual Studio Cordova情報が不足しています.plistキー

Xcode8でストアにアプリケーションをアップロードすると、次のエラーメールが表示されます。

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

他のstackoverflowの質問に基づいてI'veは、プラグインhttps://github.com/leecrossley/cordova-plugin-transport-securityを追加し、plugin.xmlの修正:私のconfig.xmlに

<platform name="ios"> <config-file target="*-Info.plist" parent="NSAppTransportSecurity"> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSPhotoLibraryUsageDescription</key> <string>This app requires access to the photo library.</string> <key>NSMicrophoneUsageDescription</key> <string>This app does not require access to the microphone.</string> <key>NSCameraUsageDescription</key> <string>This app requires access to the camera.</string> </dict> </config-file> </platform>

<plugin name="cordova-plugin-transport-security" version="0.1.2" src="C:\Users\xxx\cordova-plugin-transport-security-master\cordova-plugin-transport-security-master" />

その後、私はiO用のアプリケーションをビルドしますxcodeでアップロードしました。

しかし、まだエラーはあります。

+0

リンクに投稿した回答を確認してください - http://stackoverflow.com/questions/41525725/phonegap-missing-plist-key類似の問題のように見えます – Gandhi

答えて

5

この変更では、NSPhotoLibraryUsageDescriptionと他のUsageDescriptionsをNSAppTransportSecurityに書き込んでいますが、これはルートにある必要があります。

あなたはコルドバ・プラグイン・メディア・キャプチャーの最新バージョンを使用する場合、それはすでにそれはあなたがCLIからプラグインをインストール変数ホエーから選んだので、値が$CAMERA_USAGE_DESCRIPTIONあるneeded values

 <preference name="CAMERA_USAGE_DESCRIPTION" default=" " /> 
     <config-file target="*-Info.plist" parent="NSCameraUsageDescription"> 
      <string>$CAMERA_USAGE_DESCRIPTION</string> 
     </config-file> 

     <preference name="MICROPHONE_USAGE_DESCRIPTION" default=" " /> 
     <config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription"> 
      <string>$MICROPHONE_USAGE_DESCRIPTION</string> 
     </config-file> 

     <preference name="PHOTOLIBRARY_USAGE_DESCRIPTION" default=" " /> 
     <config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription"> 
      <string>$PHOTOLIBRARY_USAGE_DESCRIPTION</string> 
     </config-file> 

を持っています。 Visual Studioを使用する場合、config.xmlの変数タグを使用して値を設定できると思います。 変数タグは、それらを使用するプラグイン内にある必要があります:

<plugin name="cordova-plugin-media-capture" spec="~1.4.1"> 
     <variable name="CAMERA_USAGE_DESCRIPTION" value="your camera usage message" /> 
     <variable name="MICROPHONE_USAGE_DESCRIPTION" value="your microphone usage message" /> 
     <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="your photolibrary usage message" /> 
    </plugin> 

問題が解決しない場合は、あなたが変更されたプラグインを使用し続けますが、以前のコードのように別々のconfig-fileタグとして各UsageDescriptionを追加することができます。

+0

ありがとうございます。最初は、可変タグを ''タグ内のconfig.xmlに直接追加してみました。それはうまくいきません。私は別の階層に変数タグを配置する必要がありますか?その後、 'plugin.xml'の変数を文字列に置き換えました。今それは動作します。 :) –

+0

@ alexander-fire私は答えを編集し、変数タグはそれを使用するプラグインの中に入ります。私の答えがあなたを助けたら、答えを受け入れることができます – jcesarmobile

関連する問題