Class PLBuildVersion is implemented in both frameworks(stackoverflow的 快照)

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

share improve this question
 
1 
Are you using Fabric or other Twitter 3rd library in your project? –  Kevin  Sep 19 '16 at 8:53
 
I have the same error in the release version and yes, i'm using Fabric in my project. @noellee –  Zac  Sep 19 '16 at 9:32
 
Have the same problem, not using Twitter or Fabric. Interestingly, when I search for PLBuildVersion in the project (Find>Text>Containing) I get no result! No file, no import, no comment, nothing! –  turingtested  Sep 25 '16 at 14:25 
 
The warning disappeared after I commented this PHAsset.fetchAssetsWithALAssetURLs out. I guess the bug is on Apple's side. –  0101  Sep 26 '16 at 11:43
2 
Im not using twitter. maybe Firebase can cause this too? –  Yitschak  Sep 26 '16 at 18:53
1 
@noellee like Zac I am using fabric in my project and I also have the same error –  user1019042  Sep 27 '16 at 20:29
1 
@Yitschak i use firebase and got this too. –  n3wbie  Sep 28 '16 at 16:31
 
@user1019042 , yes me too, same issue here. –  Kevin  Oct 1 '16 at 15:11
1 
yes, I'm using Fabric and Crashlytics (v3.8.2) –  FlatDog  Oct 2 '16 at 22:34 

6 Answers

up vote 85 down vote
+100

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.

share improve this answer
 
 
Any update on Radar? –  Kevin  Oct 16 '16 at 9:01
 
@Kevin not yet. –  Roman Ermolov  Oct 17 '16 at 11:12
5 
My App is crashing at this Point, Please Help !!! –  Anand  Oct 21 '16 at 11:14
3 
Still an issue for me in Xcode 8.1 –  Clifton Labrum  Nov 2 '16 at 21:09
 
Same problem here with xCode 8,1 –  Loc Pham  Nov 5 '16 at 4:37
2 
the warning message are still there. –  Faiz Fareed  Nov 7 '16 at 19:40 
5 
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. –  David.Chu.ca  Nov 9 '16 at 22:19 
 
Just got this issue with Xcode 8.1, was working yesterday before update :/ –  mortond  Nov 17 '16 at 0:09
 
So is that a bug about linker? –  Itachi  Nov 22 '16 at 3:29
 
Still an issue in Xcode 8.2. Only when the webview is used. –  Andr3s4n  Jan 3 at 13:46
3 
Any updates on this issue? It's been months already... –  user805981  Jan 5 at 18:53

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

share improve this answer
 
 
This fixed it for me –  TerryS  Sep 30 '16 at 11:54
21 
The warning messages are still there. –  Kevin  Oct 1 '16 at 15:13
2 
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.. –  FlatDog  Oct 2 '16 at 22:36 
 
Warning is not gone but app is working now –  wm.p1us  Oct 4 '16 at 4:23
 
For me it also fixed it. Thank you very much :-) –  user1895268  Oct 16 '16 at 14:51
 
Added this But still App is crashing –  Anand  Oct 21 '16 at 11:51
3 
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  Oct 24 '16 at 17:39
2 
@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 –  mortond  Nov 17 '16 at 0:11 
 
I've got this warning after setting textView.attributedText to NSAttributedString –  mik.ro  Dec 16 '16 at 11:45
 
It does not work for me. Still keep crashing. –  Michael Yang  Dec 28 '16 at 1:02
 
is it safe to ignore this warning? –  Cmag  Jan 11 at 2:36

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.

share improve this answer
 

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

share improve this answer
 
 
I tried WKWebView but the warning is still appearing –  muz the axe  Dec 15 '16 at 4:11 

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)

share improve this answer
 
 
Did not work for me. –  Mikrasya  Mar 6 at 7:12
 
warning is still there BUT app is not crashing anymore.I am using xcode8.2.1 –  Dashrath  2 days ago 

For iOS 10 you have to add these key's and value into you info.plist to avoid this issue.

<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) photo use</string>

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) camera use</string>
share improve this answer
 
 
Your answer didn't solve the problem. –  ayteq  Dec 29 '16 at 16:20

protected by iwasrobbed Sep 20 '16 at 18:19

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count). 

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged    or ask your own question.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值