dyld: Library not loaded: @rpath/libswiftCore.dylib / Image not found

前端 未结 27 2782
我在风中等你
我在风中等你 2020-11-27 14:01

I am running my app from xcode to my iOS device and I get this and black screen on iOS device.

Console text:

dyld: Library not loaded: @rpath/libswif         


        
27条回答
  •  庸人自扰
    2020-11-27 14:45

    I had a similar problem in an Objective-C project where I started to include Swift files.

    In my case, I created two targets in the main project, and I added a Swift empty file, that creates a bridging header file and some configurations, but I only marked it as a member of one target. The first target works properly, but the second not, and I noticed that the differences in build settings were this setting:

    Runpath Search Paths -> $(inherited) and @executable_path/Frameworks

    And I also needed to reference Objective-C Bridging Header to the file that was created before:

    Objective-C Bridging Header -> pathTo/Target-Bridging-Header.h

    After adding this two settings, the second target started to work properly.

提交回复
热议问题