dyld: Library not loaded: @rpath/libswiftSwiftOnoneSupport.dylib

后端 未结 8 1807
太阳男子
太阳男子 2020-12-02 23:43

I\'ve built a Swift framework and now I\'m trying to start building a Swift iOS application that will use that framework. I\'m getting this error:

dyld: Libr         


        
8条回答
  •  醉梦人生
    2020-12-03 00:09

    This might not be the case for everyone, but I solved it by actually writing some code in the main target.

    I had an empty project consisting of a framework and a test target, and when running tests I was getting this error. Apparently Swift is pretty smart to detect that you don't actually need this library and does not link to libswiftSwiftOnoneSupport.dylib.

    The fix is just to add some code, I just added:

    class Test {
        func a() { print ("something") }
    }
    

    and libswiftSwiftOnoneSupport.dylib got linked.

提交回复
热议问题