question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linker error with Cocoapods

See original GitHub issue

In my react native project I have rnfirebase setup with cocoapods. And it has its own Pods xcconfig file. How do I merge these 2 (UnityConfig & Myprojects-config) files ? I tried adding #include but its still not able to find some header files.

Thanks

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JanOwiesniakcommented, Nov 27, 2018

I’m adding new Pods this way:

  1. Create Podfile and add needed Pods e.g. Firebase
  2. pod install
  3. Open Pods-rnunitydemo.release.xcconfig (this file includes all needed dependencies) screen shot 2018-11-27 at 11 05 25
  4. Open UnityConfig.xcconfig screen shot 2018-11-27 at 11 07 46
  5. Manually merge Pods-rnunitydemo.release.xcconfig into UnityConfig.xcconfig
1reaction
MaxToybermancommented, Nov 27, 2018

I have managed to solve this:

this is my UnityConfig.debug.xcconfig:

#include "Pods/Target Support Files/Pods-VooDoog/Pods-VooDoog.debug.xcconfig"



PODS_HEADER_PATHS = ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/BoringSSL" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseAuthInterop" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseFirestore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GTMSessionFetcher" "${PODS_ROOT}/Headers/Public/GoogleUtilities" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/gRPC" "${PODS_ROOT}/Headers/Public/gRPC-C++" "${PODS_ROOT}/Headers/Public/gRPC-Core" "${PODS_ROOT}/Headers/Public/gRPC-ProtoRPC" "${PODS_ROOT}/Headers/Public/gRPC-RxLibrary" "${PODS_ROOT}/Headers/Public/leveldb-library" "${PODS_ROOT}/Headers/Public/nanopb"

PODS_LIBRARY_PATHS = "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseAuth" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/Protobuf" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-ProtoRPC" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-RxLibrary" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb"

PODS_LIBRARIES = -ObjC -l"BoringSSL" -l"FirebaseAuth" -l"FirebaseCore" -l"FirebaseFirestore" -l"GTMSessionFetcher" -l"GoogleUtilities" -l"Protobuf" -l"c++" -l"gRPC" -l"gRPC-C++" -l"gRPC-Core" -l"gRPC-ProtoRPC" -l"gRPC-RxLibrary" -l"leveldb-library" -l"nanopb" -l"sqlite3" -l"z" -framework "FIRAnalyticsConnector" -framework "FirebaseAnalytics" -framework "FirebaseCoreDiagnostics" -framework "FirebaseInstanceID" -framework "Foundation" -framework "GoogleAppMeasurement" -framework "MobileCoreServices" -framework "Security" -framework "StoreKit" -framework "SystemConfiguration"
//
//  UnityConfig.xcconfig
//  rnunitydemo
//
//  Created by xzper on 2018/3/6.
//  Copyright © 2018年 Facebook. All rights reserved.
//
UNITY_SCRIPTING_BACKEND = il2cpp;
GCC_PREFIX_HEADER = $(SRCROOT)/UnityExport/Classes/Prefix.pch;

HEADER_SEARCH_PATHS = $(inherited) "$(SRCROOT)/UnityExport/Classes" "$(SRCROOT)/UnityExport/Classes/Unity" "$(SRCROOT)/UnityExport/Classes/Native" "$(SRCROOT)/UnityExport/Libraries" "$(SRCROOT)/UnityExport/Libraries/libil2cpp/include" ${PODS_HEADER_PATHS};

LIBRARY_SEARCH_PATHS = $(inherited) "$(SRCROOT)/UnityExport/Libraries" "$(SRCROOT)/UnityExport/Libraries/libil2cpp/include" ${PODS_LIBRARY_PATHS};

// If using .net 4.0 in Unity, append -DNET_4_0 to OTHER_CFLAGS
OTHER_CFLAGS = $(inherited) -DINIT_SCRIPTING_BACKEND=1 -fno-strict-overflow -DRUNTIME_IL2CPP=1;

OTHER_LDFLAGS = $(inherited) -weak-lSystem -weak_framework CoreMotion -weak_framework GameKit -weak_framework iAd -framework AVFoundation -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework Foundation -framework MediaPlayer -framework MediaToolbox -framework Metal -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -liPhone-lib -lil2cpp ${PODS_LIBRARIES};

CLANG_CXX_LANGUAGE_STANDARD = c++0x;
CLANG_CXX_LIBRARY = libc++;
CLANG_ENABLE_MODULES = NO;
CLANG_WARN_BOOL_CONVERSION = NO;
CLANG_WARN_CONSTANT_CONVERSION = NO;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
CLANG_WARN_EMPTY_BODY = NO;
CLANG_WARN_ENUM_CONVERSION = NO;
CLANG_WARN_INT_CONVERSION = NO;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = NO;
CLANG_WARN__DUPLICATE_METHOD_MATCH = NO;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_ENABLE_OBJC_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_THUMB_SUPPORT = NO;
GCC_USE_INDIRECT_FUNCTION_CALLS = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION[arch=*64] = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = NO;
GCC_WARN_UNINITIALIZED_AUTOS = NO;
GCC_WARN_UNUSED_FUNCTION = NO;

ENABLE_BITCODE = NO;

DEAD_CODE_STRIPPING = YES;

Actually all I needed to to is to add this 4 lines to the beginning of the file :

#include "Pods/Target Support Files/Pods-VooDoog/Pods-VooDoog.debug.xcconfig"



PODS_HEADER_PATHS = ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/BoringSSL" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseAuthInterop" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseFirestore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GTMSessionFetcher" "${PODS_ROOT}/Headers/Public/GoogleUtilities" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/gRPC" "${PODS_ROOT}/Headers/Public/gRPC-C++" "${PODS_ROOT}/Headers/Public/gRPC-Core" "${PODS_ROOT}/Headers/Public/gRPC-ProtoRPC" "${PODS_ROOT}/Headers/Public/gRPC-RxLibrary" "${PODS_ROOT}/Headers/Public/leveldb-library" "${PODS_ROOT}/Headers/Public/nanopb"

PODS_LIBRARY_PATHS = "${PODS_CONFIGURATION_BUILD_DIR}/BoringSSL" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseAuth" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseFirestore" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/Protobuf" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-Core" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-ProtoRPC" "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-RxLibrary" "${PODS_CONFIGURATION_BUILD_DIR}/leveldb-library" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb"

PODS_LIBRARIES = -ObjC -l"BoringSSL" -l"FirebaseAuth" -l"FirebaseCore" -l"FirebaseFirestore" -l"GTMSessionFetcher" -l"GoogleUtilities" -l"Protobuf" -l"c++" -l"gRPC" -l"gRPC-C++" -l"gRPC-Core" -l"gRPC-ProtoRPC" -l"gRPC-RxLibrary" -l"leveldb-library" -l"nanopb" -l"sqlite3" -l"z" -framework "FIRAnalyticsConnector" -framework "FirebaseAnalytics" -framework "FirebaseCoreDiagnostics" -framework "FirebaseInstanceID" -framework "Foundation" -framework "GoogleAppMeasurement" -framework "MobileCoreServices" -framework "Security" -framework "StoreKit" -framework "SystemConfiguration"

Just copy it from you default xcconfig.

I hope it helped

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cocoapods error: linker command failed with exit code 1 (use ...
First try to Show the Report navigator (8. tab in left navigator of Xcode) and check the report. It should give you some...
Read more >
Linker error with Xcode 12 and CocoaPods 1.9.3 — building ...
This linker error looks like CocoaPods/CocoaPods#10026. Upgrading to CocoaPods 1.10.rc.1 should fix the error. If anyone has been holding off to ...
Read more >
iOS : Xcode 5 iOS 7 CocoaPods Linker Error - YouTube
iOS : Xcode 5 iOS 7 CocoaPods Linker Error [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] iOS : Xcode 5 iOS 7 ...
Read more >
Linking error with Cocoapods and Unity 4.3.2 - Google Groups
I am receiving the linking error "ld: library not found for -lPods" despite trying the fixes on the Troubleshooting page. The dependencies are...
Read more >
Apple Mach-0 Linker Error with Backendless Pod - General
Hi, I currently have an issue when trying to use pods to install the Backendless SDK. Once the pod has been installed and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found