iOS 10/XCode 8 的运行时问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39491675/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:14:29  来源:igfitidea点击:

Runtime issues with iOS 10/XCode 8

xcodeios-simulatorios10xcode8

提问by Deepak Sharma

Since I built and started running app on iOS 10 simulator, I started getting logs such as :

自从我在 iOS 10 模拟器上构建并开始运行应用程序以来,我开始获取日志,例如:

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

2016-09-14 17:18:55.812525 MyApp[6880:340725] bundleid: com.MyApps.MyApp, enable_level: 0, persist_level: 0, propagate_with_activity: 0

2016-09-14 17:18:55.813154 MyApp[6880:340725] subsystem: com.apple.siri, category: Intents, enable_level: 1, persist_level: 1, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0
2016-09-14 17:18:55.842900 MyApp[6880:340837] subsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2016-09-14 17:18:55.843428 MyApp[6880:340837] subsystem: com.apple.UIKit, category: HIDEventIncoming, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2016-09-14 17:18:55.855848 MyApp[6880:340836] subsystem: com.apple.BaseBoard, category: MachPort, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0
2016-09-14 17:18:55.870530 MyApp[6880:340725] subsystem: com.apple.UIKit, category: StatusBar, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0

Wonder how I fix them ? I never saw these on XCode 7.

想知道我是如何修复它们的吗?我从未在 XCode 7 上看到过这些。

采纳答案by Adrien Yvon

I have the same issue, but there is something you can do to,

我有同样的问题,但你可以做些什么,

1) Go in Product -> Scheme -> Edit Scheme
2) Run Section on the left, select Argument Tab and in Environment Variable put this.

1) 进入 Product -> Scheme -> Edit Scheme
2) 运行左侧的部分,选择 Argument Tab 并在 Environment Variable 中输入它。

OS_ACTIVITY_MODE to value : disable.

OS_ACTIVITY_MODE 到值:禁用。

For more information please find the below screenshot.

有关更多信息,请查看以下屏幕截图。

enter image description here

在此处输入图片说明

This will get rid of messages in the console.

这将消除控制台中的消息。

But I still struggle with the PLBuildVersionis implemented in both....

但我仍然在努力解决PLBuildVersion在两者中实施的问题......

I hope this helps you !

我希望这可以帮助你 !

*** EDIT ****
I found that the issue was caused by Facebook SDK. I removed the framework from CocoaPods, installed it manually by copying the SDK in my project folder and I have no errors now.

*** 编辑 ****
我发现问题是由Facebook SDK. 我从 中删除了框架CocoaPods,通过在我的项目文件夹中复制 SDK 手动安装它,现在我没有错误。

回答by Deep Parekh

check if your func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions:) in AppDelegate.swift is declared private, if yes, then remove the private keyword. It should work after that.

检查 AppDelegate.swift 中的 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions:) 是否声明为私有,如果是,则删除 private 关键字。在那之后它应该可以工作。