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

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.

Related

Invalid `Podfile` file: undefined method `exists?' for File:Class

I am facing an issue with pod file as below while instlling POD in Xcode project
Invalid `Podfile` file: undefined method `exists?' for File:Class
I did try to update POD version with brew upgrade cocoapods and also followed below link
https://dev.to/retyui/fix-a-pod-install-error-undefined-method-exist-for-fileclass-react-native-24ke
But still no fix.
Please guide me what am I doing wrong here.
below is my POD file
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
flutter_application_path = '../bmi_flutter'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
target 'MixedNativeApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
install_all_flutter_pods(flutter_application_path)
# Pods for MixedNativeApp
target 'MixedNativeAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MixedNativeAppUITests' do
# Pods for testing
end
end

No podspec found for xyz module

Hey I am trying to fetch .podspec file in my podfile. But I am getting weried issue
[!] No podspec found for `kotlinmultiplatformsharedmodule` in `https://github.com/vivek-modi/MultiplatformProject/tree/master/app/kotlinmultiplatformsharedmodule`
My project link and my .podspec file are store in this location.
podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/vivek-modi/MultiplatformProject.git'
target 'PodIosProject' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for PodIosProject
pod 'kotlinmultiplatformsharedmodule', :path => "https://github.com/vivek-modi/MultiplatformProject/tree/master/app/kotlinmultiplatformsharedmodule"
target 'PodIosProjectTests' do
inherit! :search_paths
# Pods for testing
end
target 'PodIosProjectUITests' do
# Pods for testing
end
end
Can someone suggest me what am I doing wrong here?

Invalid `Podfile` file: cannot load such file -- ⁨path/to/.ios/Flutter/podhelper.rb

i am trying to integrate flutter module to an existing iOS app
my pod file :
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'IosFlutter' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for IosFlutter
target 'IosFlutterTests' do
inherit! :search_paths
# Pods for testing
end
target 'IosFlutterUITests' do
inherit! :search_paths
# Pods for testing
end
flutter_application_path = '⁨⁨path/to/flutter_app⁩/'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
end
when running pod install in terminal i got this error :
Invalid `Podfile` file: cannot load such file -- path/to/.ios/Flutter/podhelper.rb
any advise would be appreciated , thanks
make sure your flutter and dart version is up to date
run flutter doctor to see if anything went wrong
load your flutter file out of target block and add install_all_flutter_pods inside your app dependency block like this :
flutter_application_path = '⁨⁨path/to/flutter_app⁩/'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
target 'MyApp' do
install_all_flutter_pods(flutter_application_path)
end
and finaly run pod install in terminal ios app root folder

No such Module Firebase

I have a react-native project and I have to link my xCode project with firebase. Even though I used CocoaPod and manual ways I am getting the error
"No such module as firebase.h".
I have followed all the steps correctly.
Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'App' do
# Uncomment the next line if you're using Swift or would like to use
dynamic frameworks
# use_frameworks!
# Pods for App
target 'App-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'AppTests' do
inherit! :search_paths
# Pods for testing
end
pod 'Google-Mobile-Ads-SDK'
pod 'Firebase/Core', '~> 5.6.0'
pod 'GoogleIDFASupport'
end
target 'App-tvOS' do
# Uncomment the next line if you're using Swift or would like to use
dynamic frameworks
# use_frameworks!
# Pods for App-tvOS
end
I also faced this problem. I was using react-native-firebase package. Please try following their official docs . I would rate their documentation 10/10 as they've explained every possible scenario a developer would face during integration.
Just change value with deployment target of your app.
platform :ios, 'value'
inhibit_all_warnings!
def sharedpods
pod 'Google-Mobile-Ads-SDK'
pod 'Firebase/Core', '~> 5.6.0'
pod 'GoogleIDFASupport'
end
target 'AppTests’ do
use_frameworks!
sharedpods
end
target 'App-tvOSTests’ do
use_frameworks!
sharedpods
end
target 'App-tvOS’ do
use_frameworks!
sharedpods
end
#post_install do |installer|
# installer.pods_project.targets.each do |target|
# puts "#{target.name}"
# end
#end

Running 1 of 2 custom shell script stuck for 2 minutes in Xcode

Running 1 of 2 custom shell scripts it stuck for 2 minutes while trying to build the app.
I tried to fix with the solution :Xcode custom shell scripts are slowing down the compiling time , but still it slows the build process :(.
Build Stuck for 2m here
Build Phases
Further informations:
Xcode 8.1
Swift 3.0
Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'MyProject' do
# Network
pod 'Alamofire'
pod 'SwiftyJSON'
# UI side
pod 'Material', git: 'https://github.com/CosmicMind/Material.git', branch: 'development'
pod 'SDWebImage'
pod 'UIScrollView-InfiniteScroll'
pod 'TPKeyboardAvoiding'
pod 'SwiftKeychainWrapper', git: 'https://github.com/jrendel/SwiftKeychainWrapper.git', branch: 'develop'
pod 'DropDown'
# Facebook
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
# Autolayout
pod 'SnapKit'
pod 'KeepLayout'
# Metrics
pod 'Google/Analytics'
# Fabric.io
pod 'Fabric'
pod 'Crashlytics'
end
target 'MyProjectTests' do
end
target 'MyProjectUITests' do
end
Finally, I found a solution for this. At least the total build time now is 57sec.
I found that 'Embed Pods Framework' (Once 'Embed Pods Framework' and 'CP Embed Pods Framework') builds twice. Anyway, I don't have an idea why I have both of them on build phases.
I found for this on Report Navigator.
Solution:
1) I let only active ✓ Run script only when installing only for'[CP]Embed Pods Framework'
2) Optimization Level on Build Settings for debug was -None. I set to Fast...
3) Tip: use Simulator instead of Device for minimal build time.
Added this at the end of you Podfile
post_install do |installer|
puts("Update debug pod settings to speed up build time")
Dir.glob(File.join("Pods", "**", "Pods*{debug,Private}.xcconfig")).each do |file|
File.open(file, 'a') { |f| f.puts "\nDEBUG_INFORMATION_FORMAT = dwarf" }
end
end

Resources