Search code examples
archivezxingios6xcode4.5

trouble archiving iOS project in xcode 4.5. getting error about missing libZXingWidget.a file


i've been at this for hours and it's driving me nuts.

so my project uses ZXing for qr code scanning. but i recently updated my xcode to 4.5. when i did so got this error:

Incompatible pointer types sending 'Class' (aka 'Class *') to parameter of type 'id<NSCopying>'

i searched on google and it turns out it was fixed and all i had to do was checking out the revision and i was good.

so i did that, checked out revision 2315 and removed the old ZXing project from my project and went through the steps again in the README to add the new version of ZXing to my project again.

i followed all the steps and everything went well and my project builds and runs on my ipad and iphone simulators.

but the problem comes when i try to archive my project.

i keep getting

clang: error: no such file or directory: '/Users/username/Library/Developer/Xcode/DerivedData/project-name-gbqfhrszrkbmlkesfuzmwreignnu/Build/Products/Release-iphoneos/libZXingWidget.a'

then i read some stackoverflow answers for somewhat similar questions and someone said there might be cached version in DerivedData directory.. so i delete everything in there, i cleaned my project in xcode, and cleared out the files in /var/folders/ as well.

after doing all this i'm still getting the error =( i tried checking out the latest ZXing code and same problem..

any pointers would be greatly appreciated!

thanks


Solution

  • i think i've figured out the problem.

    doing a little digging, i found that the libZXingWidget.a file was created in the Debug-iphonesos/ directory but not in the Release-iphoneos/ directory.

    so i went to xcode and decided to "Build Active Architecture Only > release to YES. after doing that i did an archive and it worked! but thinking twice, that's probably not a good idea, other architectures wont be built. so i turned it back on. and of course i couldn't archive again.

    so the solution i've found was to make make "Architectures" and "Valid Architectures" under the "Build Settings" tab in my project match with "Architectures" and "Valid Architectures" in the ZXingWidget project.

    after that everything seems to work again. i can build and run on my ipad, various simulators, and archive!

    hope this helps someone!