2016-10-04 61 views
0

最近我將xcode升級到8.0。由於我在加載我之前的項目時使用了swift2,xcode會提示一個對話框將我當前的代碼遷移到swift2.3。做完這些之後,我的項目無法在iPhone設備上運行。它可以在模擬器上正常工作。以下是我在設備上運行時遇到的錯誤。dyld:庫未加載:在iPhone設備上運行時出錯

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire 
    Referenced from: /var/containers/Bundle/Application/29C6F6B8-4CFB-4D1D-864E-45FF6AB13971/cooltoo_go2nurse_ios.app/cooltoo_go2nurse_ios 
    Reason: no suitable image found. Did find: 
    /private/var/containers/Bundle/Application/29C6F6B8-4CFB-4D1D-864E-45FF6AB13971/cooltoo_go2nurse_ios.app/Frameworks/Alamofire.framework/Alamofire: code signing blocked mmap() of '/private/var/containers/Bundle/Application/29C6F6B8-4CFB-4D1D-864E-45FF6AB13971/cooltoo_go2nurse_ios.app/Frameworks/Alamofire.framework/Alamofire 

我已經搜索了類似的錯誤,並嘗試了下面的建議,但沒有一個解決我的問題。

  1. 在構建階段,我添加了「複製文件」相用框架作爲目的地添加Alamofire.framework,然後選中「代碼註冊複製」。

  2. 設置$(繼承)@ executable_path /構建設置中的Runpath搜索路徑上的框架。

  3. 在常規選項卡中,在嵌入式二進制文件中添加Alamofire.framework。

下面是我的Podfile:

# Uncomment this line to define a global platform for your project 
platform :ios, '8.0' 
# Uncomment this line if you're using Swift 
# use_frameworks! 


target 'cooltoo_go2nurse_ios' do 
    pod 'IQKeyboardManager', '4.0.5' 
    pod 'IQKeyboardManagerSwift', '4.0.5' 
    pod 'MJRefresh' 
    pod 'SDWebImage', '~>3.7' 
    pod 'MBProgressHUD', '~> 0.9.2' 
    pod 'Alamofire', '3.5.0' 
    pod 'CryptoSwift', :git => "https://github.com/krzyzanowskim/CryptoSwift", :branch => "swift2" 
    pod 'Pingpp', '~> 2.1.4' 
    use_frameworks! 
end 


target 'cooltoo_go2nurse_iosTests' do 


end 


target 'cooltoo_go2nurse_iosUITests' do 


end 


post_install do |installer| 
    installer.pods_project.targets.each do |target| 
     target.build_configurations.each do |config| 
      config.build_settings['SWIFT_VERSION'] = '2.3' 
     end 
    end 
end 

有誰知道如何解決這個問題?

謝謝

回答

0

我第二個這個。這是我迄今所知道的。似乎有一個簽名問題。我的問題之前是一個慢得可怕的COPY PODS腳本,看着我看到的控制檯,我看到在各處都出現了錯誤。我在我的電腦上登錄了一個新帳戶,並且能夠再次正常運行。一旦我重新登錄到我的原始帳戶,一切都會停下來。我嘗試過爆炸我的鑰匙鏈,重新安裝一切可以想象的事物,到目前爲止沒有任何工作。我在8.1 GM上,這一切都開始了。

---編輯16年10月26日

我認定,這是我的簽名證書的腐敗結合了故障,鑰匙扣,或在被註冊到系統鑰匙串的變化。爲了解決這個問題,我做了一個乾淨的macOS安裝,並通過iCloud而不是從時間機器備份來恢復我的文件。

我還是不知道是什麼原因造成的,但我知道即使我的鑰匙串已完全刪除,Xcode安裝並試圖在設備上運行的計算機上沒有證書。最終,錯誤意味着代碼沒有正確簽名,因此它不會允許複製和運行庫。

相關問題