Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class PLBuildVersion is implemented in both frameworks

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.


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.


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


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


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.


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