欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

mac电脑升级到10.15.7含有支付宝SDK的组件更新报错:AlipaySDK.framework/AlipaySDK for architecture arm64

程序员文章站 2022-03-23 11:13:37
mac电脑10.15.7操作系统和xcode12.0.1版本曲面抛弃对arm64的Release-iphonesimulator模拟器的支持。而支付宝SDK还兼容arm64的Release-iphonesimulator模拟器。解决方案:在BITPaylibraryManager.podspec配置文件中增加:`s.pod_target_xcconfig = { 'VALID_ARCHS' => 'x86_64 armv7 armv7s arm64' } `。...

mac电脑操作系统版本:10.15.7;xcode版本:12.1。
报错信息是:Ld /Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/Binary/App normal arm64

BITPaylibraryManager.podspec配置文件:

# Be sure to run `pod lib lint BITPaylibraryManager.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'BGPaylibraryManager'
  s.version          = '0.0.4'
  s.summary          = 'BGPaylibraryManager.'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
TODO: Add long description of the pod here.
                       DESC

  s.homepage         = 'http://www.baidu.com/'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'jiaguoshang' => 'jia12216@163.com' }
  s.source           = { :git => 'http://192.168.1.123:8686/iOSTeam/BGPaylibraryManager.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.ios.deployment_target = '9.0'

   s.source_files  = 'BITPaylibraryManager/weChat/*.{h,m}'
   s.subspec 'weChat' do |weChat|
   weChat.source_files = 'BITPaylibraryManager/weChat/*.{h,m}'
   weChat.vendored_libraries = 'BITPaylibraryManager/weChat/libWeChatSDK.a'
   weChat.libraries = 'stdc++','z','sqlite3'
   weChat.frameworks = 'UIKit','Foundation','CoreMotion','CoreTelephony','SystemConfiguration'
#weChat.dependency 'UMengUShare', '~> 6.4.8'
   end

   s.subspec 'aliPay' do |aliPay|
   aliPay.resource = 'BITPaylibraryManager/aliPay/Assets/AlipaySDK.bundle'
   aliPay.libraries = 'stdc++','z','sqlite3'
   aliPay.vendored_frameworks = 'BITPaylibraryManager/aliPay/Frameworks/AlipaySDK.framework'
   aliPay.frameworks = 'UIKit', 'Foundation','CoreMotion','CoreTelephony','SystemConfiguration','WebKit'
   end
   
   #s.subspec 'llPay' do |llPay|
   #llPay.resource = 'BITPaylibraryManager/llPay/Assets/walletResources.bundle'
   #llPay.vendored_libraries = 'BITPaylibraryManager/llPay/Frameworks/libPaySdkColor.a'
   #llPay.source_files = 'BITPaylibraryManager/llPay/LLPayClass/*.{h}'
   #llPay.libraries = 'stdc++','z','sqlite3'
   #llPay.frameworks = 'UIKit', 'Foundation','CoreMotion','CoreTelephony','SystemConfiguration'
   #end


  # s.resource_bundles = {
  #    'YXRequestManager' => ['BITPaylibraryManager/Classes/*.xcassets']
  # }

  # s.public_header_files = 'Pod/Classes/**/*.h'
   s.frameworks = 'UIKit', 'Foundation'
 #  s.dependency 'YXFDCategories'
 #  s.dependency 'AFNetworking', '3.1.0'
 #  s.dependency 'TMCache'
#s.dependency 'UMengUShare', '6.4.8'
end

私有库上传语句:pod spec lint BGPaylibraryManager.podspec --sources='http://192.168.1.123:8686/iOSTeam/BinGoSpec.git,https://github.com/CocoaPods/Specs.git' --verbose --use-libraries

具体的报错详细信息是:

Ld /Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/Binary/App normal arm64 (in target 'App' from project 'App')
        cd /var/folders/98/5npr9rqx7710mfl6h8l1zhzm0000gp/T/CocoaPods-Lint-20201016-9510-zubdz8-BGPaylibraryManager
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios9.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk -L/Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Products/Release-iphonesimulator -F/Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Products/Release-iphonesimulator -F/var/folders/98/5npr9rqx7710mfl6h8l1zhzm0000gp/T/CocoaPods-Lint-20201016-9510-zubdz8-BGPaylibraryManager/Pods/BGPaylibraryManager/BITPaylibraryManager/aliPay/Frameworks -filelist /Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/App.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/App_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lsqlite3 -lstdc++ -lz -framework AlipaySDK -framework CoreMotion -framework CoreTelephony -framework Foundation -framework SystemConfiguration -framework UIKit -framework WebKit -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/App.app-Simulated.xcent -framework Foundation -lPods-App -Xlinker -dependency_info -Xlinker /Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/App_dependency_info.dat -o /Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/Binary/App
    ld: building for iOS Simulator, but linking in object file built for iOS, file '/var/folders/98/5npr9rqx7710mfl6h8l1zhzm0000gp/T/CocoaPods-Lint-20201016-9510-zubdz8-BGPaylibraryManager/Pods/BGPaylibraryManager/BITPaylibraryManager/aliPay/Frameworks/AlipaySDK.framework/AlipaySDK' for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    ** BUILD FAILED **


    The following build commands failed:
      Ld /Users/jiaguoshang/Library/Developer/Xcode/DerivedData/App-dnbdiysclikvtjfimthjcakszzcl/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/Binary/App normal arm64
    (1 failure)
   Testing with `xcodebuild`.
 -> BGPaylibraryManager (0.0.4)
    - ERROR | [BGPaylibraryManager/weChat,BGPaylibraryManager/aliPay] xcodebuild: Returned an unsuccessful exit code.
    - NOTE  | [BGPaylibraryManager/weChat,BGPaylibraryManager/aliPay] xcodebuild:  note: Using new build system
    - NOTE  | [BGPaylibraryManager/weChat,BGPaylibraryManager/aliPay] xcodebuild:  note: Building targets in parallel
    - NOTE  | [BGPaylibraryManager/weChat,BGPaylibraryManager/aliPay] xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | [BGPaylibraryManager/weChat,BGPaylibraryManager/aliPay] xcodebuild:  note: Planning build
    - NOTE  | [BGPaylibraryManager/weChat,BGPaylibraryManager/aliPay] xcodebuild:  note: Constructing build description
    - NOTE  | [BGPaylibraryManager/weChat,BGPaylibraryManager/aliPay] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
    - NOTE  | [BGPaylibraryManager/weChat,BGPaylibraryManager/aliPay] xcodebuild:  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error.

包含支付宝SDK的工程能编译运行,但是采用Edit Scheme ->Run->Info->Build Configuration->Release配置时不能运行模拟器,可以运行真机。采用Edit Scheme ->Run->Info->Build Configuration->Debug配置时能运行真机和模拟器。
问题分析:

arm64:iPhone6s | iphone6s plus|iPhone6| iPhone6 plus|iPhone5S | iPad Air| iPad mini2(iPad mini with Retina Display)
armv7s:iPhone5|iPhone5C|iPad4(iPad with Retina Display)
armv7:iPhone4|iPhone4S|iPad|iPad2|iPad3(The New iPad)|iPad mini|iPod Touch 3G|iPod Touch4

i386是针对intel通用微处理器32位处理器
x86_64是针对x86架构的64位处理器

模拟器32位处理器测试需要i386架构,
模拟器64位处理器测试需要x86_64架构,
真机32位处理器需要armv7,或者armv7s架构,
真机64位处理器需要arm64架构。

问题分析:mac电脑10.15.7操作系统和xcode12.0.1版本全面抛弃对arm64的Release-iphonesimulator模拟器支持。而支付宝SDK还兼容arm64。
解决方案:
在BITPaylibraryManager.podspec配置文件中增加:s.pod_target_xcconfig = { 'VALID_ARCHS' => 'x86_64 armv7 armv7s arm64' }

本文地址:https://blog.csdn.net/jia12216/article/details/109357503

相关标签: mac xcode