Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 包括cocoapod上的静态框架和lib_Ios_Objective C_Swift_Cocoapods_Podspec - Fatal编程技术网

Ios 包括cocoapod上的静态框架和lib

Ios 包括cocoapod上的静态框架和lib,ios,objective-c,swift,cocoapods,podspec,Ios,Objective C,Swift,Cocoapods,Podspec,花了几个小时后,我确实需要你的帮助 我想创建一个包含Spotify SDK(,它是一个.framework)和Deezer SDK(,它是一个*.lib)的pod,以便使用它进行一些工作 这两个SDK都是用Objective-C编写的,我想用Swift(iOS 8)编写pod。此外,Swift 2(iOS 8)中包含此pod的项目 使用pod create lib创建pod项目后,我开始尝试直接在pod项目中添加Spotify.framework,但无法编译 因此,我试图通过编写podspec,

花了几个小时后,我确实需要你的帮助

我想创建一个包含Spotify SDK(,它是一个.framework)和Deezer SDK(,它是一个*.lib)的pod,以便使用它进行一些工作

这两个SDK都是用Objective-C编写的,我想用Swift(iOS 8)编写pod。此外,Swift 2(iOS 8)中包含此pod的项目

使用
pod create lib
创建pod项目后,我开始尝试直接在pod项目中添加Spotify.framework,但无法编译

因此,我试图通过编写podspec,将Spotify.framework像pod一样包括在内,这里是Spotify.podspec.json

{
  "name": "FakeSpotify",
  "version": "1.1",
  "summary": "Spotify iOS SDK",
  "homepage": "https://developer.spotify.com/technologies/spotify-ios-sdk/",
  "license": "MIT",
  "authors": {
    "jjt": "jeanjaques@thierry.com"
  },
  "source": {
    "git": "https://github.com/spotify/ios-sdk.git",
    "tag": "beta-13"
  },
  "platforms": {
    "ios": "8.0"
  },
  "requires_arc": true,
  "preserve_paths": "Spotify.framework",
  "public_header_files": "Spotify.framework/Versions/A/Headers/*.h",
  "vendored_frameworks": "Spotify.framework",
  "xcconfig": {
    "OTHER_LDFLAGS": "-ObjC"
  }
}
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target 'SpoTest_Example', :exclusive => true do
  pod 'SpoTest', :path => '../'
  pod 'FakeSpotify', :podspec => './spotify.podspec.json'
end

target 'SpoTest_Tests', :exclusive => true do
  pod 'SpoTest', :path => '../'
end
我还在播客文件中添加了一行:

{
  "name": "FakeSpotify",
  "version": "1.1",
  "summary": "Spotify iOS SDK",
  "homepage": "https://developer.spotify.com/technologies/spotify-ios-sdk/",
  "license": "MIT",
  "authors": {
    "jjt": "jeanjaques@thierry.com"
  },
  "source": {
    "git": "https://github.com/spotify/ios-sdk.git",
    "tag": "beta-13"
  },
  "platforms": {
    "ios": "8.0"
  },
  "requires_arc": true,
  "preserve_paths": "Spotify.framework",
  "public_header_files": "Spotify.framework/Versions/A/Headers/*.h",
  "vendored_frameworks": "Spotify.framework",
  "xcconfig": {
    "OTHER_LDFLAGS": "-ObjC"
  }
}
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target 'SpoTest_Example', :exclusive => true do
  pod 'SpoTest', :path => '../'
  pod 'FakeSpotify', :podspec => './spotify.podspec.json'
end

target 'SpoTest_Tests', :exclusive => true do
  pod 'SpoTest', :path => '../'
end
现在,在安装了
pod
之后,将创建一个文件夹“FakeSpotify”,其中包含Spotify.framework。这部分还可以,但还不够:我不能用它

我既不能在示例项目中导入Spotify,也不能在开发pods文件中导入Spotify(都是在Swift中)

我试图添加
#导入
pre_install do |installer|
    # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
    def installer.verify_no_static_framework_transitive_dependencies; end
end