Build fails on adding pod 'Firebase/AppCheck' to the Podfile - ios

I'm using firebase_app_check package. All good. The following command works as expected.
flutter build ios
But as soon as I add the following in the Podfile(ios)
pod 'Firebase/AppCheck'
iOS build fails with this error:
Definition of 'GULAppEnvironmentUtil' must be imported from module 'GoogleUtilities.GULAppEnvironmentUtil' before it is required
What am I missing?

Try to run following command it may help you
run flutter clean
run flutter pub get
go to your project iOS directory and run pod install then run pod update
if this issue is because of outdated pod files

Related

React native whne i type : yarn ios ExpoModulesCore/ExpoModulesCore.modulemap' not found

I am using mac Big Sur version 11.6 and i am stuck on this problem
Debug-iphoneos/ExpoModulesCore/ExpoModulesCore.modulemap' not found
Failed to build iOS project. "xcodebuild" exited with error code 65.
it is possible that pod install failed.
Copy the contents of your Podfile somewhere safe
Run: pod cache clean --all
Remove "Podfile"-file from the dir.
Xcode: Product > Clean Build Folder
Run: pod init. A new "Podfile"-file is added to the dir
Start adding parts of your original Podfile to this file
Run: pod install
Try to build your project again

ReactNative: No `Podfile' found in the project directory

I am working on an existing ReactNative project to add new features to the IOS app. But I tried to build and run the IOS app using "react-native run-ios" command, I am getting the following error.
Could not find "Podfile.lock" at null.lock. Did you run "pod install" in iOS directory?
To resolve the problem, first I run the following command in the ios folder of the project.
pod install
When I do that, I am getting the following error in the console.
[!] No `Podfile' found in the project directory.
To solve that error, I tried doing the following:
I run "sudo gem install cocoapods"
Then in the ios folder I run "pod init"
Then I run "pod install" within the ios folder
Then I got the following error:
[!] The target `xxxxxx xxxTests` is declared multiple times.
I removed the repeating one in the Podfile and tried running pod install again. This time it run but I am getting the following warning.
[!] The Podfile does not contain any dependencies.
[!] Automatically assigning platform `iOS` with version `12.0` on target `Inventory Smart` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
[!] Automatically assigning platform `tvOS` with version `12.0` on target `Inventory Smart-tvOS` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
When I run react-native run-ios, I am getting the following error.
error Could not find "Podfile.lock" at null.lock. Did you run "pod install" in iOS directory?
How can I solve the issue?
Solution 1: The target xxxxxx xxxTests is declared multiple times.
It is pretty much prominent that your Podfile consists of the target xxxxxx-xxxTests multiple times. You just have to go inside the Podfile, and remove the duplicate problematic target xxxxxx-xxxTests code.
It will somehow look like this, you just have to remove one of the two declared code from the Podfile
target 'xxxxxx-xxxTests' do
inherit! :search_paths
# Pods for testing
end
You will be able to run the app now, you just have to do the below commands after you're done with the above fix.
pod install
cd ..
npm run ios
UPDATED ANSWER
Solution 2: Automatically assigning platform iOS with version 12.0
In your top section of Podfile, uncomment # podfile :ios, 'x.0' by removing # from the referred code, here x is the version number which would be there by default, so do not get confused. Or just mention this line globally, podfile :ios, '10.0'. This should ideally fix your issue.
Then run the following commands:
cd ios && rm -rf Pods
pod install
cd ..
react-native run-ios

fatal error: 'openssl/x509.h' file not found in Flutter iOS build after integrating firestore

My Flutter app was integrated with Firebase and the app was building successfully with Firebase core and auth. However when I added the cloud_firestore: ^2.2.0 dependency, the build fails on iOS (still works on Android) with the following error message:
In file included from /Users/charismak/AndroidStudioProjects/foodstack/ios/Pods/gRPC-Core/src/core/ext/filters/client_channel/xds/xds_channel_secure.cc:34:
In file included from /Users/charismak/AndroidStudioProjects/foodstack/ios/Pods/gRPC-Core/src/core/lib/security/credentials/credentials.h:35:
In file included from /Users/charismak/AndroidStudioProjects/foodstack/ios/Pods/gRPC-Core/src/core/lib/security/security_connector/security_connector.h:33:
/Users/charismak/AndroidStudioProjects/foodstack/ios/Pods/gRPC-Core/src/core/tsi/ssl_transport_security.h:28:10: fatal error: 'openssl/x509.h' file not found
#include <openssl/x509.h>
^~~~~~~~~~~~~~~~
1 error generated.
When I remove the dependency, it builds successfully.
I have tried running pod install, flutter clean, changing the deployment target on Xcode and podfile, and installing/upgrading openssl.
It is the same issue as this: Not found 'openssl/x509.h' when install cloud_firesore flutter?
I solved it by running the following commands in terminal inside <your_project_path>/ios:
rm -rf Pods Podfile.lock
pod cache clean --all
pod install
(Installation may take some time to complete)
Source: https://github.com/FirebaseExtended/flutterfire/issues/3203#issuecomment-743789416

Flutter iOS application couldn't run with error app_settings not found

I have a flutter app, everything fine with Android studio and run on Android system smoothly without any problem
When I moved to iOS version, I start facing multiple problems and I solve it all, the last problem is missing app_settings, but the folder already created on the project root.
- I tried to run it through Xcode, it shows an error as shows on the picture:
- I tried to run this command (Flutter run) inside the project directory, it shows this error:
I tried this steps with no solutions:
Changed the rate_my_app version in Pubspec.yaml and Pubspec.lock
Then delete those files:
podfile - podfile.lock - pods folder - build folder
Then run those command inside the project directory:
pod init
add this lines to podfile:
pod 'GoogleMaps'
pod 'Firebase'
pod 'FirebaseAuth'
add this line to AppDelegate.swift
import FirebaseAuth
add this line to lib/models/user/user_model.dart
import 'package:app_settings/app_settings.dart';
then run this command
pod install
Then from Xcode > Product > Clean build folder
The run the app
FYI, the project shows a missing framework which I couldn't find any solution for that except deleting the record from the project every time it shows up.
I found a solution.
The problem was with ios/Flutter directory files, it was missing and some corrupted files.
What did I do is creating another Flutter project with the same project and Bundl name, then I copied the Flutter folder from the new project to my current one.
That fixed everything for me.

Module not found issue with package installed in flutter module (add-to-app)

I have flutter module added to the existing iOS app. Not all but few of the packages installed (via pubspec.yaml file) could not be found by the iOS app when compiled, and I'm getting 'Module not found' error in XCode. Those problematic packages are: razorpay_flutter, google_maps_flutter, webview_flutter, and url_launcher until now. Please have a look at screenshot below:
Same is the case with other 3 packages.
Steps to reproduce issue:
Add razorpay_flutter: ^1.1.3 in the pubspec.yaml file of the
flutter module
Run flutter pub get. The package will install
Run Xcode project to which flutter module is added. Got error!
One more thing I observed after step 2, that there is some warning regarding issue for add to existing app:
Running "flutter pub get" in lib_smazing...
The plugin `razorpay_flutter` is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment.
It may have undefined behaviors when Flutter is integrated into an existing app as a module.
The plugin can be updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.
I guess there is issue with the packages using platform channel/code when added to an existing app, but not sure whether its package-specific issue or a flutter issue with add-to-app.
After few trials and error I found simply running pod install on iOS project directory fixed the issue.
Rather trivial but realized my packages were not found because I opened and executed the wrong file in XCode - so open Runner.xcworkspace and not Runner.xccodeproj
There are multiple solutions available for any kind of library/module not found.
Solution # 1
flutter clean
flutter run again
rebuild it from ios or vscode tool again.
if still problem
pod update
pod repo update
pod install
Solution# 2
delete build folder
delete pod.lock file
delete .syslinks folder
delete pods folder
change your directory in your terminal by
cd ios
pod install --repo-update OR pod repo update
pod install
flutter clean
flutter pub get
Solution# 3
please open Runner.xcworkspac with xcode because app will get local
lib from pod install lib that installed. , but don't Runner.xcodeproj

Resources