简体   繁体   中英

Xcode 10 upgrade: dyld library error on openssl.framework/openssl

We've just upgraded our app to Xcode 10/Swift 4.2. Now it launches, but hits a dyld error on openssl.framework/openssl. Has anybody seen this, and if so, how did you get around it?

I'm using cocoapods and here are a subset of possible culprits:

pod 'Alamofire', '~> 4.7'                                                               
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/Auth'
pod 'Firebase/Performance'
pod 'Fabric', '~> 1.7.11'
pod 'Crashlytics', '~> 3.10.7'
pod 'CodableFirebase'
pod 'IQKeyboardManagerSwift', '~> 5.0'
pod 'SkyFloatingLabelTextField', '~> 3.0'
pod 'MarqueeLabel/Swift'
pod 'FTIndicator', '~> 1.2'
pod 'SQLite.swift', '~> 0.11.5'
pod 'CarbonKit', '~> 2.2'
pod 'ZHChat', '~> 0.2'
pod 'ReachabilitySwift', '~> 4.1'
pod 'FirebaseMessaging', '~> 2.0'
pod 'IQKeyboardManagerSwift', '~> 5.0'
pod 'Alamofire', '~> 4.4'
pod 'SkyFloatingLabelTextField', '~> 3.0'
pod 'MarqueeLabel/Swift'
pod 'FTIndicator', '~> 1.2'
pod 'SWRevealViewController', '~> 2.3'
pod 'SQLite.swift', '~> 0.11.5'
pod 'CarbonKit', '~> 2.2'
pod 'ZHChat', '~> 0.2'
pod 'ReachabilitySwift', '~> 4.1'
pod 'Firebase', '~> 4.0'
pod 'FirebaseMessaging', '~> 2.0'

I should note that (obviously enough, I suppose) everything was working before the Xcode + pods update.

I don't think the issue is with linking the pods listed. I made a new project, imported these pods, and here was the log (you can see several other pods were imported as dependencies):

[ ~/Desktop] cd PodCrasher/
[ ~/Desktop/PodCrasher] pod init
[ ~/Desktop/PodCrasher] vi Podfile 
[ ~/Desktop/PodCrasher] pod install
Analyzing dependencies
Downloading dependencies
Installing Alamofire (4.7.3)
Installing Bolts (1.9.0)
Installing BoringSSL (10.0.6)
Installing CarbonKit (2.2.2)
Installing CodableFirebase (0.2.0)
Installing Crashlytics (3.10.7)
Installing FBSDKCoreKit (4.36.0)
Installing FBSDKLoginKit (4.36.0)
Installing FBSDKShareKit (4.36.0)
Installing FTIndicator (1.2.9)
Installing Fabric (1.7.11)
Installing FacebookCore (0.3.3)
Installing FacebookLogin (0.3.3)
Installing FacebookShare (0.3.3)
Installing Firebase (4.13.0)
Installing FirebaseAnalytics (4.2.0)
Installing FirebaseAuth (4.6.1)
Installing FirebaseCore (4.0.20)
Installing FirebaseFirestore (0.11.0)
Installing FirebaseInstanceID (2.0.10)
Installing FirebaseMessaging (2.2.0)
Installing FirebasePerformance (1.1.3)
Installing FirebaseSwizzlingUtilities (1.0.1)
Installing GTMSessionFetcher (1.2.0)
Installing GoogleToolboxForMac (2.1.4)
Installing IQKeyboardManagerSwift (5.0.8)
Installing MarqueeLabel (3.1.6)
Installing Protobuf (3.6.1)
Installing ReachabilitySwift (4.2.1)
Installing SQLite.swift (0.11.5)
Installing SWRevealViewController (2.3.0)
Installing SkyFloatingLabelTextField (3.5.2)
Installing ZHChat (0.2.9)
Installing gRPC (1.14.1)
Installing gRPC-Core (1.14.1)
Installing gRPC-ProtoRPC (1.14.1)
Installing gRPC-RxLibrary (1.14.1)
Installing leveldb-library (1.20)
Installing nanopb (0.3.8)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `PodCrasher.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 23 dependencies from the Podfile and 39 total pods installed.

[!] Automatically assigning platform `ios` with version `12.0` on target `PodCrasher` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] There are duplicate dependencies on `Alamofire` in `Podfile`:

- Alamofire (~> 4.7)
- Alamofire (~> 4.4)
[ ~/Desktop/PodCrasher] open .
[ ~/Desktop/PodCrasher] 

When I opened the workspace and compiled, I got errors from three pods:

  • MarqueeLabel -- changed Swift language version from 4.2 to 4
  • IQKeyboardManagerSwift -- changed Swift language version from 4.2 to 4
  • SkyFloatingLabelTextField -- changed Swift language version from 4.2 to 4

Once I did this, the project compiled. I verified that it compiles both for device and simulator. Try cleaning out the derived data folder ( ~/Library/Developer/Xcode/DerivedData ) before building.

If not, then the problem is in another pod not listed here.

Just in case anybody has the same problem; for some reason I had to build openssl.framework separately, and include it as an embedded framework . This was absolutely not the case before, so perhaps somebody who knows better can provide an explanation (as a comment, perhaps?).

Anyway, I used the build from here: https://github.com/keeshux/openssl-apple

All went smoothly, and everything's working now. Don't know why the switch from Xcode 9 to 10 triggered it, but presumably a change in a dependency somewhere.

UPDATE: The framework compiled from the above link gives a "Non-PIE Binary" error when uploaded to the App Store. If anybody knows a fix, their advice would be greatly appreciated.

UPDATE 2: By updating all my pods the requirement for a separate openssl framework was removed, so I've now removed openssl-apple and everything's working again.

Try this (credit to: Dhavi.M):

In /ios folder

  1. git clone https://github.com/krzyzanowskim/OpenSSL.git
  2. List item
  3. make
  4. file -> swift packages -> add package dependency -> (project name) -> just next until finish
  5. build phases -> Link binary with libraries -> add openssl.xcframework

Try to build again, the issue should be no longer there.

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