1

I recently converted an Xcode project to Swift 4. I fixed all the syntax errors. However, my app now crashes, after outputting an error message which starts
Class MPExportableArtworkProperties is implemented in both...

I have been looking around S/O but all I find is that its related to MapBox which I don't even have in my project/podfile. Can it have something to do with the regular map-kit? It crashes the app when I open the tab with my map, so I'm guessing that's where the problem is.

Full error message, formatted for readability:

objc[24634]: Class MPExportableArtworkProperties is implemented in both

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/MediaPlaybackCore.framework/MediaPlaybackCore
(0x126b1b108) and

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MediaPlayer.framework/MediaPlayer
(0x1258107d0).

One of the two will be used. Which one is undefined.
This is the plowerthingscontroller saying that you are logged in
libc++abi.dylib: terminating with uncaught exception of type
NSException
Clay Bridges
  • 11,602
  • 10
  • 68
  • 118

1 Answers1

0

I had this exact error, and in the end found it was due to something completely different: a circular dependency. Consider:

class DependencyManager {

    static let shared = DependencyManager()
    let aDependency: SomeDependency

    init() {

        aDependency = SomeDependency()
    }

    func resolve() -> SomeProtocol {
        // Create the actual class
        return 0
    }
}

where SomeDependency requires SomeProtocol

class SomeDependency {

    let x: SomeProtocol

    // Me trying to be clever and auto-inject the dependency
    init(x: SomeProtocol = DependencyManager.shared.resolve()) {
        self.x = x
    }
}

So when you first access DependencyManager.shared it tries instantiate SomeDependency, which requires DependencyManager.shared to already be instantiated.

I have no idea why MPExportableArtworkProperties is mentioned in the error, however cleaning up the code fixed the issue for me.

Max Chuquimia
  • 7,494
  • 2
  • 40
  • 59