首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将SVGKit包含到我的Rubymotion项目中?

如何将SVGKit包含到我的Rubymotion项目中?
EN

Stack Overflow用户
提问于 2014-02-24 15:27:54
回答 1查看 689关注 0票数 0

我试图在Rubymotion项目中使用SVGKit,但似乎无法构建它。

到目前为止,我已经将SVGKit代码移到了供应商/SVGKit中,并在我的Rakefile中添加了以下内容(否则是一个空白项目)

代码语言:javascript
复制
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'

begin
  require 'bundler'
  Bundler.require
rescue LoadError
end

Motion::Project::App.setup do |app|
  app.name = 'SVGKitMotion'
  app.frameworks += %w[ CoreText CoreImage libxml2.dylib QuartzCore CoreGraphics UIKit ]

  app.vendor_project('vendor/SVGKit', :static,
      :products => ["libSVGKit-iOS.1.2.0pre.a"])

end

当我试图建造它时,我得到以下信息:

代码语言:javascript
复制
     Build ./build/iPhoneSimulator-7.0-Development
     Build vendor/SVGKit
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/AppleSucksDOMImplementation.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/Attr.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CDATASection.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CharacterData.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/Comment.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CSSPrimitiveValue.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CSSRule.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CSSRuleList.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CSSStyleDeclaration.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CSSStyleRule.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CSSStyleSheet.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CSSValue.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/CSSValueList.m
Source/DOM classes/Core DOM/CSSValueList.m:47:2: warning: implicit declaration of function 'DDLogVerbose' is invalid in C99 [-Wimplicit-function-declaration]
        DDLogVerbose(@"[%@] received new CSS Text, need to split this and save as CSSValue instances: %@", [self class], _cssText);
        ^
1 warning generated.
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/Document.m
Source/DOM classes/Core DOM/Document.m:26:2: warning: implicit declaration of function 'DDLogVerbose' is invalid in C99 [-Wimplicit-function-declaration]
        DDLogVerbose( @"[%@] WARNING: SVG Spec, missing feature: if there are known attributes with default values, Attr nodes representing them SHOUL...
        ^
1 warning generated.
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/DocumentFragment.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/DocumentType.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/DOMHelperUtilities.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/Element.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/EntityReference.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/MediaList.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/NamedNodeMap.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/Node.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/NodeList.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/ProcessingInstruction.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/StyleSheet.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/StyleSheetList.m
   Compile vendor/SVGKit/Source/DOM classes/Core DOM/Text.m
   Compile vendor/SVGKit/Source/DOM classes/SVG-DOM/SVGAngle.m
   Compile vendor/SVGKit/Source/DOM classes/SVG-DOM/SVGAnimatedPreserveAspectRatio.m
   Compile vendor/SVGKit/Source/DOM classes/SVG-DOM/SVGDefsElement.m
In file included from Source/DOM classes/SVG-DOM/SVGDefsElement.m:1:
Source/DOM classes/SVG-DOM/SVGDefsElement.h:5:9: fatal error: 'SVGElement.h' file not found
#import "SVGElement.h"
        ^
1 error generated.
rake aborted!
Command failed with status (1): [/Applications/Xcode.app/Contents/Developer...]
/Library/RubyMotion/lib/motion/project/vendor.rb:114:in `block (2 levels) in build_static'
/Library/RubyMotion/lib/motion/project/vendor.rb:72:in `each'
/Library/RubyMotion/lib/motion/project/vendor.rb:72:in `block in build_static'
/Library/RubyMotion/lib/motion/project/vendor.rb:65:in `chdir'
/Library/RubyMotion/lib/motion/project/vendor.rb:65:in `build_static'
/Library/RubyMotion/lib/motion/project/vendor.rb:42:in `build'
/Library/RubyMotion/lib/motion/project/builder.rb:65:in `block in build'
/Library/RubyMotion/lib/motion/project/builder.rb:64:in `each'
/Library/RubyMotion/lib/motion/project/builder.rb:64:in `build'
/Library/RubyMotion/lib/motion/project/app.rb:76:in `build'
/Library/RubyMotion/lib/motion/project/template/ios.rb:46:in `block (2 levels) in <top (required)>'
/Library/RubyMotion/lib/motion/project/template/ios.rb:63:in `block in <top (required)>'
Tasks: TOP => build:simulator
(See full trace by running task with --trace)

有人能对我哪里出了问题提出建议吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-02-27 19:22:07

DDLogVerbose是来自CocoaLumberjack的函数。要使这件事变得简单,最好的办法是通过SVGKit安装CocoaPods。为此,首先安装

代码语言:javascript
复制
sudo gem install motion-cocoapods

这应该安装cocoapods和。您需要设置cocoapods,所以请运行

代码语言:javascript
复制
pod setup

现在,您可以在Gemfile中添加

代码语言:javascript
复制
gem 'motion-cocoapods'

接下来,将豆荚添加到您的rake文件中。

代码语言:javascript
复制
app.pods do
  pod 'SVGKit'
end

最后,运行下面的rake命令下载SVGKit

代码语言:javascript
复制
rake pod:install

下次你耙的时候,理论上一切都应该只是编译和工作!祝你好运:)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21991913

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档