CocoaPods with Realm - ios

I am trying to use CocoaPods to install Realm. I have done it before with no problem but now I am getting an error. Below I posted my Podfile code and the error I am getting back in Terminal
Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
Uncomment this line if you're using Swift
use_frameworks!
target 'Htlaeh' do
pod 'RealmSwift'
end
target 'HtlaehTests' do
'pod RealmSwift'
end
target 'HtlaehUITests' do
pod 'RealmSwift'
end
Error
[!] Invalid `Podfile` file: syntax error, unexpected tCONSTANT, expecting end-of-input
target 'Htlaeh' do
^. Updating CocoaPods might fix the issue.
# from /Users/Cody/Desktop/Htlaeh/Podfile:7
# -------------------------------------------
#
> target 'Htlaeh' do
#
# -------------------------------------------

I think I can see two potential syntax errors in there that CocoaPods wouldn't be happy about:
Uncomment this line if you're using Swift needs to be commented out (It was referring to the line below it. ;) )
In the Tests target, it should be pod 'RealmSwift'. The apostrophe is in front of 'pod' right now.
Please try correcting those two syntax issues, and if that doesn't fix it, let me know. :)

Related

How to fix my pod install problem with unimodules?

My pod install won't install the pods , i have the same error everytime :
[!] Invalid Podfile file: syntax error, unexpected '\n', expecting =>.
from /Users/bonnieandcloud/Documents/BonnieAndCloud/seducia-app/ios/Podfile:20
-------------------------------------------
use_unimodules!
end
-------------------------------------------
Also my pod. :
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
platform :ios, '13.0'
$FirebaseSDKVersion = '7.7.0'
target 'Instadating' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
pod 'ReactNativeART', :path => '../node_modules/#react-native-community/art',
use_unimodules!
end
As I mention on the comment:
Remove the line ‘use_unimodules!’ Completely and type it manually,
remove everything around that block. You probably copied a bad
character when copy pasting.
Pay attention when copy pasting, sometimes websites have hidden characters that could be icons from the code styler which you don't see.

fatal error: module 'firebase_auth' not found #import firebase_auth

I am trying to use Firebase Authentication for my iOS Flutter.
I have tried all of the procedures laid out in this link but I still receive the same error.
https://github.com/FirebaseExtended/flutterfire/issues/1929
This is the error I receive when I run the iOS app.
/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'firebase_auth' not found
#import firebase_auth;
~~~~~~~^~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
This is my Podfile
# add pods for desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
end
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
You may be interested in this thread here: https://github.com/FirebaseExtended/flutterfire/issues/192
Essentially its recommendation is to delete Podfile and Podfile.lock. Once you've done this re-run and flutter should automatically create the correct Podfiles for you.
Hopefully that helps.
DB
When it happens remove the "^" on the dependency. So firebase_auth: ^1.0.0 -> firebase_auth: 1.0.0.

pod install causes error "unknown file type" when creating Acknowledgements.plist

I'm using CocoaPods for my app.
One of the modules is written in Swift, so my Podfile is as below.
platform :ios, "8.0"
use_frameworks!
target "ossTest" do
pod 'Charts', "~> 2.0"
pod "Color-Picker-for-iOS", "~> 2.0"
end
post_install do | installer |
require 'fileutils'
FileUtils.cp_r('Pods/Target Support Files/Pods/Pods-Acknowledgements.plist', 'ossTest/Settings.bundle/Acknowledgements.plist', :remove_destination => true)
# error
#FileUtils.cp_r('Pods/Pods-acknowledgements.plist', 'ossTest/Settings.bundle/Acknowledgements.plist', :remove_destination => true)
end
When I run pod install, an error message appears:
[!] An error occurred while processing the post-install hook of the Podfile.
unknown file type: Pods/Target Support Files/Pods/Pods-Acknowledgements.plist
Of course, I've prepared Setting.bundle and inside the bundle, I've created an empty Acknowledgement.plist, and modified root.plist to the suggested setting.
My CocoaPods' version is 0.39.0.
How can I solve the error?
In my case, I was just running pod install in the wrong directory. Obviously, because file paths in your Podfile are relative, it means you should run the script from your project's root directory.
Turns out the issue is not with CocoaPods. Instead it can't find a file at the provided location... Go in finder and insure there is a file at "Pods/Target Support Files/Pods/Pods-Acknowledgements.plist"

Importing a library with cocoapods

I am trying to use this library in my ios project:https://github.com/nuclearace/Socket.IO-Client-Swift
I am trying to use with cocoapods.I created a Podfile in my project library.
This is my podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Socket.IO-Client-Swift', '~> 2.2.2’
When I run, I am getting following errors:
SyntaxError - /Users/.../Documents/SwiftSonSurum/Podfile:4: unterminated string meets end of file
[!] Oh no, an error occurred.
It appears to have originated from your Podfile at line 4.
How can I fixt these errors ?
The last quote of your podfile should be a ' instead of a ’

Invalid 'Podfile' file syntax error, unexpected $undefined, expecting '}'

I am trying to install a pod in project. But i am getting this error:
Invalid 'Podfile' file syntax error, unexpected $undefined, expecting
'}'.
Podfile contains:
platform :ios, '7.0' pod 'RestKit', '0.21.0'
The terminal shows following message:
[!] Invalid `Podfile` file: compile error
/Users/work/Desktop/tg/RESTKitDemo/Podfile:1: syntax error, unexpected $undefined, expecting '}'
{\rtf1\ansi\ansicpg1252\cocoartf1265
^. Updating CocoaPods might fix the issue.
# from /Users/work/Desktop/tg/RESTKitDemo/Podfile:1
# -------------------------------------------
> {\rtf1\ansi\ansicpg1252\cocoartf1265
# {\fonttbl\f0\fmodern\fcharset0 Courier;}
# -------------------------------------------
Can i know what is the problem with my podfile?
I got error
Invalid `Podfile` file: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
pod 'MBProgressHUD'
becasue I was declaring Pod files like
pod 'SlideMenuControllerSwift',
pod 'MBProgressHUD'
pod 'SDWebImage'
there is one "," (colon mark) in above podfile name pod 'SlideMenuControllerSwift',. I just removed the colon mark.
It worked.
correct way:
pod 'SlideMenuControllerSwift'
pod 'MBProgressHUD'
pod 'SDWebImage'
Assuming you correctly copied your Podfile over there needs to be a newline between those two lines.
platform :ios, '7.0'
pod 'RestKit', '0.21.0'
Also as of a relatively new version of CocoaPods you actually don't need that first line, the command line tool will determine the correct OS based off of your project's settings.
Edit:
From the new output you posted it looks like your Podfile isn't actually a plain text file. You should recreate it in an editor like Sublime Text and make sure it saves as a plain text file.
I was faced same problem when, I changed my MAC.
1- Make setup - Pod setup or update
So I created a new test project --
And open terminal
Run these command
cd /path your project
pod init
// add any pod in your pod file
pod install
and then you can update pod in your old project .
No special characters or any thing else is allowed in pod file, except the name of pod which we are integrating, unknowingly if we enter any characters such as , \ etc. it may result in the following error.
I just ran into this issue because I was doing:
pod 'Fireworks', :path '/Users/honey/Documents/mypod-ios'
The fix was to just add: =>
pod 'Fireworks', :path => '/Users/honey/Documents/mypod-ios'

Resources