Unknown argument -swift while installation of firebase cocoapods in IOS - ios

i have installed firebase cocoapods through terminal in my project , when i install the pods it shows me warning whether to use $ inherited in flags or remove target from build settings. I have tried both cases but i got an error of unknown argument -swift. when i remove the $ inherited from other flags option in build settings it gives error on configuration of firebase, I'm stuck to this condition whole week but couldn't found any solution. My pods file is under a screenshot,

Your pod quotes are not as expected, open in a different text editor and edit them.
Change them as its here:
target 'PK.HouseUITests'

Related

framework not found RealmSwift

I was installing Realm and imported to my project but when I run the app it shows me an error:
ld: framework not found RealmSwift
clang: error: linker command failed with exit code 1 (use -v to see invocation)
There can be multiple reasons for this issue.
To get the exact issue you can follow the below step :
Right click on error and select 'Reveal in log'. This will give you more insight about the reason of error.
One of the solution is to setting the 'Enabled Bitcode' to No. For this go to Build settings in your target and search 'Bitcode' in the search field.
I have faced this issue multiple times and one of the below solution may work for you.
After installing the pods make sure that you're opening the workspace instead of Xcode project file.
Restart Xcode
Remove derive data for your application
Reintegrate pods using pod deintegrate and pod install for your project
Reset simulator(If you are viewing the output in simulator)
Ensure proper linking of Framework in your project
Restart simulator
Clean project etc.
Hope this may help you.
I was having the same issue.
Initially, I was trying to import the files (Realm.framework and RealmSwift.framework) from download folder but then i was getting the same error like yours.
What i did then, i copied the folder containing the (Realm.framework and RealmSwift.framework) into the project folder and then i imported the files from there. That resolves my issue.
In my case, I've updated the Cocopods to the latest version (1.1.0) via this command sudo gem install cocoapods
is it possible that you are still running the .xcodeproj file. You should run .workspace file in your xcdoe

Xcode 8.3 Archive error: Linker command failed with exit code 1

I started getting this error only after upgrading from Xcode 8.2 to Xcode 8.3, and only when making an archive build (debug builds work fine).
When I do the archive via Xcode, the only message I get is "Linker command failed with exit code 1 (use -v to see invocation).
I build with the command line xcodebuild -scheme MyProduct
When I built this way, I found a number of issues (again, only when doing Archive):
I had to add import UIKit to practically every swift file.
all the pods had issues
remove everything from app-Bridging-Header.h
add a few things back into app-Bridging-Header.h
My current issue is with the AWS pod, using version 2.5.3
So my app-Bridging-Header.h has #import <AWSS3/AWSS3.h>
Here is the error from the command line build:
error: 'AWSS3/AWSS3.h' file not found with <angled> include; use "quotes" instead
#import <AWSS3/AWSS3.h>
^
The error log continues after that. I also tried the crazy suggestion of switch in the import to "AWSS3/AWSS3.h"...that didn't work either.
What is going on?
More INFO
This really appears to be an issue with one of my pods. I built a new solution, imported a subset of my pods and everything built. Then when I updated with the full list of pods it broke.
For me it is coming due to Bitcode enable in my project and i have used a custom framework with disabled bitcode.
Two things you can do :
Either disable bitcode in your project
OR
Build framework with bitcode enable
NOTE: If you click on error and it doesn't show anything then right click on error and select Reveal in Log. You will get error for this issue
At long last I was able to figure out this was a pod issue...just had to figure out which one it was.
I created a brand new project and started adding my pods in one by one (actually, 3 by 3...one by one would have taken too long).
Conclusion: localytics 4.3.1 has a bug in it somewhere. I downgraded to 4.3.0 and the problem went away.
I got a problem like this. My suggestion is that you should remove the version of 8.3 and download any old version from this link: https://developer.apple.com/download/more/
I hope that it will work.

Error while creating own spec git public repository pods

I am trying to create my own pods following tutorial
However when I added my code to the pods project and tried to push it. Then I get following error -
ERROR | xcodebuild: /Users/klouddata/Documents/Developer/MyPods/Classes/PDRatingsView.m:87:44: error: no visible #interface for 'UIApplication' declares the selector 'openURL:options:completionHandler:
I dont understand how to solve this error.
Thanks
To push pods your repo can't have errors (I believe it can't even have warnings). If error doesn't exist during building your framework then pods build it differently (maybe with different swift version?). To set swift version during pods building use command (found on pods website but didn't try it)
echo "3.0" > .swift-version
Personally I used following command (which is "bad way")
export TOOLCHAINS=com.apple.dt.toolchain.Swift_3
without understanding the problem somebody given the negative marks to this question,
Any ways after long research i found the answer myself.
As mentioned in ERROR | xcodebuild:, path for xcode build is different as i have in my system old xcode installed so need to change the path and I've to run both Xcode 7 (to build old version) and Xcode 8 (to build current develop branch)
using following command
launchctl remove com.apple.CoreSimulator.CoreSimulatorService || true

Xcode 7.3: error: could not read CFBundleIdentifier from Info.plist (null) after pods configuration

I've downloaded Telegram's code and I'm playing around trying to add Auth0 with it, so I tried to used pods, replicating the practice code.
After some pain regarding PODS_ROOT, I finally managed to get it going, only to encounter the above error.
And now I'm not sure what to do. This answer leads me to believe there's an issue with the info.plist file location, but there's too many:
UPDATE:
I saw that the Bundle Identifiers for the Targets were blank, in contrast to the 'base' Telegram app (perhaps something to do with switching from config configuration to Pods-Telegraph?), which had values in it. So I copied over the Bundle Identifiers from the 'base' app like so:
And promptly ended with this new issue:
ld: library not found for -lPods-watchkitapp Extension
clang: error: linker command failed with exit code 1 (use -v to see invocation)
EDIT:
For reference:
Telegram (iOS version is Objective-C)
Auth0
For replication, I:
Downloaded necessary files for each project. Telegram is missing some files scattered around the net, and Auth0 requires a (free) account for configuration.
Created a podfile for Telegram.
Modified it to resemble Auth0 podfile - Target main app only. If done right, this should replicate the error in question.
Filled in Bundle Filters (erased upon pod install), based off original values. If done right, this should replicate the UPDATE error in question.
Close your project . Open Again. Clean your project and try to run.
And if its not works then Search info.plist right click -> Remove reference . And add it again. and try to Build.
EDIT :- After installing pod You need open project from .xcworkspace in place of .xcodeproject .

iOS Cocoapods -pod(MBProgressHUD) installed give error stuck at "Analyzing dependencies" and "Header file missing"

I have installed 2 pods MBProgessHUD and PEPhotocropEditor it's working correctly till now but suddenly I got error for MBProgressHUD.h file not available. And I tried it with pod update and again pod install command but still not able to solve the problem. When I fier both the command terminal stucked at
Analysing dependencies.
and pods are looking in red color.
My problem is solved with following procedure.
1) Take Backup of your Project to other place.
2) open Terminal , and go to your project directory with cd command.
3) first type this command
setup you pod:
$ pod repo remove master
$ pod setup
$ pod install
Note
It takes time. so, don't panic wait for few minuts.
EDIT :-
After completing this all if you find error like
MBProgressHUD.h file not found ( any of pod related header file)
you need to follow this procedure also.
you need to Check if the pod header files are correctly symlinked in Pods/Headers. (All imagae give with correct setting)
WIKI or Cocoapods Troubleshooting gives explaination in brief.
1) If something doesn’t seem to work, first of all ensure that you are not completely overriding any options set from the Pods.xcconfig file in your project’s build settings. To add values to options from your project’s build settings, prepend the value list with $(inherited).
2) If Xcode can’t find the headers of the dependencies:
Check if the pod header files are correctly symlinked in Pods/Headers and you are not overriding the HEADER_SEARCH_PATHS (see #1).
Make sure your project is using the Pods.xcconfig. To check this select your project file, then select it in the second pane again and open the Info section in the third pane. Under configurations you should select Pods.xcconfig for each configurations requiring your installed pods.
If Xcode still can’t find them, as a last resort you can prepend your imports, e.g. #import "Pods/SSZipArchive.h"
Don't need to include below step if only Headerfile missing Error.
Below line and image give for reference if some one can't find proper option.
3) If you're getting errors about unrecognized C compiler command line options, e.g. cc1obj: error: unrecognized command line option "-Wno-sign-conversion":
Make sure your project build settings are configured to use "Apple LLVM compiler" (clang)
Are you setting the CC, CPP or CXX environment variable, e.g. in your ~/.profile? This may interfere with the Xcode build process. Remove the environment variable from your ~/.profile.
~/ .profile location
1)open Settings > General
2) Scroll to the bottom and open Profiles. If you do not see a "Profiles" section, you do not have a configuration profile installed.
In the "Profiles" section, select the profile you wish to remove.
4) If Xcode complains when linking, e.g. Library not found for -lPods, it doesn't detect the implicit dependencies:
Go to Product > Edit Scheme
Click on Build
![Edit scheme][6]
Add the Pods static library, and make sure it's at the top of the list
Clean and build again.
If that doesn't work, verify that the source for the spec you are trying to include has been pulled from github. Do this by looking in
/Pods/. If it is empty (it should not be), verify that the ~/.cocoapods/master//.podspec has the correct git hub url in it.
If still doesn't work, check your XCode build locations settings. Go to Preferences -> Locations -> Derived Data -> Advanced and set build location to "Relative to Workspace".
Xcode Build Location Setting:-
If you tried to submit app to App Store, and found that "Product" > "Archive" produce nothing in "Organizer":
In Xcode "Build Settings", find "Skip Install". Set the value for "Release" to "NO" on your application target. Build again and it should work.

Resources