2013-04-19 4 views
4

iOS 프레임 워크 프로젝트를 생성하고 .podspec을 추가했습니다. 프레임 워크는 포함 된 데모 프로젝트뿐만 아니라 잘 생성됩니다. 하지만 pod spec lint 테스트 중에 오류가 발생합니다.CocoaPods spec lint가 오류를 발생시킵니다.

내가 사용하고있어 podspec 파일은

Pod::Spec.new do |s|s.name   = "HorizontalPicker" 
s.version  = "1.0.0" 
s.summary  = "A similar to UIPickerView but horizontal picker view." 
s.homepage  = "https://github.com/HHuckebein/HorizontalPicker" 
s.license  = { :type => 'MIT', :file => 'LICENSE.txt' } 
s.author  = { "RABE_IT Services" => "[email protected]" } 
s.source  = { :git => "https://github.com/HHuckebein/HorizontalPicker.git", :tag => "1.0.0" } 
s.platform  = :ios, '5.1' 
s.source_files = 'HorizontalPicker/*.{h,m}' 
s.framework = 'QuartzCore' 
s.requires_arc = true 
end 


-> HorizontalPicker (1.0.0) 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:42:30: error: unknown type name 'CAShapeLayer' 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:42:1: error: property with 'retain (or strong)' attribute must be of object type 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:63:16: error: property 'masksToBounds' cannot be found in forward class object 'CALayer' 
- NOTE | [xcodebuild] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:82:75: note: forward declaration of class here 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:112:32: error: member reference base type 'int *' is not a structure or union 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:319:21: error: property 'borderColor' cannot be found in forward class object 'CALayer' 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:320:21: error: property 'borderWidth' cannot be found in forward class object 'CALayer' 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:340:33: error: property 'borderWidth' cannot be found in forward class object 'CALayer' 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:341:33: error: property 'borderColor' cannot be found in forward class object 'CALayer' 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:401:10: error: use of undeclared identifier 'CAGradientLayer' 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:410:3: error: unknown type name 'CAGradientLayer'; did you mean 'CGGradientRef'? 
- NOTE | [xcodebuild] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h:8:28: note: 'CGGradientRef' declared here 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:410:37: error: use of undeclared identifier 'CAGradientLayer'; did you mean 'gradientLayer'? 
- NOTE | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:410:20: note: 'gradientLayer' declared here 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:410:54: error: expected expression 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:411:16: error: member reference base type 'CGGradientRef *' (aka 'struct CGGradient **') is not a structure or union 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:412:16: error: member reference base type 'CGGradientRef *' (aka 'struct CGGradient **') is not a structure or union 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:414:22: error: member reference base type 'CGGradientRef *' (aka 'struct CGGradient **') is not a structure or union 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:416:22: error: member reference base type 'CGGradientRef *' (aka 'struct CGGradient **') is not a structure or union 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:436:10: error: use of undeclared identifier 'CAGradientLayer'; did you mean 'gradientLayer'? 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:436:10: error: reference to local variable 'gradientLayer' declared in enclosing context 
- ERROR | [xcodebuild] HorizontalPicker/HorizontalPicker/HPickerView.m:436:10: error: bad receiver type 'CGGradientRef *' (aka 'struct CGGradient **') 
- ERROR | [xcodebuild] fatal error: too many errors emitted, stopping now [-ferror-limit=] 

1 podspec를 분석이다.

[!] 사양이 유효성 검사를 통과하지 못했습니다.

편집 디렉토리 구조는 이와 유사합니다. /HorizontalPicker/HorizontalPicker.podspec /HorizontalPicker/HorizontalPicker/소스 코드는 내가/내 tmp에 생성 된 테스트 포드 잎

pod spec lint --no-clean ... 

을 사용하여 무슨 일이 있었는지 확인하려면 여기

+0

수입이 누락 되었습니까? 개발할 때이 라이브러리를 컴파일하는 테스트 프로젝트가 있습니까? – wattson12

+0

아니오 및 예. 데모 프로젝트와 프레임 워크 모두 잘 작동합니다. –

+0

글쎄, 최소한 lint를 실행할 때 QuartzCore가 여기에없는 것 같지만 프로젝트에 포함되어 있습니다. –

답변

7

살고있다. 그래서 QuartzCore가 pch 파일에 추가 된 것을 발견했습니다. 이것은 정상적인 프로젝트에서는 괜찮지 만 클래스 파일에서는 그렇지 않습니다.

그래서 최고의 코딩 스타일이 아니 었습니다.

5

필자의 경우 lint는 iOS SDK 대신 OS X SDK에 대한 사양을 테스트하고있었습니다.

두 플랫폼 모두 보안 프레임 워크가 있지만 API는 동일하지 않으므로 오류가 발생합니다.

podspec에 s.platform = :ios을 추가하기 만하면됩니다.

+0

이 전체적인 일은 제게 당황 스럽습니다. 감사! – onekiloparsec

관련 문제