KKGridView icon indicating copy to clipboard operation
KKGridView copied to clipboard

Archiving: how to?

Open hermanolsson opened this issue 12 years ago • 13 comments

I still have great problems archiving my project when using KKGridView. I found the closed issue #62, but the answer there doesnt help me out. The strangest thing is that I can archive the demo project. Is there any solution out there? Anyone who have fixed this and can write up a nice guide?

hermanolsson avatar Mar 20 '12 19:03 hermanolsson

I played with making this work quite a bit. Ultimately I ended up making some changes to the #import declarations and placing the headers in a specific location during the build. The changes to the application project then require you to add $(BUILT_PRODUCTS_DIR)/../../KKGridView and $(BUILT_PRODUCTS_DIR)/../KKGridView to the Header Search Paths. My changes are here https://github.com/appRenaissance/KKGridView/tree/fix-xcode4-archiving

I'm not sure what the benefit of the #import <KKGridView/KKGridView.h> import are over #import "KKGridView.h", but I couldn't get everything working nicely with my build configurations without those changes.

adamvduke avatar Mar 30 '12 14:03 adamvduke

Caveat: I didn't realize how far my fork/branch is behind kolinkrewinkel/master.

adamvduke avatar Mar 30 '12 19:03 adamvduke

@hermanolsson hi,I clone the lastest code, the same problem, I cannot even archive demo project. Now any solution? @adamvduke I pull your code, but still cannot archive code in fix-xcode4-archiving branch.

fji8ejfijai83r avatar May 14 '12 15:05 fji8ejfijai83r

@hiessu I have been using commit 27850d8e241faa6aae94ae4ec258a2037e531b5e for a client project with success archiving. I have a branch called merge-branch at that commit. I had a few fixes that I made separate pull requests for and merged them all into that branch until things work themselves out upstream.

adamvduke avatar May 14 '12 15:05 adamvduke

@adamvduke hi, I am still confused... change <KKGridView/KKxx.h> to "KKxx.h" and KKGridVIew project Header Search Path?

fji8ejfijai83r avatar May 14 '12 16:05 fji8ejfijai83r

I build KKGridView as a dependency to my main project.

Using my fork/merge-branch I have $(BUILT_PRODUCTS_DIR)/../../KKGridView and $(BUILT_PRODUCTS_DIR)/../KKGridView in my project's header search paths. Anywhere I want to use a KKGridView class I import the header as #import "KKxxx.h"

adamvduke avatar May 14 '12 16:05 adamvduke

Thanks a lot! I pull your merge-branch, finally firgure out how to do.

fji8ejfijai83r avatar May 15 '12 02:05 fji8ejfijai83r

I found out, that in KKGridView.xcodeproj -> Build Settings -> Public Header Folder Path there was include/$(PROJECT_NAME) standing there. Which is include/KKGridView

Changing this to ../../Headers/$(TARGET_NAME), like the guys from RestKIT and SDWebImage do, solved the problem.

etatsu avatar May 30 '12 09:05 etatsu

Really need a step by step guide for this. I've been spending two half days (guess that's like one whole :-) trying to get archiving to work.

The app builds for simulator and devices, but if I want to do Product > Archive in Xcode it can not find the header files. "Lexical or Preprocessor Issue ' KKGridView/KKGridView.h' file not found" is shown for each of my files where I import a KKGridView header.

Maybe this would help: I can also not import KKGridView.h for normal builds (file not found) but I have to import KKGridViewViewController.h or KKGridViewCell.h if I want to succeed to build for simulator or device. I have tried deleting all KKGridView stuff and downloading again and played around along time with various Header Search path combinations.

It will build, but not archive. It's pretty critical as it holds me back from creating an .ipa for beta testers.

chrhansen avatar Jun 06 '12 14:06 chrhansen

@Christian-Hansen Follow https://github.com/kolinkrewinkel/KKGridView/issues/111#issuecomment-5694977 and http://blog.slidetorock.com/using-a-static-library-in-xcode-4#!/,make sure User header Path includes $(BUILT_PRODUCTS_DIR)/../KKGridView and $(BUILT_PRODUCTS_DIR)/../../KKGridView, directly #import "KKxxx.h". Maybe https://github.com/kolinkrewinkel/KKGridView/issues/111#issuecomment-6005902 is also ok, but I haven't tried.

fji8ejfijai83r avatar Jun 07 '12 02:06 fji8ejfijai83r

Thanks @hiessu - I have tried all three suggestions and a few hundred other things, but archiving still doesn't work. I can build to simulator and device but as soon as I try archiving the header files for KKGridView can't be found. Tried the various combinations: #import "KKxxx.h" #import <KKGridView/KKGridView.h> etc. works in normal builds but not for archiving. Could someone post their folder structure and matching build settings (not sure if it's possible to attach a photo in Issues on GitHub)? I'm suspecting it's a simple mistake I've made, but if I can't solve the KKGridView archive issue I will have to get rid of KKGridView so I can get my app on the app store.

chrhansen avatar Jun 13 '12 09:06 chrhansen

@Christian-Hansen & @hiessu

I was able to get the GridViewDemo project to archive by just changing the Skip Install build setting on the KKGridView project to NO.

I was also able to update my client project to https://github.com/kolinkrewinkel/KKGridView - master by changing the same setting in KKGridView project along with changing my header import statements to the #import <KKGridView/xxx.h> style. I was also able to remove the $(BUILT_PRODUCTS_DIR)/../KKGridView and $(BUILT_PRODUCTS_DIR)/../../KKGridView lines from my header search paths.

In both projects regular debug builds and archive builds work and produce complete archives.

It may be worth noting that I am using Xcode 4.3.2

adamvduke avatar Jun 13 '12 19:06 adamvduke

Thanks for you help guys. After trying every suggestion for build settings and I still couldn't make it work I gave up trying to fix the project and started all over in new Xcode project - and now it works, I can archive.

First thing I did was making the new empty project into a Workspace and then integrating KKGridView as it is explained on the first page of KKGridView here on GitHub. Then I began dragging in all my classes from the old project and testing archiving once in a while to make sure it still would work, now I've almost integrated everything and archiving still works.

So I guess I must have had some wrong build setting some where in the old project.

Update: by the way, I had to change SKIP_INSTALL to NO

chrhansen avatar Jun 20 '12 15:06 chrhansen