这是简短的版本:
我跑的时候
pod install
Run Code Online (Sandbox Code Playgroud)
在我得到的Xcode项目中
[!] Pod :: Executable pull error:无法打开.git/FETCH_HEAD:权限被拒绝
如果我跑
sudo pod install
Run Code Online (Sandbox Code Playgroud)
我没有得到任何错误,但是我安装的文件是root所有并且无法编译,我必须将chown这些文件发送给普通用户才能使用Xcode编译器.
我正在运行Lion OSX.
我使用安装了cocoaPods
sudo gem install cocoaPods
Run Code Online (Sandbox Code Playgroud)
我不得不使用sudo因为没有它我得到了
错误:执行gem时...(Gem :: FilePermissionError)
您没有写入/Library/Ruby/Gems/1.8目录的权限.
所以现在我有一个root安装版本的cocoaPods下载了root拥有的Xcode库.
是以sudo正确的方式安装cocoaPods吗?
如果正常,有没有办法解决pod安装问题?
我想问一下然后回答这个问题.
我想更新我的应用程序内置的CocoaPods,所以我pod install从终端运行.
那是我收到这个错误的时候:
[!] The `APP_NAME [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Run Code Online (Sandbox Code Playgroud)
你如何使用$(继承)标志?
什么是Cocoapods?我已经看到很多开发人员在开发用于安装API的应用程序时一直在使用Pod,但我并不了解为什么你不能手动导入文件.他们的目的是什么,他们有什么用?
我有一个已经存在于CocoaPods/Specs中的库的公共分支.在Podfile中,我可以通过执行以下操作来引用此分叉的pod:
pod 'CoolLibrary', :git => 'git@github.com:myname/CoolLibrary-Forked.git', :commit => 'abcdef1234567890abcdef1234567890'
Run Code Online (Sandbox Code Playgroud)
我试着把它放在我的MyLibrary.podspec:
s.dependency 'CoolLibrary', :git => 'git@github.com:myname/CoolLibrary-Forked.git', :commit => 'abcdef1234567890abcdef1234567890'
Run Code Online (Sandbox Code Playgroud)
但是请收到以下错误消息:
-> MyLibrary.podspec
- ERROR | The specification defined in `MyLibrary.podspec` could not be loaded.
[!] Invalid `MyLibrary.podspec` file: [!] Unsupported version requirements. Updating CocoaPods might fix the issue.
Run Code Online (Sandbox Code Playgroud)
是否可以以这种方式在.podspec中指定依赖项(即对于具有podspec但不在CocoaPods/Specs中的pod)?
我尝试通过CocoaPods集成Fabric/Crashlytics,我的Podfile看起来像这样:
pod 'Fabric/Core', '1.2'
pod 'Fabric/Crashlytics', '1.2'
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试构建我的应用程序时,构建失败,我得到一个Shell Script Invocation Error未找到运行脚本:
.../Script-F8D74CB61AB5D7A50013D134.sh: line 2: ./Fabric.framework/run: No such file or directory
Run Code Online (Sandbox Code Playgroud)
是否可以仅使用CocoaPods安装Fabric?
我已经通过它安装了可可豆荚库和一些框架.现在当我编译项目时,构建失败了.
错误:ld:找不到-lPods-Project clang的库:错误:链接器命令失败,退出代码为1(使用-v查看调用)
这里是部分文字:
Ld /Users/polzovatel/Library/Developer/Xcode/DerivedData/Project-bybevfqrgvqqldbzsgewqafpmylj/Build/Products/Debug-iphonesimulator/Project app/Project normal i386
cd /Users/polzovatel/Projects/iOS-master/Project_iPhone
export IPHONEOS_DEPLOYMENT_TARGET=6.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Run Code Online (Sandbox Code Playgroud)
我需要做些什么来解决这个问题?
我有一个iOS/OS X Xcode项目,我正在使用CocoaPods,我似乎无法弄清楚如何添加我自己的项目配置(除了Debug和Release)而不会完全破坏构建.
在项目中,我有许多目标,适用于两个平台及其应用扩展的应用.Xcode工作区当然也有Pods项目.
因为该项目为iOS和Mac构建目标,所以我使用CocoaPods"目标"将其pod组合在一起.我的Podfile看起来像这样:
source 'https://github.com/CocoaPods/Specs.git'
target :iOS do
platform :ios, '7.1'
link_with 'iOS', 'NozbeToday', 'NozbeShare', 'NozbeWatch'
# pods...
end
target :Mac do
platform :osx, '10.9'
link_with 'Mac'
# pods...
end
Run Code Online (Sandbox Code Playgroud)
现在我在这里遇到问题.到目前为止,我的项目中只有默认的"Debug"和"Release"配置.我想更改它们并为不同的配置文件/捆绑ID组合添加一些新的.
......我被困住了.我无法弄清楚如何做到这一点.
问题的第一个迹象是pod install针对每个目标/配置组合发出警告:
[!] CocoaPods没有设置项目的基本配置,因为您的项目已经有自定义配置集.为了使CocoaPods集成完全可用,请将目标的基本配置设置
NozbeToday为Pods/Target Support Files/Pods-iOS/Pods-iOS.dev debug.xcconfig或包含Pods/Target Support Files/Pods-iOS/Pods-iOS.dev debug.xcconfig在构建配置中.
我无法弄清楚它意味着什么以及如何解决这个问题.无论哪种方式,项目都不会构建 - 在最好的情况下,我会得到一个链接器错误,说它无法找到Pods-something.a...
我"pod update",我的RestKit版本现在是0.25.0,我的RKValueTransformers是1.1.2,并且找不到错误"RKObjectMapping.h".
RestKit在新版本中的变化是什么,我检查它的github无法找到任何东西.
以下步骤可以重现错误:
1)创建一个新项目
2)pod init
Podfile看起来像:
platform :ios, '8.3'
#pod 'RestKit', '~> 0.20.0'
#pod 'RestKit', '~> 0.24.1'
pod 'RestKit'
Run Code Online (Sandbox Code Playgroud)
在所有不同版本的情况下,问题都是一样的
3)打开.xcworkspace
4)在viewcontroller.m中
#import <RestKit/ObjectMapping/RKObjectMapping.h>
#import <RestKit/ObjectMapping/RKRelationshipMapping.h>
#import <RestKit/Network/RKResponseDescriptor.h>
#import <RestKit/Network/RKObjectRequestOperation.h>
#import <RestKit/Support/RKLog.h>
#import <RestKit/CoreData/RKEntityMapping.h>
#import <RestKit/Network/RKObjectManager.h>
Run Code Online (Sandbox Code Playgroud)
要么
#import "RKObjectMapping.h"
#import "RKRelationshipMapping.h"
#import "RKResponseDescriptor.h"
#import "RKObjectRequestOperation.h"
#import "RKLog.h"
#import "RKEntityMapping.h"
#import "RKObjectManager.h"
Run Code Online (Sandbox Code Playgroud)
错误仍然存在:在RestKit Pod的文件中找不到"RKObjectMapping.h"
注意:我使用的是Xcode 7-beta5,Objective-C
我刚刚开始一个反应本机项目。然而这个问题却困扰了我一天。我尝试了所有可能的方法来解决它。例如,
sudo gem uninstall cocoapods
rvm uninstall
brew install cocoapods
Run Code Online (Sandbox Code Playgroud)
然而,我却没有运气。我想指出,我可以pod --version在其他路径下,但当我尝试pod在我的项目路径下时会出现问题。我还尝试将rvm默认版本设置为2.7.5,但问题仍然发生。另外,我没有使用Apple M1
Traceback (most recent call last):
4: from /Users/nicholas/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `<main>'
3: from /Users/nicholas/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `eval'
2: from /Users/nicholas/.rvm/gems/ruby-2.7.5/bin/pod:23:in `<main>'
1: from /Users/nicholas/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems.rb:296:in `activate_bin_path'
/Users/nicholas/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems.rb:277:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
Run Code Online (Sandbox Code Playgroud) 更新到CocoaPods 0.36.x后,我无法将导入添加到我的Bridging-Header.h文件中.我得到"找不到DBSphereView.h文件".
该文件确实存在于:
"Pods/DBSphereTagCloud/DBSphereView.h"
"Headers/public/DBSphereTagCloud/DBSphereView.h"
"Headers/private/DBSphereTagCloud/DBSphereView.h"
Run Code Online (Sandbox Code Playgroud)
我的桥文件:
#ifndef Loan_Bridging_Header_h
#define Loan_Bridging_Header_h
#import "DBSphereView.h"
#endif
Run Code Online (Sandbox Code Playgroud)
我可以使用框架.我参考了一个众所周知的框架(Alamofire),它很棒!
我的podfile:
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
pod 'DBSphereTagCloud', '~> 1.0'
pod 'Alamofire', '~> 1.1'
Run Code Online (Sandbox Code Playgroud)
在更新之前,我没有导入头文件的问题.
在将CocoaPods更新为0.36.x后,如何在Bridging-Header.h中引用头文件?
谢谢!
编辑:
我还尝试根据cocoapods.org的"Get Started"示例创建一个单独的项目,但没有成功.使用框架后,我似乎无法在我的桥接头文件中引用头文件.我一定错过了一些细节?
cocoapods ×10
ios ×4
objective-c ×4
crashlytics ×1
react-native ×1
restkit ×1
ruby ×1
rubygems ×1
swift ×1
xcode ×1