3

I use cocoapods to install alamofire in my project, it works fine in simulator. When I want to run my App on my iphone 6s(ios 13.3.1), it crashed and show the error message. My Xcode version is 11.3.1 (11C504). Is this issue appear due to latest swiftUI project? And is there some way to solve this issue? Please help. Thank you.

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire
Referenced from: /private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Fitness(SwiftUI)
Reason: no suitable image found.  Did find:
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire'

/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: stat() failed with errno=25
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire'

/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: stat() failed with errno=1
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire'

/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: stat() failed with errno=1

Below is my Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '13.3.1'

target 'Fitness(SwiftUI)' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for Fitness(SwiftUI)
pod 'Alamofire'
pod 'SwiftyJSON', '~> 4.0'
pod 'AlamofireImage', '~> 3.5'

end

enter image description here

frank61003
  • 205
  • 3
  • 16
  • This question has your solution. Please try this - https://stackoverflow.com/questions/32730312/reason-no-suitable-image-found – shraddha11 Jan 30 '20 at 05:52
  • Thans for your comment. I used IphoneX and Iphone8 test my app is ok. I don't know why only Iphone 6s has this issue. – frank61003 Jan 30 '20 at 08:44

2 Answers2

1

There is an open issue: https://github.com/Alamofire/Alamofire/issues/3051

Seems to happen on ios 13.1.3 with non-developer Apple ID. Right now you can switch to developer Apple ID or remove use_frameworks! from pods (sadly that can make other dependencies throw error)

Edgar Jan
  • 175
  • 2
  • 9
  • Removing use_frameworks! and comment some pods worked for me. But commenting some pods is not convenient :( It's a test project so it's okay. Thanks ! – Arthur Feb 22 '20 at 00:17
0

What fixed this issue in my case was to delete the Apple Development profile from my device and then let Xcode install it again when I ran the app on the device.

General > Device Management > Apple Development ... > tap on it then tap on Delete App. Then when you run again the app one your device the profile will be installed again and you'll be asked to Trust it again.

To be fair, I've also done a pods update.

eby
  • 111
  • 1
  • 4