简体   繁体   中英

Swift embedded library -> Command /usr/bin/codesign failed with exit code 1

I'm trying to integrate swift framework to my project: http://developer.skobbler.com/download/SKMaps_iOS_2.4.0_withDemo_Swift.zip

When I try to integrate as embedded binary xcode couldn't code sign and tells me "codesign failed with exit code 1".

CodeSign /Users/k1x/Library/Developer/Xcode/DerivedData/TestMaps-dubiwcafqgeplbabdrqpjtokouxq/Build/Products/Debug-iphoneos/TestMaps.app/Frameworks/SKMaps.framework
    cd "/Users/k1x/Workspace iOS/SwitchMaps"
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "iPhone Developer"

    /usr/bin/codesign --force --sign 56131F60BE8DA3BA4F04CBF6717C75951E93E4D6 --preserve-metadata=identifier,entitlements,resource-rules /Users/k1x/Library/Developer/Xcode/DerivedData/TestMaps-dubiwcafqgeplbabdrqpjtokouxq/Build/Products/Debug-iphoneos/TestMaps.app/Frameworks/SKMaps.framework

Warning: usage of --preserve-metadata with option "resource-rules" (deprecated in Mac OS X >= 10.10)!
/Users/k1x/Library/Developer/Xcode/DerivedData/TestMaps-dubiwcafqgeplbabdrqpjtokouxq/Build/Products/Debug-iphoneos/TestMaps.app/Frameworks/SKMaps.framework: invalid resource specification rule(s)
Command /usr/bin/codesign failed with exit code 1

And I tried to put the framework in "Linked frameworks and binaries section". But I've got following output:

dyld: Library not loaded: @rpath/SKMaps.framework/SKMaps
  Referenced from: /private/var/mobile/Containers/Bundle/Application/B3686F36-2120-4007-97AB-B2D3B423C0A0/TestMaps.app/TestMaps
  Reason: image not found

I googled and found another posts for this issue but they didn't answer my question. Just in case everything works correct with Objective C version of it: http://developer.skobbler.com/download/SKMaps_iOS_2.4.0_withDemo.zip

You need to use cocoapods for install it.

I had the same problem, I like this and it worked.

Edit : With cocoa pods, you need to add a line containing pod 'ScoutMaps-iOS-SDK' to your Podfile, run pod install in the Terminal and import the SKMaps/SKMaps.h header in order to use the library or import the SKMaps/SKMaps.h header to your Objective-C bridging header if you are using Swift.

Select the SKMaps.framework from the Frameworks folder and uncheck and then check back the SKMapsSwiftDemo target (in Target Membership) as shown in this screenshot .

This will not be necessary in the next version of the SDK.

For the issue:

dyld: Library not loaded: @rpath/SKMaps.framework/SKMapsReferenced from:
/private/var/mobile/Containers/Bundle/Application/
B3686F36-2120-4007-97ABB2D3B423C0A0/TestMaps.app/TestMaps
Reason: image not found

I faced the very same problem (Swift project from scratch.)

Adding SKMaps.framework under Embedded Binaries ( Project / Target / General / Embedded Binaries ) did the trick here:

嵌入式二进制文件

Clean, build, run. 🍻

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM