ChatGPT解决这个技术问题 Extra ChatGPT

Class PLBuildVersion is implemented in both frameworks

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).

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

C
Community

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.


the warning message are still there.
I found that if I use Webview in one VC, I got this type of warning message in debug window when the VC is shown. I use Xcode 8.1, swift 3.
i m using xcode 8.2 and i have no any photolibary use in my project and i still get this warning.
Is it me only or the viewcontroller presentation becomes slow, which is being presented and has this warning message???
I am also getting this warning when I set .attributedText. I am not accessing camera or photos. This warning also causes serious lag for the View Controller to load, even though there are no time intensive tasks involved (no network access, no file i/o, etc.).
R
Raphael Oliveira

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 guess that is that.
Even if it is not a problem, it still generates the annoying and distracting output, this screams "bug" ...
N
Nick Meehan

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


The warning messages are still there.
my app doesn't use the camera at all and I get the message. Still, I tried adding these to plist as you suggested and that still didn't solve it..
Anybody figure this out? I am not using photo library nor am i using camera, however I still get the warning and the crash
@MikeG I am also not using either library and still getting the crash, I got rid of the warnings by adding the key/string config details to the info.plist file. Apparently its needed in IOS 10.x
I've got this warning after setting textView.attributedText to NSAttributedString
m
matt

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


I tried WKWebView but the warning is still appearing
G
Gerd Castan

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.


warning is still there BUT app is not crashing anymore.I am using xcode8.2.1
E
Eric Mentele

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


Just got to the same conclusion and it worked for me too.
A
Alexander Luna

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.


关注公众号,不定期副业成功案例分享
Follow WeChat

Success story sharing

Want to stay one step ahead of the latest teleworks?

Subscribe Now