为什么使用自定义框架/库在React Native应用程序中找不到cocoapod模块?

时间:2018-08-21 08:32:55

标签: ios react-native cocoapods podspec podfile

我正在开发React Native应用程序。

React Native应用程序包括我自己开发的自定义React Native框架/库。

该框架是通过NPM从GitHub安装的。

该框架的ios文件夹中有一个podspec文件,其外观如下:

Pod::Spec.new do |s|
  s.name         = "RNAppFramework"
  s.version      = "0.1.0"
  s.summary      = "A short description of the app."
  s.description  = 'Lorem Ipsum'
  s.homepage     = "http://lorem/ipsum"
  s.license      = "MIT"
  s.author       = { "mian" => "example@mian.com" }
  s.platform     = :ios, "11.4"
  s.source       = { :git => 'https://github.com/example/examples-repo.git', :branch => 'develop' }
  s.source_files = '**/*.{h,m}'
  s.dependency 'React'
  s.dependency 'AudioKit', '~> 4.3'
  s.dependency 'SwiftyJSON', '~> 4.1'
  s.dependency 'SwiftSiriWaveformView', '~> 2.4'

  s.static_framework = true
end

应用程序本身在其ios文件夹中具有一个Podfile,如下所示:

# Uncomment the next line to define a global platform for your project
platform :ios, '11.4'

# ignore all warnings from all pods
inhibit_all_warnings!

target 'RNApp' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  pod 'React', path: '../node_modules/react-native', subspecs: [
    'Core',
    'jschelpers',
    'cxxreact',
    'CxxBridge',
    'DevSupport',
    'RCTText',
    'RCTImage',
    'RCTNetwork',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTWebSocket',
  ]

  pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'

  pod 'RNAppFramework', path: '../node_modules/rn-app-framework/ios'
end

但是,无论出于何种原因,应用程序都会抱怨No such module 'AudioKit',尽管它是通过pods install安装的。

pod install的详细输出如下:

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target
  `Pods-RNApp`: (``)

Finding Podfile changes
  - DoubleConversion
  - Folly
  - RNAppFramework
  - React
  - glog
  - yoga

Fetching external sources
-> Fetching podspec for `RNAppFramework` from `../node_modules/rn-app-framework/ios`
-> Fetching podspec for `React` from `../node_modules/react-native`
-> Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga`

Resolving dependencies of `Podfile`

Comparing resolved specification to the sandbox manifest
  M RNAppFramework
  - AudioKit
  - DoubleConversion
  - Folly
  - React
  - SwiftSiriWaveformView
  - SwiftyJSON
  - boost-for-react-native
  - glog
  - yoga

Downloading dependencies

-> Using AudioKit (4.3)

-> Using DoubleConversion (1.1.5)

-> Using Folly (2016.10.31.00)

-> Installing RNAppFramework 0.1.0

-> Using React (0.56.0)

-> Using SwiftSiriWaveformView (2.4.0)

-> Using SwiftyJSON (4.1.0)

-> Using boost-for-react-native (1.63.0)

-> Using glog (0.3.4)

-> Using yoga (0.56.0.React)
  - Running pre install hooks

Generating Pods project
  - Creating Pods project
  - Adding source files to Pods project
  - Adding frameworks to Pods project
  - Adding libraries to Pods project
  - Adding resources to Pods project
  - Adding development pod helper files to Pods project
  - Linking headers
  - Installing targets
    - Installing target `DoubleConversion` iOS 9.0
      - Generating module map file at `Pods/Target Support
      Files/DoubleConversion/DoubleConversion.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/DoubleConversion/DoubleConversion-umbrella.h`
      - Generating Info.plist file at `Pods/Target Support
      Files/DoubleConversion/Info.plist`
    - Installing target `Folly` iOS 9.0
      - Generating module map file at `Pods/Target Support
      Files/Folly/Folly.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/Folly/Folly-umbrella.h`
      - Generating Info.plist file at `Pods/Target Support
      Files/Folly/Info.plist`
    - Installing target `RNAppFramework` iOS 11.4
      - Generating module map file at `Pods/Target Support
      Files/RNAppFramework/RNAppFramework.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/RNAppFramework/RNAppFramework-umbrella.h`
    - Installing target `React` iOS 9.0
      - Generating module map file at `Pods/Target Support
      Files/React/React.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/React/React-umbrella.h`
      - Generating Info.plist file at `Pods/Target Support
      Files/React/Info.plist`
    - Installing target `SwiftSiriWaveformView` iOS 8.3
      - Generating module map file at `Pods/Target Support
      Files/SwiftSiriWaveformView/SwiftSiriWaveformView.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/SwiftSiriWaveformView/SwiftSiriWaveformView-umbrella.h`
      - Generating Info.plist file at `Pods/Target Support
      Files/SwiftSiriWaveformView/Info.plist`
    - Installing target `SwiftyJSON` iOS 8.0
      - Generating module map file at `Pods/Target Support
      Files/SwiftyJSON/SwiftyJSON.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/SwiftyJSON/SwiftyJSON-umbrella.h`
      - Generating Info.plist file at `Pods/Target Support
      Files/SwiftyJSON/Info.plist`
    - Installing target `glog` iOS 9.0
      - Generating module map file at `Pods/Target Support
      Files/glog/glog.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/glog/glog-umbrella.h`
      - Generating Info.plist file at `Pods/Target Support
      Files/glog/Info.plist`
    - Installing target `yoga` iOS 9.0
      - Generating module map file at `Pods/Target Support
      Files/yoga/yoga.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/yoga/yoga-umbrella.h`
      - Generating Info.plist file at `Pods/Target Support
      Files/yoga/Info.plist`
    - Installing target `Pods-RNApp` iOS 11.4
      - Generating Info.plist file at `Pods/Target Support
      Files/Pods-RNApp/Info.plist`
      - Generating module map file at `Pods/Target Support
      Files/Pods-RNApp/Pods-RNApp.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/Pods-RNApp/Pods-RNApp-umbrella.h`
  - Running post install hooks
  - Writing Xcode project file to `Pods/Pods.xcodeproj`
    - Generating deterministic UUIDs
  - Writing Lockfile in `Podfile.lock`
  - Writing Manifest in `Pods/Manifest.lock`

Integrating client project

Integrating target `Pods-RNApp` (`RNApp.xcodeproj` project)
  Removing old Pod product reference libPods-RNApp.a from project.
  Adding Build Phase '[CP] Embed Pods Frameworks' to project.
  - Running post install hooks
    - cocoapods-stats from
    `/Library/Ruby/Gems/2.3.0/gems/cocoapods-stats-1.0.0/lib/cocoapods_plugin.rb`

Sending stats
      - AudioKit, 4.3
      - DoubleConversion, 1.1.5
      - Folly, 2016.10.31.00
      - React, 0.56.0
      - SwiftSiriWaveformView, 2.4.0
      - SwiftyJSON, 4.1.0
      - boost-for-react-native, 1.63.0
      - glog, 0.3.4

-> Pod installation complete! There are 16 dependencies from the Podfile and 10 total pods installed.

我想念什么吗?

0 个答案:

没有答案