vicc / chameleon

Color framework for Swift & Objective-C (Gradient colors, hexcode support, colors from images & more).
Other
12.43k stars 1.31k forks source link

iTunes Connect rejects builds because NSPhotoLibraryUsageDescription is required #156

Open Burgestrand opened 8 years ago

Burgestrand commented 8 years ago

I added Chameleon to my project, which caused iTunes Connect to reject my builds because of a missing NSPhotoLibraryUsageDescription.

I was using Chameleon 2.2.0 for Swift through Cocoapods (via git because 2.2.0 is not released to Cocoapods).

pod 'ChameleonFramework/Swift',
  git: 'https://github.com/ViccAlexander/Chameleon.git',
  tag: '2.2.0'

I've run into a similar issue in the past, with PromiseKit. Here's a link to the relevant issue that was eventually fixed: https://github.com/PromiseKit/UIKit/issues/3. Unfortunately I haven't identified what part of Chameleon that is causing this, or if there's a satisfactory way to resolve this.

I was only beginning to use Chameleon mainly for the UIColor helpers (lighten, pre-defined colors), so as a local workaround I've merely removed Chameleon from my build and added my own color helpers.

Admin edit:

tl;dr: Add NSPhotoLibraryUsageDescription to your Info.plist with any string until a new version is released.

salConigliaro commented 8 years ago

That doesn't have to do with Chameleon. The NSPhotoLibraryUsageDescription key is now required for access to Photos.

See here for more info

bre7 commented 8 years ago

I don't see any import to Photos' lib. Are you sure it's because of Chameleon ? It's been confirmed that even importing a library will result in rejection if the appropriate key isn't specified in Info.plist (e.g: HealthKit, etc)

Burgestrand commented 8 years ago

I just did another isolated test to double-verify.

Yes, merely adding ChameleonFramework to Cocoapods causes builds to be rejected, with no other change.

I'll fork and then remove half of the files of Chameleon in different passes (binary search!) to see if I can find specifically which files are causing it. It takes roughly 10-15 minutes every time (because of iTunes Connect) so it won't be a quick search though.

diff --git a/Podfile b/Podfile
index 3031c64..58f830e 100644
--- a/Podfile
+++ b/Podfile
@@ -11,6 +11,10 @@ target 'Thingy' do
     pod 'PMKVObserver'
     pod 'KeychainAccess', '3.0.0'

+    pod 'ChameleonFramework/Swift',
+      git: 'https://github.com/ViccAlexander/Chameleon.git',
+      tag: '2.2.0'
+
     pod 'PromiseKit', '4.0.3', subspecs: [
         'Alamofire', 'Foundation'
     ]
diff --git a/Podfile.lock b/Podfile.lock
index 23a1b2b..eec41c4 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -6,6 +6,9 @@ PODS:
   - Bolts/AppLinks (1.8.4):
     - Bolts/Tasks
   - Bolts/Tasks (1.8.4)
+  - ChameleonFramework/Default (2.2.0)
+  - ChameleonFramework/Swift (2.2.0):
+    - ChameleonFramework/Default
   - FBSDKCoreKit (4.16.0):
     - Bolts (~> 1.7)
   - FBSDKLoginKit (4.16.1):
@@ -28,6 +31,7 @@ PODS:

 DEPENDENCIES:
   - Alamofire
+  - ChameleonFramework/Swift (from `https://github.com/ViccAlexander/Chameleon.git`, tag `2.2.0`)
   - FBSDKCoreKit
   - FBSDKLoginKit
   - FBSDKShareKit
@@ -36,9 +40,20 @@ DEPENDENCIES:
   - PromiseKit/Alamofire (= 4.0.3)
   - PromiseKit/Foundation (= 4.0.3)

+EXTERNAL SOURCES:
+  ChameleonFramework:
+    :git: https://github.com/ViccAlexander/Chameleon.git
+    :tag: 2.2.0
+
+CHECKOUT OPTIONS:
+  ChameleonFramework:
+    :git: https://github.com/ViccAlexander/Chameleon.git
+    :tag: 2.2.0
+
 SPEC CHECKSUMS:
   Alamofire: 7682d43245de14874acd142ec137b144aa1dd335
   Bolts: 8a7995239dbe724f9cba2248b766d48b7ebdd322
+  ChameleonFramework: 2761c9d962c783c3f142050fc5b9ca5dcad9a326
   FBSDKCoreKit: 7a6baaed4a2b2a244ba253346713bdbc74df135b
   FBSDKLoginKit: 469a56cebe2e1ed62b1621d0b155970fd6aac2d8
   FBSDKShareKit: 53af0239b5bd2ebf191f32f75991245a208cc982
@@ -46,6 +61,6 @@ SPEC CHECKSUMS:
   PMKVObserver: f3955b3beae9c6198ad347d4eb9b125477e9cb72
   PromiseKit: dfe8fcc6445674fb23378d89990838c1cbdbf05a

-PODFILE CHECKSUM: f96c673628a3328b0665128fa67ae99ee0dae40e
+PODFILE CHECKSUM: d8a88182c53f2c2476d10a33d9f163a95940efd4

 COCOAPODS: 1.1.1
Burgestrand commented 8 years ago

I found the culprit.

https://github.com/ViccAlexander/Chameleon/blob/2.2.0/Pod/Classes/Objective-C/Chameleon_.m#L330-L334

Similar to the case with PromiseKit, Chameleon is also doing changes to the Image Picker controller. Mentioning the UIImagePickerController is sufficient to cause this build rejection, even if it's not used anywhere.

I believe PromiseKit solved this by moving those particular modifications to a subspec. I guess proposed solution would be to do the same here, i.e. don't theme the image picker unless theming for it has been made available by including e.g. Chameleon/UIImagePicker or similar.

bre7 commented 8 years ago

Thanks ! We'll fix it asap

ecdfeaa2 commented 8 years ago

I wanted to send an app to iTunes Connect, and I received this mail from Apple :

Dear developer,

We have discovered one or more issues with your recent delivery for "**". To process your delivery, the following issues must be corrected:

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

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

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.

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

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

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

Once these issues have been corrected, you can then redeliver the corrected binary.

Regards,

The App Store team

and my app does not access to photo, microphone, bluetooth, calendars, contacts, ...

bre7 commented 8 years ago

If that's the message then either your app or some library you are using does access or import those frameworks.

KelvinJin commented 8 years ago

Any updates on this one? Same issue here.

kooliokey commented 7 years ago

I have an app that is getting an invalid binary message from iTunes Connect for the same reason. I'd prefer to not remove Chameleon, but I may have to :\

bre7 commented 7 years ago

PRs are welcome. There's already a proposed fix: https://github.com/ViccAlexander/Chameleon/issues/156#issuecomment-255527599

reednj commented 7 years ago

For anyone else looking at this issue: the following patch comments out the offending code to allow submission (assuming you're not using this functionality)

From 57572412a5e7959f783c9627a3cfedfad3c485f0 Mon Sep 17 00:00:00 2001
Date: Thu, 29 Jun 2017 15:29:01 +0800
Subject: [PATCH] fix itunes submission

---
 .../ChameleonFramework/Pod/Classes/Objective-C/Chameleon_.m | 13 +++++++------
 .../Pod/Classes/Objective-C/UIViewController+Chameleon.m    | 11 ++++++-----
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/Pods/ChameleonFramework/Pod/Classes/Objective-C/Chameleon_.m b/Pods/ChameleonFramework/Pod/Classes/Objective-C/Chameleon_.m
index 4aab5a2..3c8fcb8 100755
--- a/Pods/ChameleonFramework/Pod/Classes/Objective-C/Chameleon_.m
+++ b/Pods/ChameleonFramework/Pod/Classes/Objective-C/Chameleon_.m
@@ -345,12 +345,13 @@
         }
     }

-    //Workaround for Swift http://stackoverflow.com/a/28765193
-    [[UIButton appearanceWhenContainedWithin:@[[UIView class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
-    [[UIButton appearanceWhenContainedWithin:@[[UIView class],[UIImagePickerController class]]] setTintColor:ClearColor];
-    [[UIButton appearanceWhenContainedWithin:@[[UINavigationBar class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
-    [[UIButton appearanceWhenContainedWithin:@[[UINavigationBar class],[UIImagePickerController class]]] setTintColor:contentColor];
-    [[UIButton appearanceWhenContainedWithin:@[[UITableViewCell class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
+    // Workaround for Swift http://stackoverflow.com/a/28765193
+    // commented out to allow itunes submission without errors
+    //[[UIButton appearanceWhenContainedWithin:@[[UIView class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
+    //[[UIButton appearanceWhenContainedWithin:@[[UIView class],[UIImagePickerController class]]] setTintColor:ClearColor];
+    //[[UIButton appearanceWhenContainedWithin:@[[UINavigationBar class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
+    //[[UIButton appearanceWhenContainedWithin:@[[UINavigationBar class],[UIImagePickerController class]]] setTintColor:contentColor];
+    //[[UIButton appearanceWhenContainedWithin:@[[UITableViewCell class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];

     //[[UIButton appearanceWhenContainedInInstancesOfClasses:@[[UIView class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
     //[[UIButton appearanceWhenContainedInInstancesOfClasses:@[[UIView class],[UIImagePickerController class]]] setTintColor:contentColor];
diff --git a/Pods/ChameleonFramework/Pod/Classes/Objective-C/UIViewController+Chameleon.m b/Pods/ChameleonFramework/Pod/Classes/Objective-C/UIViewController+Chameleon.m
index b6b4691..848e6a7 100755
--- a/Pods/ChameleonFramework/Pod/Classes/Objective-C/UIViewController+Chameleon.m
+++ b/Pods/ChameleonFramework/Pod/Classes/Objective-C/UIViewController+Chameleon.m
@@ -439,11 +439,12 @@
     }

     //Workaround for Swift http://stackoverflow.com/a/28765193
-    [[UIButton appearanceWhenContainedWithin:@[[UIView class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
-    [[UIButton appearanceWhenContainedWithin:@[[UIView class],[UIImagePickerController class]]] setTintColor:ClearColor];
-    [[UIButton appearanceWhenContainedWithin:@[[UINavigationBar class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
-    [[UIButton appearanceWhenContainedWithin:@[[UINavigationBar class],[UIImagePickerController class]]] setTintColor:contentColor];
-    [[UIButton appearanceWhenContainedWithin:@[[UITableViewCell class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
+    // commented out to allow itunes submission without errors
+    //[[UIButton appearanceWhenContainedWithin:@[[UIView class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
+    //[[UIButton appearanceWhenContainedWithin:@[[UIView class],[UIImagePickerController class]]] setTintColor:ClearColor];
+    //[[UIButton appearanceWhenContainedWithin:@[[UINavigationBar class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
+    //[[UIButton appearanceWhenContainedWithin:@[[UINavigationBar class],[UIImagePickerController class]]] setTintColor:contentColor];
+    //[[UIButton appearanceWhenContainedWithin:@[[UITableViewCell class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];

     //[[UIButton appearanceWhenContainedInInstancesOfClasses:@[[UIView class],[UIImagePickerController class]]] setBackgroundColor:ClearColor];
     //[[UIButton appearanceWhenContainedInInstancesOfClasses:@[[UIView class],[UIImagePickerController class]]] setTintColor:contentColor];
-- 
2.8.1
ivnsch commented 6 years ago

Any updates...? My app is being rejected because of this. It was reported almost 2 years ago. This is critical.

wolfcon commented 6 years ago

@i-schuetz @Burgestrand hey. guys. just add NSPhotoLibraryUsageDescription to your info.plist. You could work this out.

If you are not call ImagePicker, system won't pop that alert. (NSPhotoLibraryUsageDescription)