Command PhaseScriptExecution failed with a nonzero exit code after adding firebase - swift

I've got this error after I installed firebase podfile:
Build/Products/Debug-iphonesimulator/Guess The Code 2.app/Frameworks/GoogleUtilities.framework'
I tried this: Xcode 10 Beta 3: Command PhaseScriptExecution failed with a nonzero exit code but nothing has changed.
I also tried to install GoogleUtilities pod separately but the error remained.
What can I do?
Podfile
pod 'Google-Mobile-Ads-SDK'
pod 'GoogleMobileAdsMediationUnity'
pod 'GoogleMobileAdsMediationAppLovin'
pod 'SAConfettiView'
pod 'Firebase'
Xcode 10 beta 6
Swift 4.2

I had the same problem.
I set 'test target signing Team' and I resolved the problem.

This issue might be linked to keychain service. To solve open keychain lock the login and unclock it again by entering you mac passcode.

I hope this helps someone. I was having the same issue. Creating a brand new Xcode project. Installing the Firebase using pods. Adding the GoogleService-Info.plist to the project but it was failing on it. This might not solve your issue at all but you can develop locally while a more permanent solution shows up.
I found that the script Pods-[ProjectName]-frameworks.sh in the Pods > Targets Support Files > Pods-[ProjectName] > Pods-[ProjectName]-frameworks.sh is trying to re sign the files for the project and it can't retrieve the proper identity. I temporary solved this and I am able to code and run the code locally by commenting by adding the '#' character in the line in the script that goes:
code_sign_if_enabled "${destination}/$(basename "$1")"
Like I said this is just a temp solution until I dedicate time to look into it. At least I can keep coding now. I hope it helps someone.

Related

Suddenly can no longer compile - No such module 'SDWebImage'

So suddenly my project stopped working and I have no idea why and I'm running out of ideas.
I've found some blogs 1 2 and similar requests 1 2 3 for help but nothing seems to work for me. I may be doing something wrong though.
running xcode 13.4.1
I've got 4 distinct errors
Command EmitSwiftModule failed with a nonzero exit code
error: accessing build database "/Users/myuser/Library/Developer/Xcode/DerivedData/App-btdfdbatbdurmeawknwdwmjrqpsw/Build/Intermediates.noindex/XCBuildData/build.db": disk I/O error
Virtual filesystem overlay file '/Users/myuser/Library/Developer/Xcode/DerivedData/App-btdfdbatbdurmeawknwdwmjrqpsw/Build/Intermediates.noindex/App.build/Debug-iphoneos/App DEV.build/all-product-headers.yaml' not found
/Users/myuser/myapp-ios-app/App/UI/Feed/FeedVC/FeedVC.swift:11:8: No such module 'SDWebImage'
I believe the EmitSwiftModule is related with not being able to handle the pod therefore causing the issue in the "all-product-headers.yaml" which is generated to fetch all the pods headers?
So assuming that all things in derived date are as they should be (because i've deleted it) I tried to focus on why is the pod no longer compiling. To my co-worker is working fine. Maybe he will have the same issue if he deletes the derivedData? Maybe we are using some older version files?
Some things I've tried:
clean the project
reset pods cache
delete derived data folder
update the pods
clean xcode preferences
for this pod they say we should add :modular_headers => true in pod file
re download the project clean to another folder
instead of cocoapods use the package manager for SDWebImage
due "all-product-headers.yaml" issue i read here that i could just add a header to my project
I've tried to create a project from scratch and just use the same pods and the project seems to run fine. But this is not a solution.
Can someone please help me? Any ideas?

FBLPromises Framework not found

I am tryin to install Firebase using cocoapods so I may send push-notifications to user devices. However, everytime I follow the instructions step by step, I get this error that says "framework not found FBLPromises". Anyone have any ideas how to fix? Everything I have looked up online does not work.
The following worked for me:
What probably happened (for anyone still looking) is that after running
pod install
in your project's directory, you are still building the ".xcodeproj" file instead of running the newly created ".xcworkspace" from the pod install. Remember, after pod installing, you MUST do edits on and work with the .xcworkspace instead.
Go to your Pod target and add arm64 in Excluded Architecture
I was having the same issue, and I solved it by going to Product > Scheme > Edit Scheme... and selecting Find Implicit Dependencies. After that, the project was able to build correctly.
Probably late but I managed to fix it by linking FBL promises in my podfile to the rest of the project!
Click on the project > Targets. Select your target. Then click on Build Settings. Find "Runpath searches path" and add "$(PODS_CONFIGURATION_BUILD_DIR)/PromisesObjC". It worked for me, but it gave me another error dealing with another missing lib, so I had to do it again until all libs were found.
Go to your Pod target and set Build Active Architecture Only = YES For Debug Environments
Simply setting Build Active Architecture: Debug - Yes, Release - No fixed this for me. I had it set to No, No before. I think this matches the setting in the Pods project.
Open Podfile by typing the command open Podfile in the folder of the project using the terminal.
Type pod Promises
Done

Linker command failed with exit code 1 after installing CocoaPods and firebase pod

I'm trying to use the firebase pod, however getting this (see image) error message when a run is attempted.
I followed this guide to install Cocoapods and added the firebase dependency to the Podfile.
p.s I tried to clean it a bunch of times.
I got stuck for awhile trying to solve this, but the solution turned out to be very easy :)
If you are using Cocoapods in your project, one needs to use xcworkspace to build instead of xcproject.
If you are using Cocoapods and build from  xcproject , it will ignore the Cocoapods libraries you need.
Sometimes its because of you might be declaring an object with same variable name.
Clear the repeating variable name change it. After that clean your project and build again.
Its worked for me....! Thanks.
I faced the same problem for hours and solved it with a simple hack. Just do clean and then Build
This error will also trigger when several components (files) with identical names were added to Xcode workspace.
Renaming them will fix this error.
A bit late, but what did the trick for me were cmd + q xcode, navigate to project folder, pod update, reopen open the .xcworkspace file, clean project and run/build again.
Sometimes occurs when you perform an invalid delete through cocoapods.
In my case I installed a framework through cocoapods which required bitcode set to "enabled", later when I longer needed it removed it from Podfile and pod install.
That's when encountered this error, solving it by setting the required targets to "disabled" in bitcode option.
I've got the same error when I was trying to configure cellIdentifiers in different Controllers.
I declared two variables globally with the same name. To solve this error I just renamed the second variable.
#import "ResultsTableViewController.h"
NSString *const kNormalCellidentifierName = #"NormalStoryCelll";
#interface ResultsTableViewController ()
#end
For me it was because the pod that I was using used Swift and I didn't include the use_frameworks! line in my podfile.
I didn't include that line before and therefore had to create a Swift file in my project and a Objective-C bridging header (which Apple offers to do for you the first time you add a swift file to your project).
If you told it not to create the bridge, then you can use this guys tutorial to manually create it as well as the settings needed.
I have tried a lot to fix this issue and failed for every attempt.
Then i just simply used:
pod install
and to my surprise, simply it solved my issue.

Cocoapods: Cannot load module 'Alamofire' as 'Alamofire'

Update: I solved the question. Please see my answer below (underneath the question and comments).
This question was marked as a duplicate, but it's different because it is a brand new error that I couldn't find through any searches.
I tried installing Alamofire into my XCode project.
As per their their tutorial, I installed cocoapods onto my system.
I then navigated to the folder of my existing xcode project in the terminal, and did:
pod init
I then edited the new pod file and added:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'RainyShinyCloudy' do
pod 'Alamofire', '~> 4.4'
end
Finally, I executed the command:
pod install
My terminal told me the install was successful.
But when I opened the .xcworkspace, made a new swift class and tried to import Alamofire, I got this error:
One possible reason could be that I had tried to install an earlier version of alamofire earlier, deleted it and then installed this.
But I really don't know how that could have mattered.
Thanks for any help you guys can give me.
Actually it failed because you were trying to import AlamoFire and not Alamofire. Imports are case sensitive.
Update: I posted an answer earlier that was wrong.
But now I actually figured it out.
I made a new project, went to the settings menu by clicking on the name of my app in the project explorer.
Then I went to Linked frameworks and libraries which is at the very bottom of the General tab.
I pressed that little + icon, selected Alamofire.framework. and set the status to required
Following this, cleaning and rebuilding the project made the error go away.

Cocoa pods GLM Error

So today I've been trying to try out a new project using Swift, but I've arrived to an abrupt halt. I've been trying to run the VideoCore sample project found here: https://github.com/jgh-/VideoCore/tree/823ec7cac50e5a0b4457bd06dd95a50dca88d9c0/sample/SampleBroadcaster-Swift.
So during the initial setup I had to navigate to the directory and run pod install. pod install executed without any errors, and say I need to close Xcode, and reopen the new workspace, which I did. When I try to go and run the app for debugging (as according to the documentation I can run it right after pod install'ing, I get an error that says 'type_half.inl' file not found. A few screenshots are here to better explain/show: http://d.pr/i/14TqW, and http://d.pr/i/1aYSi.
I've tried reinstalling the pod multiple times, and I haven't been able to resolve this issue. Has anyone had a situation like this, or have any idea on how to get out of this blackhole?
Thanks!
This has been resolved by downgrading CocoaPods to version 0.38.2. Here's what I did:
gem install cocoapods -v 0.38.2
gem uninstall cocoapods -v 0.39.0
And that fixed my issues.
Instead of downgrading CocoaPods to version 0.38.2. This error can be resolved in other way as I have fixed recently on of my project.
STEP 1:- Search Header Search Paths under build setting on GLM target or target that uses GLM pod like in my project VideoCore cocoapods uses GLM
STEP 2:- make it recursive instead of non-recursive.
Build again error will be fixed.
NOTE:- if you update cocoapods that you have to redo the steps again. Also target will be in pod project.
Attached image for reference.