簡體   English   中英

Xcode 12.5,為 iOS-armv7 構建但試圖鏈接為 iOS-arm64 問題構建的文件

[英]Xcode 12.5, building for iOS-armv7 but attempting to link with file built for iOS-arm64 problem

我正在嘗試在 Xcode 12.5 上構建一個 IOS 項目。 連接真實設備或嘗試使用模擬器構建時沒有問題。 But I get this error when Any IOS Device is selected. 選擇任何 IOS 設備來存檔我的項目,我在存檔時收到一條錯誤消息。 我已經改變了'Build Active Arch。 Only' 和 'Excluded Architecture' 設置了很多次,但問題一直沒有解決。

錯誤圖像

請幫我解決這個問題..

當我將其更改為 IOS 部署目標 12.0 時問題解決了

  • Build Active Architecture Only 選為是。

看這個截圖—— 在此處輸入圖像描述

問題是Undefined symbols for architecture armv7

你能去你的Build Settings

  1. 項目
  2. 應用目標
  3. 如果您使用 pod,則所有 pod 目標

搜索armv7並刪除它(如果存在)?

在此之后,執行Product > Clean Build Folder & 現在嘗試運行/構建應用程序。

我在我的項目中遇到了同樣的錯誤。 我使用Xcode 13.3.1 所以我用下一種方式更新了我的Podfile (添加了排除的拱門和部署目標):

$iOSVersion = '13.1'
platform :ios, $iOSVersion
use_frameworks!

def general_pods
  pod 'Some_pods_here'
end

target 'Some_target1' do
  general_pods
  pod 'Some_pod_here'
end

target 'Some_target2' do
  general_pods
  pod 'some_pod_here'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
      config.build_settings["EXCLUDED_ARCHS[sdk=*]"] = "armv7"
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion
    end
  end

installer.pods_project.targets.each do |target|
  target.build_configurations.each do |config|
    if Gem::Version.new($iOSVersion) > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion
    end
   end
 end
end

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM