226
votes

iOS 10 / Xcode 8 GM build getting the below, never had it before on Xcode 7. Any ideas?

objc[25161]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x12049a910) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x1202c4210). One of the two will be used. Which one is undefined.

(NOTE: Only seems to happen in simulator, does not appear on real device).

7
Are you using Fabric or other Twitter 3rd library in your project?Kevin
Im not using twitter. maybe Firebase can cause this too?Yitzchak
@noellee like Zac I am using fabric in my project and I also have the same erroruser1019042
@Yitschak i use firebase and got this too.n3wbie
yes, I'm using Fabric and Crashlytics (v3.8.2)FlatDog

7 Answers

145
votes

Main Idea

Main idea is simple:

If your app (or dependencies, such as Pods) uses framework, that uses explicit (or implicit) PhotoLibraryServices.framework or AssetsLibraryServices.framework as dependency, Xcode warns you (even if you are using only one of them). It might be Photos/PhotosUI.framework or AssetsLibrary.framework, or another (I don't have full list of dependencies, but it is possible).

What is the problem?

Class with name PLBuildVersion is defined in both PhotoLibraryServices.framework and AssetsLibraryServices.framework. Class name is unique in Objective-C (you can't define 2 classes with same name), so it is undefined which one will be used in runtime.

However, I think that it will not be a problem, because both classes have same methods and fields (checked this with disassembler) and I guess that both were compiled from the same source.

Radar is already sent.

53
votes

As per answer from Apple employee on Apple's Developer Forum:

You don't control either of the class sources listed, so there isn't anything you can or should do – aside from Reporting a Bug.

46
votes

I was unable to find a way to get rid of the warning, but if you want to prevent the app from crashing, you need to provide a description for why you are accessing the camera, photo library, etc. This is new in iOS10.

Input the following into your Info.plist file.

Photo

Key: Privacy - Photo Library Usage Description Value: $(PRODUCT_NAME) photo use

Camera

Key: Privacy - Camera Usage Description Value: $(PRODUCT_NAME) camera use

More info can be found here: https://iosdevcenters.blogspot.com/2016/09/infoplist-privacy-settings-in-ios-10.html

12
votes

I find you can get this error merely by using a UIWebView. My solution was to replace my use of UIWebView with WKWebView.

5
votes

I had this after adding Answers on Fabric to my project.

Deleting derived data did the trick for me. (shift alt command k in XCode)

Edit a year later:

After deleting derived data, always exit XCode and start it again.

In unrelated cases I have the impression that deleting derived data does not clear XCode’s in memory caches of the derived data.

2
votes

Resetting the iOS simulator fixed this for me. Simulator -> Reset Content And Settings.

0
votes

In my case this warning started to appear after opening a second xcode project and running the second app on the simulator. After changing back to the first app, the warning started to appear. I just quit the Simulator and Xcode and reopened my project. The warning disappeared after that. If that doesn't solve it, proceed with the other answers. Xcode can be really picky sometimes.