Xcode 9.0.1 及更高版本的 100 多个“在 MapKit 和 VectorKit 中实现的类”警告
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46852386/
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
100+ "Class implemented in both MapKit and VectorKit" warnings with Xcode 9.0.1 and above
提问by Tamás Sengel
While running my project (which doesn't even use MapKit
), my console gets spammed with more than a hundred class duplicate warnings:
在运行我的项目(甚至不使用MapKit
)时,我的控制台收到了一百多个类重复警告的垃圾邮件:
objc[6377]: Class ___MKPlaceBusinessInfoItemAccessibility_super is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/MapKit.axbundle/MapKit (0x12f128f00) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/VectorKit.axbundle/VectorKit (0x12f2187b0). One of the two will be used. Which one is undefined.
objc[6377]:类 ___MKPlaceBusinessInfoItemAccessibility_super 在 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/ 中实现Library/AccessibilityBundles/MapKit.axbundle/MapKit (0x12f128f00) 和 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/ System/Library/AccessibilityBundles/VectorKit.axbundle/VectorKit (0x12f2187b0)。将使用两者之一。哪个是不确定的。
These warnings were not presentwith Xcode 9.0.0, I am only experiencing this on Xcode 9.0.1 and above.
这些警告是不存在与Xcode的9.0.0,我只是在遇到此的Xcode 9.0.1及以上。
I am aware that this is a bugand I found a radarthat is about this issue. Is there a way to silence these warnings without affecting the visibility of other SDK warnings?
采纳答案by ChrisCM
This is actually a bug in the current iOS Framework and has nothing to do with anything in your app, module cache, libraries, etc. The reason this appears to be non deterministic is that it is only there when the Accessibility Layer is active, which it isn't on the simulator, except under very specific circumstances. The three I'm aware of:
这实际上是当前 iOS 框架中的一个错误,与您的应用程序、模块缓存、库等中的任何内容无关。这似乎是不确定的原因是它仅在可访问层处于活动状态时才存在,即它不在模拟器上,除非在非常特殊的情况下。我所知道的三个:
- The Accessibility Inspector is on
- UI Instrumented Testing
- VoiceOver for OSX is On (other ATs as well)
- 辅助功能检查器已开启
- UI 插桩测试
- OSX 的 VoiceOver 已开启(其他 AT 也是如此)
To get this to go away you should:
要消除这种情况,您应该:
- Exit Accessibility Inspector (if it's on)
- Open Simulator
- Hardware -> "Erase All Content and Settings"
- Re run application.
- Literally NEVER run this simulator with the Accessibility Inspector
- Literally NEVER run UI tests on this simulator, which also rely on the Accessibility Layer to do their work, though I don't think doing so will cause the error to stick around until you "Erase all...." again, it will just be present for that test run.
- 退出辅助功能检查器(如果打开)
- 打开模拟器
- 硬件 ->“擦除所有内容和设置”
- 重新运行应用程序。
- 从字面上看,永远不要使用辅助功能检查器运行此模拟器
- 从字面上看,永远不要在这个模拟器上运行 UI 测试,它也依赖于辅助功能层来完成他们的工作,尽管我不认为这样做会导致错误持续存在,直到你再次“擦除所有......”,它会只是出现在那个测试运行中。
Every time you do one of those last two bullet points, you will have to clear the data again...
每次执行最后两个要点之一时,您都必须再次清除数据......
The core issue is that MapKit and VectorKit both link to core accessibility bundles, but apparently have not done so dynamically, so those bundles are included in both modules. Such warnings are very safely ignored, though very verbose and frustrating.
核心问题是 MapKit 和 VectorKit 都链接到核心可访问性包,但显然没有这样做,所以这些包都包含在两个模块中。尽管非常冗长且令人沮丧,但可以非常安全地忽略此类警告。
Unfortunately there is no other fix for this... maybe you could download an old version of the simulator if you don't need iOS 11 features. Or just don't run instrumented tests/Accessibility Inspector/VoiceOver/I HOPE THEY FIX THIS SOON!
不幸的是,没有其他解决方案……如果您不需要 iOS 11 功能,也许您可以下载旧版本的模拟器。或者只是不运行仪器测试/辅助功能检查器/VoiceOver/我希望他们尽快修复!
回答by Ilya Krigouzov
Got the same issue on 9.0.1.
在 9.0.1 上遇到了同样的问题。
- You should quit Xcode and all Simulators.
- Run
rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache
. - Start Xcode again.
- 您应该退出 Xcode 和所有模拟器。
- 运行
rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache
。 - 再次启动Xcode。
This issue was solved for me.
这个问题为我解决了。
回答by Nuthatch
I don't give a damn about accessibility in the simulator so I just renamed one of the duplicate files so it wouldn't be found:
我不在乎模拟器中的可访问性,所以我只是重命名了一个重复文件,这样就找不到它了:
mv /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/MapKit.axbundle/MapKit /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/MapKit.axbundle/MapKit_
lol
哈哈
回答by Denis Kilin
Resetting the iOS simulator fixed this for me. Simulator -> Hardware -> Erase All Content and Settings...
重置 iOS 模拟器为我解决了这个问题。模拟器 -> 硬件 -> 擦除所有内容和设置...
回答by ke jin
Exactly the same problem, in my case, I tried to delete all the files in DerivedData folder, but still not work.
完全相同的问题,就我而言,我尝试删除 DerivedData 文件夹中的所有文件,但仍然无法正常工作。
And later I found that if I switch to another kind of simulator, for instance, switch from 'iPhone 8' to 'iPhone 8 plus', the warning would disappear.
后来我发现如果我切换到另一种模拟器,例如从“iPhone 8”切换到“iPhone 8 plus”,警告就会消失。
So, simply delete the 'iPhone 8' simulator from simulator list, and then add the 'iPhone 8' simulator again, it works.
因此,只需从模拟器列表中删除“iPhone 8”模拟器,然后再次添加“iPhone 8”模拟器,它就可以工作了。
Not sure if the problem will come again, since it's also my third time dealing with this.
不确定问题是否会再次出现,因为这也是我第三次处理这个问题。
回答by DawnSong
As you can see, there's something wrong with CoreSimulator
of /Applications/Xcode.app
. Apple Xcode Developer defined this symbol in both MapKit
and VectorKit
, which is the fundamental error.
如您所见,CoreSimulator
of有问题/Applications/Xcode.app
。Apple Xcode Developer 在MapKit
和中都定义了这个符号VectorKit
,这是根本性的错误。
You cannot modify Xcode, so only Apple's Staff can solve it.
您无法修改 Xcode,因此只有 Apple 的员工才能解决。
Just stop wasting your time, except falling back to Xcode 9.0
只要停止浪费你的时间,但回落至9.0的Xcode
回答by Lumi
My case is a bit different: I met this issue while running XCUITest. After launching the XCUITest process, the target app crashes upon launch. However, after I removed all the Web proxies, this issue is fixed!
我的情况有点不同:我在运行 XCUITest 时遇到了这个问题。启动 XCUITest 进程后,目标应用程序在启动时崩溃。但是,在我删除所有 Web 代理后,此问题已解决!
回答by Miguel Esteves
Solved!
解决了!
-On simulator --Hardware ----Erase all content and settings -Close xcode and simulators -remove the content of ~/Library/Developer/Xcode/DerivedData/ModuleCache -Start xcode...
-在模拟器上 --Hardware ----擦除所有内容和设置 -关闭 xcode 和模拟器 -删除 ~/Library/Developer/Xcode/DerivedData/ModuleCache 的内容 -启动 xcode...