Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 Beta 5 Swift Error: Class Exists in libswift_stdlib_core.dylib and in libswiftCore.dylib. Which one is undefined

Tags:

ios

swift

xcode6

So I am having an interesting error which didn't exist in the previous Xcode Beta version. It pops up at runtime from this code: (Line 5 to be exact)

func removeDuplicates(urls: [NSString]) -> [NSString]{
    var newURLs = [urls[0]]
    for var i = 0; i < urls.count; i++ {
        for var j = 0; j < newURLs.count; j++ {
            if urls[i].isEqualToString(newURLs[j]) {
                if j == newURLs.count-1 {
                    newURLs.append(urls[i])
                }
            } else {
                j = newURLs.count
            }
        }
    }
    println(newURLs.debugDescription)
    return newURLs
}

The errors are as follows:

objc[322]: Class _NSSwiftEnumeratorBase is implemented in both "MyAppFilePath.app"/Frameworks/libswift_stdlib_core.dylib and "MyAppFilePath.app"/Frameworks/libswiftCore.dylib. One of the two will be used. Which one is undefined.

There are about two dozen of those for different swift classes.

As I said there was not a problem here until I changed versions, I know some syntax changed but nothing in the release notes really pointed to such a thing.

like image 879
jaco129 Avatar asked Aug 04 '14 20:08

jaco129


1 Answers

Had the same issue, doing a Clean (Shift+Cmd+K) resolved it for me.

like image 73
Essan Parto Avatar answered Oct 22 '22 22:10

Essan Parto