Xcode 10升级:openssl.framework / openssl

时间:2018-10-18 19:04:18

标签: ios swift xcode openssl

我们刚刚将我们的应用程序升级到Xcode 10 / Swift 4.2。现在它启动了,但是在openssl.framework / openssl上出现了dyld错误。有没有人看过这个,如果是这样,您是如何解决的?

我正在使用cocoapods,这是可能的罪魁祸首:

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'

我应该注意(显然,我想)在Xcode + pods更新之前一切都正常。

3 个答案:

答案 0 :(得分:0)

我认为问题不在于链接列出的Pod。我创建了一个新项目,导入了这些容器,这是日志(您可以看到其他几个容器作为依赖项被导入):

[ ~/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] 

当我打开工作区并进行编译时,我从三个容器中得到了错误:

  • MarqueeLabel-将Swift语言版本从4.2更改为4
  • IQKeyboardManagerSwift-将Swift语言版本从4.2更改为4
  • SkyFloatingLabelTextField-将Swift语言版本从4.2更改为4

一旦我这样做,项目就会编译。我验证了它可以同时为设备和模拟器编译。在构建之前,请尝试清除派生数据文件夹(~/Library/Developer/Xcode/DerivedData)。

如果不是,则问题出在此处未列出的另一个窗格中。

答案 1 :(得分:0)

以防万一有人遇到相同的问题;由于某些原因,我不得不单独构建openssl.framework,并将其作为嵌入式框架包含在内。这绝对不是以前的情况,所以也许更了解的人可以提供解释(也许是评论)。

无论如何,我从这里使用了构建:https://github.com/keeshux/openssl-apple

一切顺利,现在一切正常。不知道为什么从Xcode 9切换到10会触发它,但是大概是某个地方的依赖项发生了变化。

更新:从上述链接编译的框架在上载到App Store时出现“非PIE二进制”错误。如果有人知道解决方案,他们的建议将不胜感激。

更新2:通过更新我的所有Pod,删除了对单独的openssl框架的要求,因此,我现在删除了openssl-apple,一切再次正常运行。

答案 2 :(得分:0)

试试这个(归功于:Dhavi.M):

在/ios文件夹中

  1. git clone https://github.com/krzyzanowskim/OpenSSL.git
  2. 列表项
  3. 制作
  4. file -> swift 包 -> 添加包依赖 -> (项目名称) -> 下一个直到完成
  5. 构建阶段 -> 将二进制文件与库链接 -> 添加 openssl.xcframework

尝试重新构建,问题应该不再存在。