46

While running my project (which doesn't even use MapKit), my console gets spammed with more than a hundred class duplicate warnings:

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.

These warnings were not present with Xcode 9.0.0, I am only experiencing this on Xcode 9.0.1 and above.

I am aware that this is a bug and I found a radar that is about this issue. Is there a way to silence these warnings without affecting the visibility of other SDK warnings?

Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223

8 Answers8

28

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:

  • The Accessibility Inspector is on
  • UI Instrumented Testing
  • VoiceOver for OSX is On (other ATs as well)

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.

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.

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!

MobA11y
  • 18,425
  • 3
  • 49
  • 76
  • The only reasonable answer. People who cannot modify Xcode could not solve the problem. – DawnSong Nov 02 '17 at 13:50
  • **Erase All Content and Settings** in Simulator worked for me. I didn't have Accessibility Inspector open or know how to find it or know of its existence. For the curious, its in the **XCode** menu under **Open Developer Tools**. – flipdoubt Nov 08 '17 at 12:07
  • 1
    Erasing content and settings does not provide even a short term fix. The moment I click in the running Simulator window, the error messages return. – David James Nov 13 '17 at 11:47
  • 2
    The problem also appears when running on an actual device (iPhone 6 with iOS 11.1.2 in my case), not just on the simulator. – fishinear Nov 27 '17 at 21:48
  • In simulator there is no problem but in iPhone 5s it is appear any idea how to fix it – jakir hussain Dec 15 '17 at 10:04
10

Got the same issue on 9.0.1.

  • You should quit Xcode and all Simulators.
  • Run rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache.
  • Start Xcode again.

This issue was solved for me.

Ilya Krigouzov
  • 271
  • 2
  • 16
  • 9
    I'm sorry but it doesn't work. This error will appear but a bit later :( – Ilya Krigouzov Oct 20 '17 at 19:02
  • 1
    The key thing is to quit the Simulator too. I found when I didn't do this (just quit Xcode), the problem recurred. Appears the problem is with the Simulator more than other factors. – David James Oct 30 '17 at 14:33
4

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

Nuthatch
  • 3,597
  • 4
  • 24
  • 17
  • Thanks, this works. Now I don't have to be careful that I accidentally start some Accessibility option that activates the warning mess again :) – Yvo Dec 01 '17 at 19:57
  • You will get a single warning about the missing class, but, better than hundreds of spam messages! – Nuthatch Dec 02 '17 at 19:44
2

Resetting the iOS simulator fixed this for me. Simulator -> Hardware -> Erase All Content and Settings...

1

Exactly the same problem, in my case, I tried to delete all the files in DerivedData folder, but still not work.

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.

So, simply delete the 'iPhone 8' simulator from simulator list, and then add the 'iPhone 8' simulator again, it works.

Not sure if the problem will come again, since it's also my third time dealing with this.

ke jin
  • 11
  • 3
  • It's Xcode's falt, and you cannot modify Xcode. So, you can NOT solve the problem. Just stop wasting your time, except falling back to Xcode 9.0 – DawnSong Nov 02 '17 at 13:52
1

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.

You cannot modify Xcode, so only Apple's Staff can solve it.

Just stop wasting your time, except falling back to Xcode 9.0

DawnSong
  • 4,752
  • 2
  • 38
  • 38
0

Solved!

-On simulator --Hardware ----Erase all content and settings -Close xcode and simulators -remove the content of ~/Library/Developer/Xcode/DerivedData/ModuleCache -Start xcode...

0

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!

Lumi
  • 1