解决 XCode new build system Unable to install "xxx"

当我们使用新版XCode创建项目时,项目的默认编译方式为

image.png

当使用cocoapods 时,新版的项目真机运行时会提示 Unable to install "xxx"


image.png
详情
Details

Unable to install "xxxxx"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620388
--
No code signature found.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620388
User Info: {
......

解决方案一:

Targets--> General --> Frameworks,Libraries,and Embedded Content

将 Pods_xxxxxx.framework Embed 设置为 Embed $ Sign

image.png

解决方案二:

如果方案一未生效结合方案二尝试

https://github.com/CocoaPods/CocoaPods/issues/8151

Podfile 中添加

install! 'cocoapods', :disable_input_output_paths => true
执行 pod install
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

source 'https://github.com/CocoaPods/Specs.git'

# New Build System
# https://github.com/CocoaPods/CocoaPods/issues/8151
install! 'cocoapods', :disable_input_output_paths => true

target 'xxxxx' do
  # Comment the next line if you don't want to use dynamic frameworks
  inhibit_all_warnings!
  use_frameworks!

  # Pods for xxxxx
pod 'Moya/RxSwift'#基于alm封装库

解决方案三:

以上方案都不管用的话只能使用终极解决方案->旧的编译方式

file --> Workspace Settings... / Probject Settings...
设置成 Legacy Build System
image.png

你可能感兴趣的:(解决 XCode new build system Unable to install "xxx")