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
how to use WhirlyGlobe with swift #543
Comments
It's not the Swift part, I think, it looks like missing Protobuf methods. Which podspec are you using? The one in the central pod repo is out of date. Try using the one in the develop_2_4_1 branch. |
Hi Steve: Thanks for your fast reply. I tried both pod 'WhirlyGlobe' pod 'WhirlyGlobe -> 2.3' when I ran the pod install. it install all the files automatically. How can I include branch_2_4_1 into my workspace? |
You can use the podspec directly from the 2.4 tree. |
Thanks again for your reply. It's my first time to use podspec, Can you tell me how to use it? In the past, I only know how to install with pod 'module name'. |
There are instructions on Cocoapods.org. |
Thank you so much!!! However, This error hit me when I try to build. Use of undeclared identifier SQLITE_OPEN_READONLY. I am still not quite get the idea. Can you tell me what to do to remove this error? |
Above the include for fmdb, just include the sqlite3 header. I think it's just sqlite3.h or something similar. |
Sorry to bother you again. new problem detected. AFHTTPRequestOperationManager.h file not found this file is removed from AFNetworking 3.0. what should I do? |
For 2.4, you can change the Podfile to request an earlier version of AFNetworking. Or you could switch to the develop_2_4_1 branch where we've removed the AFNetworking dependency. |
How can I change to the earlier version of AFNetworking? when I use pod 'WhirlyGlobe', :git => 'https://github.com/mousebird/WhirlyGlobe.git', :tag => 'v2.4' But it doesn't work. |
I appear to be the owner of the WhirlyGlobe pod in cocoa pods. I didn’t realize that 2.4 had been released. If you’d like, I’ll push the 2.4 podspec for general availability. (modulo the fixes that Zheng Wu needs) That ok with you, Steve? Juan
|
I wouldn't mind some help with the 2.4 podspec, sure! We've taken control of the podspec generation now and it works fine for 2.4.1 and generally for 2.4 when we reference it directly from the repo. However, I've been unable to push the new podspec for 2.4 because the lint process takes for-freaking-ever and then fails. |
@zhengwu123 to use 2.4.1 you have to specify the branch in your pod: pod 'WhirlyGlobe', :git => 'https://github.com/mousebird/WhirlyGlobe.git', :branch => 'develop_2_4_1' Not sure if this fixes your errors, but probably does |
Steve, Jose, I’ve got the podspec set for 2.4 (and one for 2.4.1). I can push the 2.4 one to cocoa pods today. Here’s the verify: — ….. Many warnings ... Analyzed 1 podspec. [!] The spec did not pass validation, due to 1 error and 125 warnings. Hey, look there are a couple of C++ errors. Beats me why, but when I do a pod install against 2.4 and a test application, it works fine. Included is the 2.4 podspec for your review: If you’re good with it, I’ll push it. Juan
|
hey @jcollas We have similar issues about bridging problems between Swift and Obj-C++. |
Jose, Nope. I tested against a swift application I had (my rewrite of the MaplyComponentTester). No problems at all, except for having to add a search path to get to the wg version of kissxml. I think the podspec I sent for 2.4 would work fine for 2.4.1 too. Juan
|
Can you push your new Podspec somewhere? I'd like to try it both with 2.4 and 2.4.1 Thanks! |
Jose, I’ve updated the issue with the podspec: If it works properly for you, let me know and I’ll push it to Cocoapods as WhirlyGlobe 2.4 Enjoy, Juan
|
I had some trouble with private vs public headers in Cocoapods. I might have solved them by making all the headers public. Actually, I think that's it. The problem was that someone needed access to the WhirlyGlobeLib headers to do some deep implementation. Is there anyway to make those public but keep Swift away from them? |
I'm wondering if we're going to need two Cocopods or at least two subsets within the podspec. I need to let some people have access to the WhirlyGlobeLib headers for deep C++ magic. But exposure to those is fatal for Swift. So maybe we just need a Swift only podspec? Of course, then you'd have trouble writing Swift modules and Obj-C++ models in the same Pod-using app. That's not ideal. Is there someway to #ifdef out a Swift compile? Something I can put in the headers perhaps? |
Yeah, Swift includes a (very basic) preprocessor. Anyway, the test I did failed even with an ObjC project. I guess we need to narrow it down with ObjC projects and then fix it with Swift (with the same or different podspec) @jcollas do you think public/private headers as Steve suggests may be the cause? |
I worked on this a little last night, and made a few changes to the podspec for 2.4.1 which allow it to compile cleanly. It almost works for 2.4 also, but there are several include files which used angled brackets to refer to WhirlyGlobe header files, and Xcode just hates that. Steve's right, I had to make the WhirlyGlobeLib headers private, but I think I can get around that by making them private only when using them from the MaplyComponent-Headers. Then everything should work properly. Try this one for 2.4.1 (I'm going against the develop_2_4_1 branch) |
Great! it works like a charm, both for ObjC and Swift! Since 2.4.1 is in beta, we cannot push this spec to cocoapods. However, if you can make the 2.4 spec work like this (only ObjC, Swift support is introduced in 2.4.1) we can push it right away. Thanks @jcollas you're our pod master! (: |
Thanks. I want to see if I can make the WhirlyGlobeLib headers public again, but private when building MaplyComponent first. I cannot make the podspec work for 2.4 unless Steve removes the angled bracket include references, but I'll look into it further. |
@jcollas let me know where angled brackets need to be removed and I'll do it Thanks! |
Here's the 'pod spec lint' for the WhirlyGlobe 2.4 podspec I have. ...
If you can replace the <> with "", it'll work like a charm for 2.4. I know you've already done that for 2.4.1 |
@jmnavarro are you planning on patching the v2.4 tag to include the header changes? If not, I'll finish up my changes to the 2.4.1 podspec and PR it to you ... If you are, let me know and I'll submit a 2.4 WhirlyGlobe podspec. |
José has a branch that should have it fixed. I need to test it in a couple of other situations and then I'll merge it back in for 2.4. |
Hey @zhengwu123 Thanks to @jcollas we have a brand-new pod. Can you try again with the branch "develop_2_4_1"
Let us know how it goes Thanks! |
@jcollas this is the branch with your podspec https://github.com/mousebird/WhirlyGlobe/commits/pod-2.4 @mousebird will recreate tag Thanks for being so responsive! |
I merged in @jmnavarro's branch and redid the v2.4 tag. |
It works for me @jcollas I thought the podspec for 2.4 was already pushed, but it isn't. I guess you can do it when you have a chance |
@jmnavarro I pushed your podspec from your branch. Is there another variant? |
@mousebird I meant pushed to cocoapods.org. Once the podspec is working, we should push it there (right now we only have podspec for 2.3) |
Yes, that would be good. @jcollas was going to do it, I think. The tag should now be updated. |
Ok, 2.4 podspec is pushed to the cocoa pods repo. the spec wouldn't validate until I added a library reference for xml2 to kissxml. Since you moved the tag on v2.4, you may need to put in a note to remove ~/Library/Caches/CocoaPods/Pods/External/WhirlyGlobe which would have the older cached version with the angled brackets in the includes. If possible, I'd like to change the references to local_libs in WhirlyGlobe to their equivalent podspec references for future releases. |
I'd be happy to get rid of the local_libs. I guess we'd need to set up pod specs for some of them and figure out how to use the others. glues in particular has some local changes to let us get along with Google Map. |
Hi
I am installed WhirlyGlobe with cocoapods.
I encountered a problem when I try to compile(IOS9 - Swift).
Ld /Users/new/Library/Developer/Xcode/DerivedData/SocialEarth-fvgdvcqmdxctywcyhjryfsxyvnnc/Build/Products/Debug-iphoneos/GoogleProtobuf.framework/GoogleProtobuf normal arm64
cd "/Users/new/Desktop/swift learning/SocialEarth/Pods"
export IPHONEOS_DEPLOYMENT_TARGET=9.2
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -L/Users/new/Library/Developer/Xcode/DerivedData/SocialEarth-fvgdvcqmdxctywcyhjryfsxyvnnc/Build/Products/Debug-iphoneos -F/Users/new/Library/Developer/Xcode/DerivedData/SocialEarth-fvgdvcqmdxctywcyhjryfsxyvnnc/Build/Products/Debug-iphoneos -filelist /Users/new/Library/Developer/Xcode/DerivedData/SocialEarth-fvgdvcqmdxctywcyhjryfsxyvnnc/Build/Intermediates/Pods.build/Debug-iphoneos/GoogleProtobuf.build/Objects-normal/arm64/GoogleProtobuf.LinkFileList -install_name @rpath/GoogleProtobuf.framework/GoogleProtobuf -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -miphoneos-version-min=9.2 -dead_strip -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -framework Foundation -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/new/Library/Developer/Xcode/DerivedData/SocialEarth-fvgdvcqmdxctywcyhjryfsxyvnnc/Build/Intermediates/Pods.build/Debug-iphoneos/GoogleProtobuf.build/Objects-normal/arm64/GoogleProtobuf_dependency_info.dat -o /Users/new/Library/Developer/Xcode/DerivedData/SocialEarth-fvgdvcqmdxctywcyhjryfsxyvnnc/Build/Products/Debug-iphoneos/GoogleProtobuf.framework/GoogleProtobuf
Undefined symbols for architecture arm64:
"deflate", referenced from:
google_public::protobuf::io::GzipOutputStream::Deflate(int) in gzip_stream.o
"inflate", referenced from:
google_public::protobuf::io::GzipInputStream::Inflate(int) in gzip_stream.o
"inflateInit2", referenced from:
google_public::protobuf::io::internalInflateInit2(z_stream_s, google_public::protobuf::io::GzipInputStream::Format) in gzip_stream.o
"deflateEnd", referenced from:
google_public::protobuf::io::GzipOutputStream::Close() in gzip_stream.o
"deflateInit2", referenced from:
google_public::protobuf::io::GzipOutputStream::Init(google_public::protobuf::io::ZeroCopyOutputStream, google_public::protobuf::io::GzipOutputStream::Options const&) in gzip_stream.o
"inflateEnd", referenced from:
google_public::protobuf::io::GzipInputStream::~GzipInputStream() in gzip_stream.o
google_public::protobuf::io::GzipInputStream::Next(void const*, int) in gzip_stream.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please help me out
The text was updated successfully, but these errors were encountered: