Xcode test build fails - swift

Every time I run cmd + u I get this error:
If I run cmd + b the build is successful.
I tried to install for testing same pods as debug build but it seems that is not the problem. Also clean derived data also does not work.
Please, if you have any clue share it. Also feel free for asking about more information.
Edited:
ld: warning: Could not find or use auto-linked framework 'Lottie'
ld: warning: Could not find or use auto-linked framework 'Airship'
Undefined symbols for architecture arm64
Thanks

In podfile, after stopping using inherit from test target, and set this one to use Lottie and Airship directly, it works properly. In this way I can use this frameworks with my tests.

Related

Leveldb framework not found swift

I recently upgraded my Xcode to the latest version and a big project I was working on had to be updated and fixed. Once the code updated I tried to run the app on simulator and iOS device but I always get the same error and I don't know where it comes from. I know it means the leveldb framework is missing but I don't find it anywhere on the internet. I am using Firebase.
Here's the error I get
ld: framework not found leveldb
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I would really appreciate if one of you knew how to fix this! Thanks

`swift test` produces "symbol(s) not found for architecture x86_64" linker error

I'm currently trying to add support for the Swift Package Manager to a side-project I've been working on and am running into trouble when trying to run the unit tests I have for the project.
When running them within XCode, I have no problem building and running all of my unit tests; however, when I try to run my tests with the package manager using swift test, I get the following linker error:
ld: symbol(s) not found for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
I ended up figuring out a solution that I'm happy with. I've added a link to the PR here that fixed things, but the general solution was to create a new shared framework target that both my executable and test targets linked to!

clang: error: linker command failed with exit code 1 (use -v to see invocation) Parse.com and Swift

so today I updated my code to Swift 2 and now my app won't run because apparently the Parse Frameworks I was using have expired or something. This is the message I get: ld:
'/Users/tripphillips1/Desktop/Spotter/Parse.framework/Parse(PFAnalytics.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
Does anyone know what this means and how i can fix it?
Thanks
Ok so I found a solution to my problem. You have to go into the Build Settings and disable the Bitcode. Simple as that. Now it runs fine.

Cocoapods 0.35 is failing build

I'm working on a Swift app in Xcode 6. Everything was working okay until I decided to install cocoa pods and a pod. When I try to run it on the simulator, I get the following error:
ld: 91 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Before the error, there is a listing of all those duplicate symbols.
First few lines in error message:
Ld /<...>/Library/Developer/Xcode/DerivedData/<...>-gydnbbvfswpkkodlsuxdkpzkklzb/Build/Products/Debug-iphonesimulator/<...>.app/<...> normal x86_64
cd "/<...>/Documents/iOS Apps/<...>/<...>"
export IPHONEOS_DEPLOYMENT_TARGET=8.1
I even tried uninstalling the pod, but the error persists. I'm completely stuck – any help is much appreciated. Thanks!
Maybe you should update your CocoaPods to 0.36 or a later version, and add use_frameworks! to your Podfile. See this: CocoaPods 0.36 - Framework and Swift Support
Maybe :
You have put the same class implementation into two different files;
You actually have just one implementation of this class, however you are also linking in your project a framework or library containing a class whose name is exactly the same of yours.

ld: 871 duplicate symbols for architecture armv7, clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am using FastPDFKit in my iPhone app for displaying PDF. When I run the project on simulator, it works fine. However when I run the project on iPhone, it gives me below error.
duplicate symbol _value_map in:
/Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
duplicate symbol _writeUnicodeToUTF8Buffer in:
/Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
ld: 871 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: 871 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any idea why it is happening like this?
Error comes when I add FastPDFFramework in Configuration in Debug and Release section.
Here's a solution I found even after messing with the header/framework search paths, rebuilding, etc:
http://support.fastpdfkit.com/discussions/problems/443-i-am-unable-to-link-fastpdfkitembeddedframework
I removed the -all_load linker flag in my project and it compiled successfully. As a warning, make sure removing this flag is appropriate for your project. It was probably placed there for a reason
Can you try to clean up the FastPdfKit target and recompile it? It should generate a new framework ex-novo that you then should be able to add to you project, overwriting the one you are using. You can grab the new .embeddedframework in the FastPdfKit project root directory.
These line helped me from the link below.
http://support.fastpdfkit.com/discussions/problems/759-duplicate-symbols-for-architecture-armv7
there are another reason this error often happens is accidentally importing the .m file instead of the .h.
it's happened to me :)
link : https://stackoverflow.com/questions/12279622/duplicate-symbols-for-architecture-i386-clang
You have too many #include or #import directives in header files for the same things. Move to using #class in headers and only import/include in your .m files.
In all you just need to review where these are and reassess them.
I add my solution, as if you follow the readme, it will ask you to do:
Inherit the project options: select the Project an from info tab and configurations line choose **FastPdfKitFramework** from the drop down list;
I replace the FastPdfKitFramework target to None and now it work great.
As it is on the readme file, I never add .a in my project so download the recompile one don't help me as I do not want to restart all integration.
I hope it can be helpful for someone.
I tries removing -all_loads linker flag, and it worked for me without any problem in the project.