System information: Xcode 7.0.1 w/ iOS 9
The issue i am having is: After adding the GoogleMaps pod (1.10.3) to my podfile, the application builds in Xcode for the iOS Simulator, but not for a device.
The error that occurring is as follows:
ld: '/Users/<username>/Projects/Arsenal/LitterBug/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(GMSCachedTile.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 armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Every post I have found mentions setting the ENABLE_BITCODE flag to 'No' for the pod target in the Pods project. That would be a viable option, if only to allow development to continue until Google updates the SDK, if the GoogleMaps target was being created in the Pods project.
My current podfile looks like:
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'AppName' do
pod "Parse"
pod "SwiftOverlays"
pod "FBSDKCoreKit"
pod "GoogleMaps"
pod "FBSDKLoginKit"
pod "FBSDKShareKit"
end
target 'AppNameTests' do
end
When i run pod install --verbose or pod update --verbose, the 'install targets' phase appears to NOT install the GoogleMaps target in the Pods project. This is indeed confirmed by viewing the project in the workspace.
There IS a target created along-side the other pod targets called 'Pods-appname'. I've tried disabling bitcode for this target, but it did not fix the issue.
If anyone else has experienced this issue, please let me know. The original error i received is currently being tracked as an issue and can be viewed here: GoogleMaps issue 8219
The current workaround requires a GoogleMaps target existing in the Pods project in the workspace.
I solved this problem by Setup Enable Bitcode = NO in Build Settings.
Project>Build Settings>All>Build Options>Enable Bitcode = NO
Just select Pods in PROJECT and set Use Legacy Swift Language Version to YES.
Related
I've got an iOS project on Xcode that uses Firebase, which was downloaded through Cocoapods. Everything was working fine - running on both simulators and devices - until I tried to run the app on an iPad 7th generation simulator and this error was thrown:
ld: framework not found GoogleAppMeasurement
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Now the project won't build on any device or simulator. I navigated through the Pods folder to check if GoogleAppMeasurement had its framework and it does. Besides this one error, there's no frameworks highlighted in red (like some other related questions mention) or other indication of what could have gone wrong.
Here's my pod file in case it helps:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'my project's name' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for my project's name
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Core'
end
This same error has popped up on another one of my firebase-reliant projects and I've had no luck getting rid of it there either. Any suggestions on how to keep troubleshooting are welcome.
I'm using Cocoapods with my Xcode project, but it seems to be causing both "library not found" and header "file not found" errors when building with the Simulator but not when I have a device connected nor when using "Generic iOS Device".
My Podfile is simple. I have only one pod in there, for Microsoft's ADAL SDK, needed for single sign-on. When I use use_frameworks! in the Podfile I get:
fatal error: 'ADAL/ADAL.h' file not found
for the line
#import <ADAL/ADAL.h>
but if I use use_modular_headers! instead of use_frameworks! I get:
ld: warning: directory not found for option '-L/Users/memyself/Documents/iOS_Projects/ASSIST-main/ASSIST-main/DerivedData/MyApp/Build/Products/Debug-iphonesimulator/ADAL'
ld: library not found for -lADAL
Even if I disable both of those it builds fine for the device and for "Generic iOS Device", but fails with 'ADAL/ADAL.h' file not found error.
Yes, there are plenty of SO questions and answers for those kinds of errors (such as here) but no success trying them. To be specific, I'm using $(inherited) in the recommended search paths, setting enable bitcode to NO, making sure I'm opening the xcworkspace not the xcodeproj file, and have tried
$ pod deintegrate
$ pod clean
$ rm Podfile
Also, my app uses AWS and Firebase and I was getting the same problem with them, but was able to fix them by manually adding the necessary frameworks. However, I don't have a framework for ADAL, and frankly I need to fix this so I can use Cocoapods to install and manage my AWS and Firebase dependencies. It is very suspicious that it only fails when building for the Simulator, what project settings could cause this?
Update the deployment target and the Podfile 'platform' target. Update both from 9.0 to 11.0. Change this line in your Podfile
platform :ios, '11.0'
and this in both your Target and Project:
Try changing build active architecture only in build settings.
Having a react-native project, which won't build on target "Staging" since I've setup cocoapods and using xcworkspace file since then (needed for firebase integration of react-native-firebase). When trying to build for taget "staging", I'll get this error:
ld: library not found for -lPods-[app]
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It works on debug, and (well at least it doesn't throw an error) when I archive the project.
I've having a "staging" target because of code-push. Using react-native at version 0.48.4 and Xcode 9 (created it following this guide, but before using cocoapods)
My podfile:
platform :ios, '9.0'
target 'xx' do
#use_frameworks!
# Pods
pod 'Firebase/Core'
pod 'Firebase/Analytics'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
end
Tried with and without use_frameworks!, cleaning project, deleted DerivedData, deintegrating and reintegrating pods.
What could cause this? (Please tell me if you need more information)
What worked for me:
Deintegrated all pods using pod deintegrate (using enter link description here)
pod install
Removed [Project name] > Frameworks > Pods_[Project name].framework (which was red, but there are actually more files being red)
Build succeeded
Was doing this with the help of this post. Thanks also to Maurice for trying to help me.
I had this issue. In my case it was a react-native app added Firebase Analytics. As of July 2018, all apps must be built with iOS 11 per Apple: developer.apple.com/ios/submit/
Once I went to my General tab and scrolled down to Deployment Info / Deployment Target and changed it from 10.x which is what I was targeting, to 11.x - the app built/archived and I was able to submit.
Set your PODS_CONFIGURATION_BUILD_DIR of "staging" as "release" ${PODS_BUILD_DIR}/Release$(EFFECTIVE_PLATFORM_NAME).
Check the Frameworks folder and remove red files.
check whether the SEARCH_PATHS is correct at Pods-XXXX.debug.xcconfig or Pods-XXXX.release.xcconfig
LIBRARY_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/path/to/your folder"
First of all, I am aware of questions similar to this one but none of them refers to my problem. I am using Xcode 7 beta 6 and cocoapods.
This is my Podfile:
platform :ios, '8.0'
use_frameworks!
target 'Alfred' do
pod 'PaymentKit', :git => 'https://github.com/stripe/PaymentKit.git'
pod 'SDWebImage', '~>3.7'
pod 'Parse'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'ParseFacebookUtilsV4'
pod 'Fabric'
pod 'Crashlytics'
end
When compiling for the simulator, all works fine, but when compiling for a real device (iPhone 6 with iOS 9 beta) I got the following error code:
'/Users/username/projectpath/Pods/ParseFacebookUtilsV4/libParseFacebookUtilsV4Lib.a(PFFacebookUtils.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
I have alredy enabled the flag ENABLE_BITCODE and it still shows the same error. Also I tried cleaning and rebuilding the project again.
You actually need to DISABLE bitcode for those libraries that do not support bitcode yet.
The error is saying please link your static lib that has been compiled for bitcode. Since you probably don't own the cocoapods libs you need to just disable bitcode support for those libraries in your project.
If you want the quick and dirty, just disable bitcode for your target (seen below). But you can more granularly pick and choose to disable bitcode for the libraries giving you trouble as well (more responsible choice).
I have problem with creating Archive of my project. When I try build and run project on devices it's working okay. But when I tried to archive project for distribution I have problem. It takes some time and it's doing all work but at the end I gives me error:
ld: library not found for -lPods-[project]-ZXingObjC
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My Podfile:
platform :ios, '8.0'
use_frameworks!
def shared_pods
pod 'ZXingObjC'
pod 'Fabric'
pod 'Crashlytics'
end
target '[project]' do
shared_pods
end
target '[project]Tests' do
end
target '[project]Demo' do
shared_pods
end
What I've tried:
Restart Xcode
Restart OSX
Remove and add Cocoapods
Check settings for Build Active Architecture Only (it's same for my project and Pods project)
Check Build Setting > Other Linker Flag
Change scheme for Archive from Release to Debug
Try archive with iOS Device or two real devices
Disable paralelize builds in Scheme -> Build
Check http://guides.cocoapods.org/using/troubleshooting.html
Project settings -> Info tab –> Configuration sets
and maybe more. I've tried to search questions here and tried google but for now nothing help. I am now downloading Xcode 7 but I don't think it help. So where could be problem? Why it's not archiving project? Thanks for any help or idea
I ran into the same issue today, and the problem is in use_frameworks!. Remove it and you'll be able to archive your project.
But you could run into other problem, if your pods have some namespace conflicts.
Archive button is only available when you build on real device. Try it on a real device instead of simulating it.