从Pod中嵌入的框架访问.bundle内容时,“无法在捆绑中加载NIB”

问题描述

我有以下情况:

我需要将第三方框架集成到我自己的(本地)cocoapod中。该框架由.framework和.bundle文件组成。我的.podspec文件如下所示:

Pod::Spec.new do |s|
  s.name             = 'Flutter_wrapper'
  s.version          = '0.0.1'
  s.summary          = 'Flutter wrapper for the client framework Mobile SDK'
  s.description      = <<-DESC
  Wraps the [client Mobile SDK][1] for use in Flutter apps.
  [1]: https://some.client.library.url/mobile-sdk
                       DESC
  s.homepage         = 'http://example.com'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Your Company' => '[email protected]' }
  s.source           = { :git => 'https://gitlab.com/somesecretrepo' }
  s.source_files = 'Classes/**/*'
  s.dependency 'Flutter'
  s.platform = :ios,'8.0'
    
  s.vendored_frameworks = 'Resources/OPPWAMobile.framework'
  s.resource = 'Resources/*'
  s.resource_bundle = { 'OPPWAMobile' => 'Resources/*' }

  # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
  s.pod_target_xcconfig = {
    'DEFInes_MODULE' => 'NO','VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64','SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_ROOT)/../../../ios/Classes/BridgingHeader.h'
  }
  s.swift_version = '5.0'

end

当我构建项目并运行它时,一旦实例化框架内的一个ViewController,应用程序就会崩溃,并告诉我它无法加载笔尖:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',reason: 'Could not load NIB in bundle: 'NSBundle </private/var/containers/Bundle/Application/3EA9EB93-83AC-4CD5-BA87-748D318715FA/Runner.app> (loaded)' with name 'OPPWAMobile-Resources.bundle/OPPPaymentSchemeViewController''

我花了几天时间试图解决这个问题,但是我没有办法解决这个问题。我认为问题在于,如何从框架内加载nib文件,因为捆绑软件名称不同,或者通常在其他情况下。当我将捆绑软件复制到父项目的结构中时,它可以很好地工作-但这不是我想要的。

我如何使其正常工作?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)