★ wanayoo — archive 1999 https://github.com/SVGKit/SVGKit/issues/396Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CocoaPods for '2.x' broken? #396

Closed
btraut opened this issue Dec 20, 2015 · 19 comments
Closed

CocoaPods for '2.x' broken? #396

btraut opened this issue Dec 20, 2015 · 19 comments

Comments

@btraut
Copy link

@btraut btraut commented Dec 20, 2015

I'm trying to import SVGKit into my Swift tvOS project via CocoaPods and it's not working. I'm a newbie to both Swift development and CocoaPods, so I may be doing something wrong here.

I've added SVGKit to my podfile as such:

pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'

There are no errors upon installation and a folder for SVGKit is created (as well as for CocoaLumberjack). But the folder for SVGKit is empty both in the project file as well as on disk. From this point, I have no idea if it actually installed properly, and if so, how to import it.

screen shot 2015-12-20 at 3 52 21 am

This post suggests that CocoaPods should work fine but gives no instructions. Issue #189 also asks about using SVGKit with Swift, but the instructions on that thread seem to suggest that I need to manually download/import/configure, something I was hoping CocoaPods would do for me.

Thanks in advance!

@adamgit
Copy link
Contributor

@adamgit adamgit commented Dec 20, 2015

Just a guess, but ... should the branch be "2.x" ?

On 20 December 2015 at 11:53, Brent Traut notifications@github.com wrote:

I'm trying to import SVGKit into my Swift tvOS project via CocoaPods and
it's not working I'm a newbie to both Swift development and CocoaPods, so I
may be doing something wrong here

I've added SVGKit to my podfile as such:

pod 'SVGKit', :git => 'https://githubcom/SVGKit/SVGKitgit', :branch => '2x'

There are no errors upon installation and a folder for SVGKit is created
(as well as for CocoaLumberjack) But the folder for SVGKit is empty both in
the project file as well as on disk From this point, I have no idea if it
actually installed properly, and if so, how to import it

[image: screen shot 2015-12-20 at 3 52 21 am]
https://camo.githubusercontent.com/041734392fd25b034bc8f3d08c48d34d962fd289/68747470733a2f2f636c6f756467697468756275736572636f6e74656e74636f6d2f6173736574732f3936373539312f31313931373833322f33303539343563362d613663642d313165352d393432312d326631626335396530376263706e67

This post
http://stackoverflowcom/questions/25028328/how-to-put-svgkit-in-my-project#comment38926355_25028328
suggests that CocoaPods should work fine but gives no instructions Issue
#189 #189 also asks about using
SVGKit with Swift, but the instructions on that thread seem to suggest that
I need to manually download/import/configure, something I was hoping
CocoaPods would do for me

Thanks in advance!

—
Reply to this email directly or view it on GitHub
#396.

@btraut
Copy link
Author

@btraut btraut commented Dec 20, 2015

Oh, good eye! Unfortunately, that was a copy/paste error (somehow...?). I've got it correct in my project:

pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'
@seltzered
Copy link
Contributor

@seltzered seltzered commented Dec 20, 2015

@btraut : I haven't duplicated this, but so far that looks like that should work, others have suggested the same thing and I made a pullreq ( #381 ) to add the same line to the readme. Oddly, I use cocoapods + the osx fork of svgkit, but don't even have an xcodeProjectData folder like you have in your screenshot, so go figure. Could you maybe try these things:

  1. Try actually writing a line of #import <SVGKit/SVGKit.h> (or whatever the swift equivalent is of this) somewhere, does it actually build?

  2. if not, check that your Pod > Headers > Build folder has svgkit folder with headers in there.

  3. I'm not sure if all the things for tvOS support have been rolled into the main branch yet, you may need to use the fork this PR is based on for the moment: #375

@btraut
Copy link
Author

@btraut btraut commented Dec 20, 2015

  1. Try actually writing a line of #import <SVGKit/SVGKit.h> (or whatever the swift equivalent is of this) somewhere, does it actually build?

As far as I can tell, no import statements recognize it from the Swift side. Because SVGKit is an Objective-C project, I assumed I'd need to use a bridging header, but to your second point...

  1. if not, check that your Pod > Headers > Build folder has svgkit folder with headers in there.

No, CocoaPods didn't build a folder under Pod > Headers. There's only Pod > Headers > Private, and it contains CocoaLumberjack but no SVGKit.

  1. I'm not sure if all the things for tvOS support have been rolled into the main branch yet, you may need to use the fork this PR is based on for the moment: #375

Oh, I was under the assumption that tvOS support had already merged in given the fact that there's a build target for it in the 2.x branch. I'll give that a shot and report back. Thanks!

@btraut
Copy link
Author

@btraut btraut commented Dec 20, 2015

I couldn't figure out how to get the build in #375 working.

It's a bit unrelated to this thread, but I was able to build and bridge to Swift manually:

  1. I downloaded the latest 2.x code manually. There's a tvOS target in this file, but I can't build it because it depends on a version of CocoaLumberjack that is too old to support tvOS.
  2. I downloaded the latest version of CocoaLumberjack which does support tvOS and replaced the old version in the SVGKit project.
  3. I built the tvOS version of CocoaLumberjack inside of SVGKit.
  4. This finally let me build the tvOS target of SVGKit.
  5. I took the SVGKit.framework and copied it into my own project.
  6. I added the following to my bridging header:
#import <SVGKit/SVGKImage.h>
#import <SVGKit/SVGKParser.h>
#import <SVGKit/SVGKLayer.h>
#import <SVGKit/CALayerExporter.h>
#import <SVGKit/SVGKExporterNSData.h>
#import <SVGKit/SVGKExporterUIImage.h>
#import <SVGKit/SVGKImage+CGContext.h>
  1. In my view file, I imported SVGKit as such:
import SVGKit
  1. And finally, this works!
let outerGridSVG = SVGKImage(named: "OuterGrid.svg")
@adamgit
Copy link
Contributor

@adamgit adamgit commented Jan 9, 2016

What are the two versions of Lumberjack? If it's updated considerably, can someone please try latest as a commit on its own, check its working OK, then submit a PR?

I don't want to update Lumberjack in the same commit as other changes!

@adamgit
Copy link
Contributor

@adamgit adamgit commented Jan 10, 2016

I've now upgraded project to latest Lumberjack - with tvOS compatibility - please download latest SVGKit (2.x branch) and see if it works

@alexsmith84
Copy link

@alexsmith84 alexsmith84 commented Jan 12, 2016

Hi, I too am having difficulty getting the pod to install successfully. I also use Cocoalumberjack in my project however, and this should be completely independent, 'pod install' fails while both of these pods are disabled in my Podfile. When I say "both of these pods," I'm referring to:

pod 'CocoaLumberjack/Swift' # 2.2
AND
pod 'CocoaLumberjack', '~> 1.9' # 1.9 Objective-C

I haven't tried the lengthy approach @btraut has outlined to circumvent any current errors with either Cocoapods or the Podspec this repo may have but I may try this tomorrow as a last resort.

Lastly, I'm confused as to what @btraut changed in the Podfile to include SVGKit in his project with regard to his original post.

pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'

looks identical in his first and second post. Am I missing something terribly obvious?

@adamgit
Copy link
Contributor

@adamgit adamgit commented Jan 12, 2016

2.x branch has been using lumberjack 2 for some time now, and is currently
on 2.1, so I think your podspec is out of date?

On 12 January 2016 9:21:01 am Alex Smith notifications@github.com wrote:

Hi, I too am having difficulty getting the pod to install successfully. I
also use Cocoalumberjack in my project however, and this should be
completely independent, 'pod install' fails while both of these pods are
disabled in my Podfile. When I say "both of these pods," I'm referring to:

pod 'CocoaLumberjack/Swift' # 2.2
AND
pod 'CocoaLumberjack', '~> 1.9' # 1.9 Objective-C

I haven't tried the lengthy approach @btraut has outlined to circumvent any
current errors with either Cocoapods or the Podspec this repo may have but
I may try this tomorrow as a last resort.

Lastly, I'm confused as to what @btraut changed in the Podfile to include
SVGKit in his project with regard to his original post.

pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'

looks identical in his first and second post. Am I missing something
terribly obvious?


Reply to this email directly or view it on GitHub:
#396 (comment)

@tthbalazs
Copy link

@tthbalazs tthbalazs commented Jan 12, 2016

I also have an error using cocoapods

My podfile contains this:
pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'

This is the error I get:

Errno::ENOENT - No such file or directory @ rb_sysopen - /project_path/Pods/SVGKit/XCodeProjectData/SVGKit-iOS/SVGKit-iOS-Prefix.pch

I had no problems installing previous versions (2.0.0, 1.2)

@adamgit
Copy link
Contributor

@adamgit adamgit commented Jan 12, 2016

Cocoapods is not supported, as always.

Whatever new problems CP creates: unless you can reproduce by simply
running the working, tested, preconfigured, provided projects .... you're
on your own.

On 12 January 2016 3:42:24 pm Tóth Balázs notifications@github.com wrote:

I also have an error using cocoapods

My podfile contains this:
pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'

This is the error I get:

Errno::ENOENT - No such file or directory @ rb_sysopen - 
/project_path/Pods/SVGKit/XCodeProjectData/SVGKit-iOS/SVGKit-iOS-Prefix.pch

I had no problems installing previous versions (2.0.0, 1.2)


Reply to this email directly or view it on GitHub:
#396 (comment)

@alexsmith84
Copy link

@alexsmith84 alexsmith84 commented Jan 13, 2016

I have the same error as @tthbalazs

Respectfully, @adamgit, it's not at all apparent that Cocoapods is NOT supported. In fact, the README indicates that it is! I'm using the latest stable version of Cocoapods. I don't know what version this repo may be using. 0.39.0 is the latest stable version while version 1.0.0.beta.2 is currently under development and available for public testing. Are you using a beta version? What version is @JohnWong using? Anyway, the point is that in an empty project, this pod fails to install every time.

If this project doesn't support Cocoapods, then please update the README to reflect that.

JohnWong added a commit to JohnWong/SVGKit that referenced this issue Jan 13, 2016
@adamgit
Copy link
Contributor

@adamgit adamgit commented Jan 13, 2016

Thanks for the idea on readme.

The install instructions don't cover CP, and I assumed it was obvious we
don't use it - but it would be MUCH clearer if readme were explicit!

On 13 January 2016 5:46:57 am Alex Smith notifications@github.com wrote:

I have the same error as @tthbalazs

Respectfully, @adamgit, it's not at all apparent that Cocoapods is NOT
supported. In fact, the README indicates that it is! I'm using the latest
stable version of Cocoapods. I don't know what version this repo may be
using. 0.39.0 is the latest stable version while version 1.0.0.beta.2 is
currently under development and available for public testing. Are you using
a beta version? What version is @JohnWong using? Anyway, the point is that
in an empty project, this pod fails every time.

If this project doesn't support Cocoapods, then please update the README to
reflect that.


Reply to this email directly or view it on GitHub:
#396 (comment)

@JohnWong
Copy link
Contributor

@JohnWong JohnWong commented Jan 13, 2016

@Shmaff I am using Cocoapods 0.39.0. I have found that the pch file referred in podspec file is missing. I have created a PR to fix this issue. You may wait for this PR to be merged or try this to see if it is really fixed:

pod 'SVGKit', :git => 'https://github.com/JohnWong/SVGKit.git', :branch => '2.x'
@tthbalazs
Copy link

@tthbalazs tthbalazs commented Jan 13, 2016

@JohnWong I tried your fork and it works, thank you for the quick fix.

adamgit added a commit that referenced this issue Jan 13, 2016
@adamgit
Copy link
Contributor

@adamgit adamgit commented Jan 13, 2016

Looks good to me, good find. I've merged it.

On 13 January 2016 at 10:53, John Wong notifications@github.com wrote:

@Shmaff https://github.com/Shmaff I am using Cocoapods 0.39.0. I have
found that the pch file referred in podspec file is missing. I have created
a PR to fix this issue. You may wait for this PR to be merged or try this
to see if it is really fixed:

pod 'SVGKit', :git => 'https://github.com/JohnWong/SVGKit.git', :branch => '2.x'

—
Reply to this email directly or view it on GitHub
#396 (comment).

@areiks
Copy link

@areiks areiks commented Jan 13, 2016

@adamgit Thank you, its working now

@alexsmith84
Copy link

@alexsmith84 alexsmith84 commented Jan 14, 2016

Thank you, @JohnWong and @adamgit

@adamgit
Copy link
Contributor

@adamgit adamgit commented Jan 16, 2016

As I understand it ... all is now working fine with CocoaPods (now that we've upgraded to latest Lumberjack, and fixed the reference in podfile that needed updating).

Any new problems, please open new issues, but I'm closing this as Fixed.

@adamgit adamgit closed this Jan 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.