xcode PLBuildVersion 类在两个框架中都实现了
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39520499/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Class PLBuildVersion is implemented in both frameworks
提问by FlatDog
iOS 10 / Xcode 8 GM build getting the below, never had it before on Xcode 7. Any ideas?
iOS 10 / Xcode 8 GM 版本获得以下内容,之前从未在 Xcode 7 上使用过。有任何想法吗?
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.
objc[25161]:类 PLBuildVersion 在 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x91204)和 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x1202c4210)。将使用两者之一。哪个是不确定的。
(NOTE: Only seems to happen in simulator, does not appear on real device).
(注意:似乎只发生在模拟器中,不会出现在真实设备上)。
回答by Roman Ermolov
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).
如果您的应用程序(或依赖项,例如 Pods)使用使用显式(或隐式)PhotoLibraryServices.framework
或AssetsLibraryServices.framework
作为依赖项的框架,Xcode 会警告您(即使您只使用其中之一)。它可能是Photos/PhotosUI.framework
或AssetsLibrary.framework
,或另一个(我没有完整的依赖项列表,但有可能)。
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.
具有名称的类PLBuildVersion
在PhotoLibraryServices.framework
和 中定义AssetsLibraryServices.framework
。类名在 Objective-C 中是唯一的(你不能定义 2 个同名的类),因此未定义在运行时使用哪一个。
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.
但是,我认为这不会有问题,因为两个类都有相同的方法和字段(用反汇编器检查过),而且我猜它们都是从同一个源编译的。
Radaris already sent.
雷达已经发送。
回答by Raphael Oliveira
As per answer from Apple employee on Apple's Developer Forum:
根据Apple 开发者论坛上Apple员工的回答:
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.
您无法控制列出的任何一个类源,因此除了报告错误之外,您没有任何可以或应该做的事情。
回答by 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.
我无法找到摆脱警告的方法,但是如果您想防止应用程序崩溃,您需要提供访问相机、照片库等的原因的描述。这是 iOS10 中的新功能。
Input the following into your Info.plist
file.
将以下内容输入到您的Info.plist
文件中。
Photo
照片
Key: Privacy - Photo Library Usage Description
Value: $(PRODUCT_NAME) photo use
键: Privacy - Photo Library Usage Description
值: $(PRODUCT_NAME) photo use
Camera
相机
Key: Privacy - Camera Usage Description
Value: $(PRODUCT_NAME) camera use
键: Privacy - Camera Usage Description
值: $(PRODUCT_NAME) camera use
More info can be found here: https://iosdevcenters.blogspot.com/2016/09/infoplist-privacy-settings-in-ios-10.html
更多信息可以在这里找到:https: //iosdevcenters.blogspot.com/2016/09/infoplist-privacy-settings-in-ios-10.html
回答by matt
I find you can get this error merely by using a UIWebView. My solution was to replace my use of UIWebView with WKWebView.
我发现仅通过使用 UIWebView 就可以得到这个错误。我的解决方案是用 WKWebView 替换我对 UIWebView 的使用。
回答by Gerd Castan
I had this after adding Answers on Fabric to my project.
在将 Fabric 上的答案添加到我的项目后,我有了这个。
Deleting derived data did the trick for me. (shift alt command k in XCode)
删除派生数据对我来说很有效。(在 XCode 中移动 alt 命令 k)
Edit a year later:
一年后编辑:
After deleting derived data, always exit XCode and start it again.
删除派生数据后,始终退出 XCode 并重新启动。
In unrelated cases I have the impression that deleting derived data does not clear XCode's in memory caches of the derived data.
在不相关的情况下,我的印象是删除派生数据不会清除派生数据的内存缓存中的 XCode。
回答by Eric Mentele
Resetting the iOS simulator fixed this for me. Simulator -> Reset Content And Settings.
重置 iOS 模拟器为我解决了这个问题。模拟器 -> 重置内容和设置。
回答by 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.
就我而言,在打开第二个 xcode 项目并在模拟器上运行第二个应用程序后,此警告开始出现。改回第一个应用程序后,警告开始出现。我只是退出了模拟器和 Xcode 并重新打开了我的项目。之后警告就消失了。如果这不能解决问题,请继续其他答案。Xcode 有时真的很挑剔。