Module 'cloud_firestore' not found: Flutter on BigSur VM - ios

Before trying to mark this question as a duplicate, hear me out. I've successfully implemented firebase into my flutter project on Android, Windows (Android Studio). The next step was to test it on a physical device (iPhone) so I did the following:
cloned repository from GitHub onto my mac (BigSur virtual machine)
used: flutter pub get (for dependencies)
used: open Runner.xcworkspace and configured it accordingly (connected iPhone, added team, certificates, etc)
Added the GoogleService-Info.plist into Runner folder
Run the app, resulting in: fatal error: module 'cloud_firestore' not found
The app worked on my phone prior to the implementation of firebase. From what I've read online, Flutter automatically generates pod files, but I have no such file(s) in my iOS folder, which is odd as I added firebase dependencies to the yaml file (and ran flutter pub get), so a pod file should be generated. On the other hand, creating pod files manually resulted in 3 additional errors (including the current one) and 2 warnings, which seemed counter-intuitive.
I cant update any deployment targets since the pod file is not there (and creating an empty one creates more issues). Also tried deleting the ios folder and 'flutter create .' which creates the folder without podfile(s).
Any help is appreciated.

The solution to this problem is to make sure flutter doctor is up to date. Even though it was when I first setup my project, I ran it on my Mac and to my surprise there were two commands I had to run related to Xcode which then automatically generated the podfile.

Related

Flutter Plugin -- build for iOS works in xCode, but doesn't work with flutter build because of package dependency

I am developing a Flutter plugin, which requires a third party library. This library is hosted on GitHub, and to add it to my project, they tell me to use XCode's package manager (File -> Add Packages). When I do it this way, I can use the package just fine, compile my code and run it on my iPad. However, when I try to use "flutter build ios", it doesn't work.
When building, I see a series of (with actual framework names and file names instead of ...):
note: Removed stale file ...
note: Removed stale file ...
note: Removed stale file ...
Then eventually I will see that the compilation has failed due to being unable to import the library I need. Additionally, when I go back into XCode, I find that the package dependency I had installed is no longer there.
So, what I suspect is happening, is when Flutter builds it is cleaning up all the old frameworks, and running its own pod install. However, since my package is not part of my podspec file, it is being left behind. I am unsure how to get this to work. I've tried adding a line in my podspec file like:
s.dependency 'PackageName'
s.source { :git => 'https://linkToTheGitRepo' }
and then running pod repo update, but when I go to build I still get "Unable to find a specification for PackageName depended upon by my_plugin".
At this point, I just build in XCode and then don't touch it, however this has also caused issues when I go to use the plugin later in another project -- I also cannot use flutter build ios in that project, and I have to do it through XCode. This is an annoying workaround, since I lose the hot reload ability and other nice features of working with Flutter. Any suggestions are appreciated. Thanks.

'FBSDKShareKit/FBSDKShareKit.h' file not found

I've made an IOS build on Unity for an App we're making after adding the facebook SDK, moved the build on a hard drive and tried to build it on xcode on the mac we have at the office, as I always do before uploading it to the app store. I ran into this error and I've been stuck on this issue for 2 full work days and it's driving me a bit crazy, here are the thing's I've tried:
-Install cocoapods, both on the default terminal directory and on the project's directory (I'm not too experienced with cocoapods so I don't know if that made a difference. I also did pod update while standing on the project directory).
-I saw that the IOS resolver has an option called "generate pod files" that people said needed to be checked when building to solve this issue. It was checked by default on my project, so that wasn't it.
-Added the framework path on the build settings to where the facebook SDK is at (though the way it looked on my xcode seemed a bit different than the way I've seen it on other people's xcode screenshots)
-Tried commenting out some #include lines on the headers that are generating the issue. It only produced more errors.
-People said to open the project from the workspace instead of the xcodeproject but unity doesn't seem to generate a workspace file.
-Tried downgrading the Facebook SDK to a previous version but the versions people claim are working don't seem to be on the repository anymore, so it doesn't let me downgrade to them.
At the moment I'm trying to make it work with the latest Facebook SDK which is 9.0.0.
Any help would be appreciated, please let me know if I'm not being specific enough about the issue or if there's any information about my project I should include on the post
The .xcworkspace should be created by Cocoapods, not by Unity directly.
If you already have the Podfile generated, just run pod install on the project directory and open the created .xcworkspace file after Cocoapods finishes installing the external dependencies.

importing "Module 'app_settings'" not found

I'm currently trying to work with xcode to test my flutter application with xcode. The big issue is that all of my imports (such as app_settings, cloud_firestore, etc...) give an error for "Module ___ not found". When I try to run my dart code I get the error in the terminal:
[Proj Root]/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'app_settings' not found
#import app_settings;
~~~~~~~~^~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
I tried running flutter create for ios, (this might've made things worse?) Flutter clean and reinstalling pods doesn't seem to work either. I'm wondering if there's something simple that I missed with importing modules. I created the application on android using modules that should work with Android & iOS. After getting the android version working I pulled my project on my mac through github and finally reached this issue. Any pointers would be appreciated because I'm totally stuck on this.
My project has 3 build flavor. Development, Staging & Production.
In Xcode It was selected default Runner One. (On Top of the middle)
though i follow the process like
delete pod , Podfile.lock and .symlinks from Android Studio / (From Project)
flutter pub get
cd ios > pod install
Then In XCode > clean build
Select Right Build Flavor (Production For Me)
Then Archive (Done)
NB: I tested in M1 machine.
Hmm Not sure what happened but it seems to be good now. I think pod init was initializing minimal data for the podfile. Instead, I deleted the Pods file and did flutter run and it built the podfile correctly with flutter pub get.
Had the same problem, we solved it by setting the iOS Deployment target in XCode to the same value as set in the Podfile, which was 12.0. Then ran flutter clean and flutter build ios worked like a charm 🎉
I had this same problem. What I did was
Delete the Podfile and Podfile.lock
flutter clean
flutter build ios
Opened the Runner.xcworkspace
Build on Xcode
This worked for me 🎉
Delete pod directory and podfile.lock
flutter clean
flutter pub get
cd ios
pod install --repo-update
run the application in Xcode
I tried everything above, but for me the solution was quite different.
I am using flavors (schemes), and I accidentally created the scheme with upper case in the first character, while everywhere else (build config etc.) I used lower cases only. After deleting the scheme and recreating with lower case characters, it worked.
path/flutter/ios/Runner/GeneratedPluginRegistrant.m:12:9: Module 'app_settings' not found
I had the same issue after upgrading the Xcode to 13.3 and my production build flavor wasn't working. I was using firebase as well. In my production build flavor, I didn't append anything to the configuration name (i.e. all the other configurations have the name like "Debug-staging", "Debug-development", but in the production, it's only "Debug"). I just deleted the pod file and run:
flutter run --flavor production --target lib/main_production.dart
Everything worked fine for me.

Error message - RNFirebase core module was not found natively on iOS

React Native Firebase won’t install on iOS React Native project. It works fine on Android.
I followed this instruction.
https://rnfirebase.io/docs/v5.x.x/installation/initial-setup
I set up Firebase, added the downloaded plist file via XCode, installed and set up Cocoapod.
The moment I add the following line to my App.js, the simulator returns an error message.
import firebase from 'react-native-firebase';
The error message: “RNFirebase core module was not found natively on iOS”
I’ve tried a few things I picked up from this forum:
https://github.com/invertase/react-native-firebase/issues/614
I commented out following lines from Podfile
use_frameworks!
And then pod install, pod update
on Xcode, checked the Build Phases/ Link Binary with Libraries section. I checked libRNFirebase.a was already there.
I've been trying this for a few months now on and off. And I haven't found a way to make React Native Firebase install on iOS project. Any pointer would be much appreciated.
I'm currently maintaining the react-native-firebase v5 branch (current stable) and we do have a problem with the header search paths right now for some reason.
I don't have a definitive fix, but I constructed a demo that goes from react-native init, then installs react-native-firebase, and does all the things necessary such that the project builds and runs on iOS and even archives in release mode.
You may see it here: https://github.com/mikehardy/rnfbdemo
The only thing that is important at the moment is that you need to put one non-documented thing in your Podfile after following all the install instructions, as the last line before the final end
system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/")

Xcode 10 - Can't Build React Native Application

Since updating the Xcode 10, I cannot build and run my app either on a physical device or on the simulator. I have tried via the terminal and directly through Xcode. What I have tried:
Removing my repo and re pulling.
https://github.com/facebook/react-native/issues/19573
https://github.com/facebook/react-native/issues/14382
https://medium.com/#swyx/if-you-get-a-third-party-config-h-35a3c54e9278
Print: Entry, ":CFBundleIdentifier", Does Not Exist
"config.h" file not found in iOS project of React native
I do not know what is left to do. I have had all the errors outlined in the above links. the main one that I am having trouble with at the moment is that config.h does exist and cfbundleidentifier", does not exist.
After following the instructions layed out in all the links provided, all I needed to do was run npm audit fix and it started working.

Resources