Any ideas why I'm getting these errors in xcode? - ios

I have the following errors in xcode below, any ideas what's causing these?
arm-apple-darwin10-llvm-g++-4.2: /Users/<foldername>/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/libbtexternal.a: No such file or directory
arm-apple-darwin10-llvm-g++-4.2: /Users/<foldername>/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/libbtexternal.a: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/1x/_btz9s41381cdzz41ty0r5fm0000gn/T//cc8KPWhc.out
error: linking step of external dylib build failed, probably due to missing framework or library references - check the contents of the btexternal.ios file
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure

Please check that are you having the file libbtexternal.a. If not then add it to your project after this go to the project and there is option Build phases. You find here four rows in which you have to select Link Binary with Libraries and add your .a file to the frameworks you are seeing here. I think it will work, If not then tell me.
Hope this helps.

Related

Realm framework error with Strip: Stripping frameworks fatal error: lipo: -remove's specified would result in an empty fat file

I am having an ugly error since I've updated the Realm.framework.
The error is:
Stripping frameworks
fatal error: lipo: -remove's specified would result in an empty fat file
If I select the box for "Run script only when installing" in build phase for the corresponding Run Script, it compiles for testing. However it does not when I try to archive.
Does anyone have a thought on this ?
Thank you,
This error could happen if you didn't follow the installation instructions listed at https://realm.io/docs/objc/latest#installation exactly.
The strip-frameworks.sh build phase is only necessary when using fat frameworks, such as the ones provided by Realm's zip downloads or Carthage with binaries. This error would happen if you're building Realm from source (e.g. with CocoaPods or carthage update --no-use-binaries), because it'll just build the architecture you need.
An extra C++ library was causing the problem. Removing it solved it.

Command [...]/clang failed with exit code 1

I have a serious problem with one of my ios application because i can't compile it anymore. I think its due to a mislinked file (see the error at the end).
The whole story started when i wasn't able to add a file to a target. I then couldn't build because of this error, see: Duplicate interface declaration for class 'Foo'. Xcode miracously copied my sources within itself to a subfolder with the projectname. I deleted as suggested but i know keep running into the error pasted at the bottom.
In effect it is due to clang looking for a file a very deeeeeeeply in itself nested folder which of course doesn't exists. What did xcode do here and how can i get it working again?
This is the last part of the error
clang: error: no such file or directory: '/Users/Shared/projects/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/AppDelegate.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Okay i found it! I knew there had to be a list of files it tries to compile somewhere. I finally found it under the targets build phases. There you have entries for "compile sources" and "copy bundle resources" which both got cluttered in my case. I corrected those file lists and it finally worked again.

linker command failed in Xcode

I was building an app, but later on I quickly changed something(a value in char variable) and tried to load again, now I am getting this error
ld: 9 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have undone what I have done, but still I am getting this error.
I have tried to delete build folder, it did not work... I also performed clean and build but still it cannot build...
You have to check the files included in the build. Quite possibly there are some duplicate implementation (or perhaps header?) files included.
Navigate to {Project} > {Target} > Build Phases.
Check the Compile Sources build phase for duplicates.
Remove all duplicate files.
Also make sure no duplicate libraries are included in the project. You may check this in the Link Binary With Library phase. Basically same story as above, but for libraries.
Finally make sure to clean the project before building (Product > Clean).
My error message was a little different - duplicate symbols ... in ClassImplmentationFile.m
I didn't have any of the duplicates, as described above, but I noticed that the .m files that were listed in the error message, were in Build Phases/ Compile Sources.
I removed them from there and the thing ran fine.
I didn't put them in there. I guess Xcode auto-screwed-up my project at some point. : - )

clang: error: linker command failed with exit code 1, only when testing on device

I was just about to test my app on a device when I ran into this problem, I'm getting this Linker Error.
I've already checked all my compile sources and Build Phases, but there's no sign of my importing things twice.
ld: duplicate symbol _calculateNextSearchPage in /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) and /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This only happens when testing on a device, not in the simulator.
Alright guys I had the same problem. Seems like I fixed it.
I am using cocapods therefor the described standard procedure can not be properly executed.
Steps to do to properly add FastPDFKit with Cocoapods.
Download FastPDFKit
In your project Add Files to "Your Project"
go to FastPDFKit folder you just have downloaded
locate 1 folder and 1 project file. Press and hold Command key and add these in to your project
FastPdfKit.xcodeproj
FastPdfKit.embeddedframework
(Note: FastPdfKit.embeddedframework is the actual Framework and you
might want to open FastPdfKit.xcodeproj standalone before adding it
to your project, delete FastPdfKit.embeddedframework folder from
your disk and Build FastPdfKit target in the project. You should see
newly created FastPdfKit.embeddedframework folder)
Go to your Project Settings > Your target > Build Phases > Link Binary with Libraries
Make sure FastPdfKit.framework is there.
If not, drag it from the project and put it there.
Clean the project, delete derived data
Add #import <FastPdfKit/FastPdfKit.h> where you need it and you are good to go.
Here is how my Link Binary with Libraries look like
Please let me know if you have any troubles I might've missed something.
Try to delete duplicate files/images which are in target-> Build phase -> Compile files, Copy bundle resources

Can't compile plcrashreporter in Xcode 4

I can use the prebuilt framework provided on the plcrashreporter project page when compiling for the device, but not for the simulator. I have the same problem described here.
I assume the prebuilt framework does not support the simulator's architecture, so I downloaded out the plcrashreporter source. I opened the Xcode project and selected the CrashReporter-iOS-Simulator > iPhone 4.3 Simulator target. When I try to build the project, I get this error:
libtool: unknown option character `D' in: -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000
I get the same error when I try to build most of the other targets (such as for device).
My next step was to try adding the source files to my project. I no longer have the aforementioned problem; however, I get this error when I try to compile:
fatal error: 'crash_report.pb-c.h' file not found [2]
#import "crash_report.pb-c.h"
^
1 error generated.
Command clang failed with exit code 1
The crash_report.pb-c.h file which is mentioned in the error message simply does not exist; I've searched the plcrashreporter source tree and the internet. Therefore, I have to assume that this file is supposed to be generated somehow, but I cannot figure out how.
(Commenting out the line in PLCrashReport.m on which crash_report.pb-c.h is included results in numerous other compilation errors.)
You are correct in that the file does not exist normally, nor does crash_report.pb-c.c exist, which will be your next error after this one.
The crash_report.pb.h and crash_report.pb.c files are generated at compile time through a build rule. You need to add a custom script to your build process to make them.
First, make sure you have protoc-c in the plcrashreporter folder of your project (plcrashreporter-1.0/Dependencies/protobuf-2.0.3/bin/protoc-c). They buried it deep. This is what your script will be running.
Then find your crash_report.proto file. This is the main input that protoc-c will be using to create your missing files. You can take this directory and put it manually into your script, OR you can make a rule to run the script on every *.proto file. I do the latter.
Then edit your build rules to include a script that runs protoc-c with the flag --c_out="${DERIVED_FILES_DIR}" and your crash_report.proto file as two inputs, this will output crash_report.pb-c.h and crash_report.pb-c.c into the same directory as where your crash_report.proto file is, which should already be accessible in your project.
The build rules in Xcode 4 (and above) are under your project's target's build rules tab. You add a build rule before all your other build rules. Here's what mine looks like in Xcode:
You'll probably have to fiddle with the directory

Resources