when upgrade firebase_messaging to version 3.0.0 it is work correctly with android but in IOS build failed
BUILD TARGET firebase_messaging OF PROJECT Pods WITH CONFIGURATION Debug
/Users/----/Libraries/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-3.0.0/ios/Classes/FirebaseMessagingPlugin.m:79:33: error: expected ')'
instanceIDWithHandler:^(FIRInstanceIDResult *_Nullable instanceIDResult,
Please open up a terminal and navigate to your Flutter project directory.
Clean via flutter clean
Then cd into the iOS Folder and execute pod install
You may also want to update your pods via pod update
You may be able to run your project now.
Related
I am working on a React Native Project based on a bare workflow, and my project is not working on Xcode.
I use expo modules but when i want to setup my ios project by the command "expo prebuild" i get the following error:
⚠️ Something went wrong running pod install in the ios directory.
Command pod repo update failed.
└─ Cause: Couldn't install: EXFont » UMCore. Ensure the CocoaPod "UMCore" is installed in your project, then run npx pod-install to try again.
It seems Cocoapods did not install this file.. but i have no idea how to do it.
And When i launch the command "pod install" i get :
"[!] Unable to find a specification for UMCore depended upon by EXFont"
I followed this guide from Expo : https://github.com/expo/fyi/blob/main/expo-modules-migration.md
It works fine on my Android Project.
I got the latest version of Expo and CocoaPods and my Xcode version is 13.0.
Any idea ? I did not found a lot of topics on this subject, and none solve this error...
I had similar errors after updating the expo.
In my case it was:
[!] Unable to find a specification for UMCore depended upon by EXSecureStore
[!] Unable to find a specification for UMCore depended upon by EXLinearGradient
Solution
expo install expo-secure-store
expo install expo-linear-gradient
cd ios
pod install --repo-update --clean-install
To solve your issue, I think you need to do:
expo install expo-font
cd ios
pod install # or `pod install --repo-update --clean-install`
I'm trying to build a Flutter app for iOS, but I'm running into a weird issue where flutter build can't locate one of the header files (that's physically where it needs to be inside the Pods directory).
This is what I get when I try to build the app:
:ghost: zmeggyesi#Shiny-Platform:/Users/zmeggyesi/projects/site-overwatch/frontend/ios (tags/release-2.6.0)
$ flutter build ios --release --no-codesign --no-tree-shake-icons
Changing current working directory to: /Users/zmeggyesi/projects/site-overwatch/frontend
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building hu.skawa.dive-site-overwatch-ios for device (ios-release)...
Running pod install... 21.6s
Running Xcode build...
└─Compiling, linking and signing... 12.2s
Xcode build done. 50.8s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Firebase.h"
^
/Users/zmeggyesi/projects/site-overwatch/frontend/ios/Pods/Firebase/CoreOnly/Sources/Firebase.h:15:9: error:
'FirebaseCore/FirebaseCore.h' file not found
#import <FirebaseCore/FirebaseCore.h>
^
/Users/zmeggyesi/projects/site-overwatch/frontend/ios/Runner/AppDelegate.swift:3:8: error: could not build Objective-C module
'Firebase'
import Firebase
^
Command CompileSwift failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
Encountered error while building for device.
And I'm kind of at a loss as to what might be causing this, or how to get around it.
The relevant Firebase declarations in my Pubspec:
firebase_core: 1.1.1
firebase_crashlytics: 2.0.3
firebase_analytics: 8.0.4
firebase_auth: 1.1.4
firebase_remote_config: 0.10.0-dev.3
firebase_storage: 8.0.6
So far, I've tried:
Nuking the Pods directory and the Podfile.
Commenting out the Firebase dependencies from my pubspec, followed by a flutter pub upgrade to update the lockfile, then doing a pod install before re-enabling them to re-download the pods.
Running flutter create . to regenerate the project descriptors.
Nuking the derived data dir (~/Library/Developer/Xcode/DerivedData), the Workspace descriptor, and the Pods/Podfile to regenerate everything from scratch.
This seems to be an issue only since I migrated to Flutter 2 and the latest packages, and only when I try to build in release mode (running the app in debug via XCode or Android Studio seems to work fine).
Correction: now even the XCode native build is broken, with the same error...
Anyone have any more ideas I could try? This is driving me crazy...
try to change global platform in Podfile this:
Uncomment the next line to define a global platform for your project
-# platform :ios, '9.0'
+ platform :ios, '13.0'
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
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.46.1)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
\\\Error Message
** BUILD FAILED **
Xcode's output:
↳
/Users/Razi/Desktop/projects/Sayy/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
I have tried deleting Podfile/Podlock and running pod init/ pod install without success. Also have reviewed the GitHub repo for ios folder. Why is firebase_auth not found?
Update: I was able to eventually find a workaround by executing the following:
Running Flutter Clean (in ios folder of project)
Deleting both Podlock & Pod Folder
Running pod init followed by pod install
seems to be an issue with the runner.xcworkspace folder and the build
files needed to run builds.
I tried to follow suggested steps of executing Flutter clean, manually removing podfile and podfile.lock along with Pod related folders, executing pod install again, etc. - nothing helped.
What helped me in the end was the following sequence:
Create a new project with same dependencies declared in the pubspec.yaml.
Run pub get in the new project.
Run pod install in the new project to get everything generated
Copy newly generated podfile and podfile.lock files to the old project.
Run pod install in the old project.
Only after this sequence I was able to build the iOS project again.
These steps helped me to resolve the issue completely for IOS:
>> flutter clean
then "delete podfile, podfile.lock, pod folder"
>> flutter pub get
>> pod install
>> flutter run
It seems like you provided not a full Podfile's content (I can't see anything about Sayy target there) or you've been changing Podfile
Depending on what you trying to archive either remove last 3 lines in Podfile or move line "pod 'AFNetworking', '~> 3.0'" to target 'Runner' right after 'use_modular_headers!'
open XCode toppest item in left sidebar (blue icon) -> in leftest menu you will see two sections — Project and Targets. So names that are in 'targets' block — is the only one that can appear in Podfile after keyword 'target'
everything depends on:
do you need AFNetworking?
what targets do you have in your application
I have got rid of this issue buy un-commenting the line in Podfile
platform :ios, '10.0'
Also delete clean your project and rebuild again!
Change the Deployment target for ios either in build settings-> Deployment in xcode or in podfile set deployment target greater than 10
Here's what worked for me
Find the latest version of firebase_core / firebase_auth on pub.dev
Clear your Pods/ and Podfile.lock in the ios folder
Run pod install --repo-update in the ios folder (IMPORTANT!)
Here are the steps which worked for me:
Delete ios > Pods
Delete ios > Podfile, Podfile.lock
flutter clean
flutter run
After executing these three commands in this order, pod install started, and it was done.
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