xcodebuild: ld: warning:忽略文件中缺少所需的架构i386



最近,我正在尝试使用CocoaPods将集成的sharedSDK上传到私有库。

我不确定我是不是在做蠢事。当我运行"pod lib lint",一切似乎都很好,但当我运行"pod spec lint"我得到:

ld: warning:忽略TencentOpenAPI.framework

      ** BUILD FAILED **

    The following build commands failed:
        Ld /Users/melody/Library/Developer/Xcode/DerivedData/App-fcbstzvalzvjwfgtkwkycnyvprjk
/Build/Intermediates/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/App normal i386
    (1 failure)
     -> SLShareSDK (0.1.0)
        - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
        - NOTE  | [iOS] xcodebuild:  ld: warning: ignoring file /Users/melody/GItLab/SLShareSDK/SLShareSDK/Assets/TencentOpenAPI.framework/TencentOpenAPI,
 missing required architecture i386 in file /Users/melody/GItLab/SLShareSDK/SLShareSDK/Assets/TencentOpenAPI.framework/TencentOpenAPI (3 slices)
        - NOTE  | [iOS] xcodebuild:  clang: error: linker command failed with exit code 1 (use -v to see invocation)
[!] SLShareSDK did not pass validation, due to 1 error.

我的SLShareSDK的内容。提示文件

  Pod::Spec.new do |s|
  s.name             = 'SLShareSDK'
  s.version          = '0.1.0'
  s.summary          = 'Intergation'
# 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:  SLShare...
                       DESC
  s.homepage         = 'http://gitlaBalaBala...'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'Melody' => 'BalaBala.com' }
  s.source           = { :git => 'http://gitlab.balabala...../SLShareSDK.git', :tag => s.version.to_s }

  s.ios.deployment_target = '7.0'
  s.source_files = 'SLShareSDK/Classes/**/*'
  s.ios.vendored_libraries = 'SLShareSDK/Assets/*.a'
  s.ios.vendored_frameworks = 'SLShareSDK/Assets/TencentOpenAPI.framework'
   s.resource_bundles = {
     'SLShareSDK' => ['SLShareSDK/Assets/*.bundle']
   }
   s.frameworks = 'UIKit', 'SystemConfiguration','Security','CoreTelephony','ImageIO'
   s.libraries  = 'sqlite3','z.1.2.8','c++.1'
   s.dependency 'AFNetworking', '~> 2.6.3'
end

目录结构如下:

├── SLShareSDK
│   ├── Assets
│   │   ├── TencentOpenAPI.framework
│   │   │   ├── Headers
│   │   │   ├── Resources
│   │   │   └── TencentOpenAPI
│   │   ├── libWeChatSDK.a
│   │   └── libWeiboSDK.a
│   └── Classes
│       └── SLShareSDK
│           ├── AFHTTPRequestOperationManager+JXExtentsion.h
│           ├── AFHTTPRequestOperationManager+JXExtentsion.m
│           ├── SLShare.h
│           ├── SLShare.m
│           ├── SLShareAuthorizeObject.h
│           ├── SLShareAuthorizeObject.m
│           ├── SLShareConfiguration.plist
│           ├── SLShareConstant.h
│           ├── SLShareConstant.m
│           ├── SLShareContentObject.h
│           ├── SLShareContentObject.m
│           ├── SLShareContentObjectTranslater.h
│           ├── SLShareContentObjectTranslater.m
│           ├── SLShareQQ.h
│           ├── SLShareQQ.m
│           ├── SLShareSina.h
│           ├── SLShareSina.m
│           ├── SLShareWeChat.h
│           ├── SLShareWeChat.m
│           ├── WBHttpRequest+WeiboGame.h
│           ├── WBHttpRequest+WeiboShare.h
│           ├── WBHttpRequest+WeiboToken.h
│           ├── WBHttpRequest+WeiboUser.h
│           ├── WBHttpRequest.h
│           ├── WBSDKBasicButton.h
│           ├── WBSDKCommentButton.h
│           ├── WBSDKRelationshipButton.h
│           ├── WXApi.h
│           ├── WXApiObject.h
│           ├── WechatAuthSDK.h
│           ├── WeiboSDK+Statistics.h
│           ├── WeiboSDK.h
│           └── WeiboUser.h
├── SLShareSDK.podspec

Q1。:

在我看来,程序使用tencentopenapi框架,我已经设置了s.ios.vendored_frameworks = 'SLShareSDK/Assets/TencentOpenAPI.framework',确保代码路径是正确的。

And I Use pod lib lint --use-libraries --verbose查看Specrepo

但是它显示的错误让我疯狂。但是,同样的代码,我使用xcode运行没有问题。

所以,这就是我的情况,谢谢你的关注和帮助,如果你有什么建议请帮助我!!

当我试图将其链接到第三方框架时,我也得到了这个错误,我没有找到解决方案,但必须单独拿出头文件,让库构建没有链接,之后它的工作,想知道一个更好的解决方案,但请参阅此更多信息,还包含通过更改validator.rb

修复

我想我已经找到了问题,因为最新的TencentOpenAPI.framework中提到的错误不支持i836CPU,所以我尝试使用旧的API来运行,它正在工作!!但我不知道如何改变pod lib lint不运行i836编译器…

最新更新