swift Xcode 12.5,为iOS-armv7构建,但尝试与为iOS-arm 64构建的文件链接问题

pepwfjgg  于 2022-10-31  发布在  Swift
关注(0)|答案(4)|浏览(190)

我尝试在Xcode 12.5上构建IOS项目。当连接真实的设备或尝试使用模拟器构建时没有问题。但当选择“任何IOS设备”时出现此错误。选择“任何IOS设备”来存档我的项目时,我在存档时出现错误消息。我多次更改"仅构建活动架构“和”排除的架构“设置,但问题仍未解决。

请帮助我解决此问题..

0wi1tuuw

0wi1tuuw1#

将其更改为IOS部署目标12.0后,问题解决

  • 选择“仅构建活动体系结构”为“是”。
mwyxok5s

mwyxok5s2#

请看这个屏幕截图-x1c 0d1x
问题是Undefined symbols for architecture armv7
你能去你的Build Settings
1.投射
1.应用程序目标
1.所有的pod目标(如果使用pod)
搜索armv7,如果存在,是否删除?
之后,执行Product > Clean Build Folder,然后尝试运行/构建应用程序。

6xfqseft

6xfqseft3#

我在我的项目中遇到了同样的错误。我使用Xcode 13.3.1。所以我用下一种方法更新了我的Podfile(添加了排除的arch和部署目标):

$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
wztqucjr

wztqucjr4#

在我的情况下,我使用这个解决方案,它为我工作。
将下面给出的代码添加到你的podfile底部并运行“pod install”命令。
此时**'12.0'您可以根据您的项目进行相应的更改。对于示例**:'11.0'或'10.0',如下图所示。它应与**平台相匹配:ios,'12.0'**这一行在您的podfile中的第二个位置。
"在我看来"
示例:平台:ios,'12.0'所以配置构建设置[' IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'.所以12.0在两个版本中都匹配.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
    # some older pods don't support some architectures, anything over iOS 11 resolves that
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
    end
  end
end

相关问题