Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Google Analytics to my podfile breaks the build (library not found)

I have Google Analytics in my project which works fine. Once I move it to my pod file everything breaks.

In my pod:

pod 'Google/Analytics', '~> 1.0.0'  
pod 'Google-Mobile-Ads-SDK'

The pod update log:

Installing Google (1.0.7)
Using Google-Mobile-Ads-SDK (7.3.1)
Installing GoogleAnalytics (3.12.0)
Installing GoogleNetworkingUtilities (1.0.0)
Installing GoogleSymbolUtilities (1.0.0)
Installing GoogleUtilities (1.0.1)

I get this error:

ld: library not found for -liPhone-lib clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've noticed it breaks and spams the "library search paths" in the build settings.

Broken library search paths

I have Google ads SDK in my pod file and that has been working fine.

Anyone know what is wrong here? If it's a bug then whose fault it would be?

Edit: Updated to Cocoapods to 0.38.2, no change.

In my pod xcconfig file, the var "LIBRARY_SEARCH_PATHS" gets edited when I include Google Analytics and it removes "$(inherited)":

Example:

LIBRARY_SEARCH_PATHS = "$(PODS_ROOT)/Google/Libraries" "$(PODS_ROOT)/Google/Libraries" "$(PODS_ROOT)/GoogleAnalytics/Libraries" "$(PODS_ROOT)/GoogleNetworkingUtilities/Libraries" "$(PODS_ROOT)/GoogleNetworkingUtilities/Libraries" "$(PODS_ROOT)/GoogleSymbolUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries" "$(PODS_ROOT)/GoogleUtilities/Libraries"

It looks to be a bug.

Edit 2: I have created a bug report here: https://github.com/CocoaPods/CocoaPods/issues/3908

like image 230
Daniel Ryan Avatar asked Oct 19 '22 07:10

Daniel Ryan


1 Answers

Trying your setup as described on a brand new Xcode project, and using the Podfile as below, there is no such error.

First suggestion: Make a new project, pod init, add your Pod requirements, pod install, build, link and run.

target 'GooglePod' do
pod 'Google/Analytics', '~> 1.0.0'  
pod 'Google-Mobile-Ads-SDK'
end

target 'GooglePodTests' do

end

Second suggestion:

Verify the configurations.

enter image description here

like image 190
SwiftArchitect Avatar answered Oct 29 '22 17:10

SwiftArchitect