Как создать пользовательский модуль, включающий статические библиотеки .framework? - PullRequest
0 голосов
/ 29 ноября 2018

Я хочу, чтобы моя библиотека работала в CocoaPod, но меня беспокоит странная проблема.Я надеюсь, что кто-то может указать мне на мою ошибку.

Я уже создал исходный Pod и успешно нажал на него.Теперь я упаковываю исходный код в фреймворк и снова транкаю, процесс проверки pod lib lint всегда сообщает об ошибке ld: symbol(s) not found for architecture x86_64.

Мой источник .swift, а Xcode - самый последний.

Это .framework lipo -info Architectures in the fat file: armv7 x86_64 arm64

.podspec

Pod::Spec.new do |s|
  s.name             = 'z02sckhd_6wqgx_user'
  s.version          = '0.1.0'
  s.summary          = 'TMMall framework component'

  s.description      = <<-DESC
  description.................
                       DESC

  s.homepage         = 'https://github.com/GoGoodGo/TMMall'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'yh' => 'xxxxxxxxx@yh.com' }
  s.source           = { :git => 'https://github.com/GoGoodGo/TMMall.git', :tag => s.version.to_s }

  s.swift_version = '4.2'
  s.ios.deployment_target = '9.0'
  s.requires_arc = true
  s.xcconfig = {
  'VALID_ARCHS' => 'arm64 x86_64',
  }

  s.source_files = 'z02sckhd_6wqgx_user/Classes/z02sckhd_6wqgx_user.framework/Headers/*.{h}'
  s.resource  = 'z02sckhd_6wqgx_user/Classes/z02sckhd_6wqgx_user.bundle'
  s.vendored_frameworks = 'z02sckhd_6wqgx_user/Classes/z02sckhd_6wqgx_user.framework'

  s.dependency 'Kingfisher'
  s.dependency 'Cosmos'
  s.dependency 'YHTool', '~> 1.1.6'

  s.dependency 'MJRefresh', '~> 3.1.12'

  s.dependency 'TMUserCenter'

end

Ошибка следующая

ld: symbol(s) not found for architecture x86_64
    clang: error
    : linker command failed with exit code 1 (use -v to see invocation)

    ** BUILD FAILED **


    The following build commands failed:
        Ld /Users/healson/Library/Developer/Xcode/DerivedData/App-fhgpxcqigtdupkgeznhcbcpvqjcl/Build/Products/Release-iphonesimulator/App.app/App normal x86_64
    (1 failure)
#<Thread:0x00007f9a07212778@/Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:166 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
    3: from /Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:169:in `block in reader'
    2: from /Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:169:in `loop'
    1: from /Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:170:in `block (2 levels) in reader'
/Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:170:in `readpartial': stream closed in another thread (IOError)

Я могу найти эти ошибки:

ld: warning: 
    Could not find auto-linked library 'swiftCoreLocation'
    Undefined symbols for architecture x86_64:
      "_OBJC_CLASS_$_SwiftObject", referenced from:
          type metadata for z02sckhd_6wqgx_user.CommentData in z02sckhd_6wqgx_user(GoodsModel.o)
          type metadata for z02sckhd_6wqgx_user.Comment in z02sckhd_6wqgx_user(GoodsModel.o)
          type metadata for z02sckhd_6wqgx_user.CommentImage in z02sckhd_6wqgx_user(GoodsModel.o)
          type metadata for z02sckhd_6wqgx_user.ShopData in z02sckhd_6wqgx_user(GoodsModel.o)
          type metadata for z02sckhd_6wqgx_user.Seller in z02sckhd_6wqgx_user(GoodsModel.o)
          type metadata for z02sckhd_6wqgx_user.AuctionData in z02sckhd_6wqgx_user(GoodsModel.o)
          type metadata for z02sckhd_6wqgx_user.Order in z02sckhd_6wqgx_user(GoodsModel.o)
          ...

и

z02sckhd_6wqgx_user (0.1.0)
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | [iOS] xcodebuild:  note: Planning build
    - NOTE  | [iOS] xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'Pods-App')
    - NOTE  | [iOS] xcodebuild:  warning: Mapping architecture arm64 to x86_64.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...