Module 'flutter_local_notifications' not found in Xcode - ios

In my app I am using flutter local notifications to push the notifications locally and the version of the package is: flutter_local_notifications: ^1.4.4+4. It is working perfectly fine on android. But it is throwing an error on Xcode saying "Module flutter_local_notifications is not found". Not sure what is causing this issue any help is appreciated.
This is my error:
fatal error: module 'flutter_local_notifications' not found
#import flutter_local_notifications;
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.

Make your iOS version in pod file same as Xcode deployment info in Xcode refer to below images
Xcode deployment info
PodFile

Related

Flutter ios : camera/CameraPlugin.h' file not found

Created Flutter application built on both an Android and iOS device. Application is working fine with android and when i build my ios build it ends up with error as shown below.
Error while executing ios build in android studio using mac device.
i try plenty of method to solve this.
**FOLLOWED SETS:**
Flutter clean
Flutter pub get
Pod install
Build.
Output
Launching lib/main.dart on iPad in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 3MDPB894U7
Running pod install...
Running Xcode build...
Xcode build done. 52.7s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/apple/AndroidStudioProjects/console/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'camera' not found
#import camera;
~~~~~~~^~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
Error launching application on iPad.
Change the target version to above 10.0.
Change in the Project Runner (in Xcode), PodFile & Target Runner (in Xcode), then run Pod Install
Make sure you open the .xcworkspace file instead of the .xcodeproj. This helped me to solve the issue.

Flutter: 'grpcpp/support/byte_buffer.h' file not found

I have yesterday remove my project from my Mac and clone again from the repo. After that have I a problem with building of my Flutter app in the iOS Simulator.
I received fatal error: 'grpcpp/support/byte_buffer.h' file not found.
So I search on Google and tried this solution, but it doesn't works :-(
I don't know anymore what I should do, I hope that it's a little problem.
Please help me, thanks.
Launching lib/main.dart on iPhone 12 in debug mode...
lib/main.dart:1
Xcode build done. 8,8s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
In file included from /Applications/MAMP/htdocs/capido/ios/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.cc:17:
/Applications/MAMP/htdocs/capido/ios/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.h:28:10: fatal error: 'grpcpp/support/byte_buffer.h' file not found
#include "grpcpp/support/byte_buffer.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 12.
Exited (sigterm)
Found the solution that worked for me and which is probably a reason why creating a new user account in OS X worked for #BNetz.
The problem is that CocoaPods cache is somehow corrupted and everytime you execute pod install pods are fetched from this cache.
Easy way to clear the cache is to delete CocoaPods cache folder located here $HOME/Library/Caches/CocoaPods. This way you force CocoaPods to download correct version of pods by executing pod install in your project location.

flutter Ios build fails after upgrading firebase core

I had a flutter app which was working fine with firebase core (version 0.4.0). I upgraded the firebase_core to version 0.5.0 and did all changes as per the migration. After that ios build is giving following error
Launching lib/main.dart on iPhone SE (2nd generation) in debug mode...
Running Xcode build...
Xcode build done. 95.9s
Failed to build iOS app
Error output from Xcode build:
↳
AssertMacros: amdErr = AMDeviceConnect(tmpDevice) == 0 , file:
/BuildRoot/Library/Caches/com.apple.xbs/Sources/MobileDevice/MobileDevice-1190.100.2.1/Source/AMDevicePowerAssertion.c, line: 224, value: -402653083
** BUILD FAILED **
Xcode's output:
↳
<module-includes>:1:1: error: umbrella header for module 'GoogleUtilities' does not include header 'GULLoggerCodes.h' [-Werror,-Wincomplete-umbrella]
#import "Headers/GoogleUtilities-umbrella.h"
^
1 error generated.
In file included from /Users/yogesh/projects/mobile-flutter/ios/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m:24:
/Users/yogesh/projects/mobile-flutter/ios/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Logger/Private/GULLogger.h:22:9: fatal error: could not build module
'GoogleUtilities'
#import <GoogleUtilities/GULLoggerLevel.h>
~~~~~~~^
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
It is running fine in android and even building ios build from xcode also works fine. Its build and run from command line which fails (flutter run)
Following is my pubspec file containing firebase dependency
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.5.0
firebase_auth: ^0.18.0+1
cloud_firestore: ^0.14.0+2
sqflite:
path:
progress_dialog: ^1.2.4
i am not able to understand is it because of library error or something from my side because it seems lib error but android and ios build from xcode works totally fine.
Run command
flutter clean
And then re-run the application works for me.
I have just had the same issue as in I was able to run the app from XCode Runner but not from within Android Studio with the same exact error message. I managed to fix the issue via these steps:
Adding firebase_analytics: ^6.0.0 to pubspec.yaml.
Then removing Podfile and Podfile.lock.
And finally running it again.
However I cannot tell you why exactly it resolved the issue so cannot really guarantee this will work out for you.
delete Podfile and Podfile.lock and run it, it will work

Xcode fails to build flutter code for ios 13.3.1 device but runs code on 13.3 ios simulator

below is what I am getting on Xcode 11.3.1 and ios 13.3.1. what shall I do?
the code works on the ios simulator and builds for it is always successful. so where is the issue? what's wrong here, or am I missing some thing here?
I did try the clear / install pods method but nothing has been working for me.
iMac:x me$ flutter build ios
The plugin `device_id` 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.
Building com.x.demo for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: MHUCCU5SX2
Running pod install... 5.9s
Running Xcode build...
├─Building Dart code... 61.5s
├─Generating dSYM file... 1.0s
├─Stripping debug symbols... 0.9s
├─Assembling Flutter resources... 1.9s
└─Compiling, linking and signing... 20.5s
Xcode build done. 239.8s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
The plugin `device_id` 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.
Building AOT snapshot in release mode (ios-release)...
Building App.framework for arm64...
Building App.framework for armv7...
Building AOT snapshot in release mode (ios-release)... 60.1s
Built to build/aot/.
warning: parsing line table prologue at offset 0x6f697463 found unsupported version 0x00
warning: line table parameters mismatch. Cannot emit.
note: while processing /Users/me/AndroidStudioProjects/x/build/aot/armv7/snapshot_assembly.o
The plugin `device_id` 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.
Project /Users/me/AndroidStudioProjects/x built and packaged successfully.
ld: warning: ignoring file /Users/me/AndroidStudioProjects/x/ios/Flutter/App.framework/App, building for iOS-armv7 but
attempting to link with file built for iOS Simulator-x86_64
ld: warning: ignoring file /Users/me/AndroidStudioProjects/x/ios/Flutter/App.framework/App, building for iOS-arm64 but
attempting to link with file built for iOS Simulator-x86_64
error: the following command failed with exit code 0 but produced no further output
Ld
/Users/me/Library/Developer/Xcode/DerivedData/Runner-axlithrrzxajtgfxqkefalkhujgj/Build/Intermediates.noindex/Runner.build/Release-iphoneos/Runner.build/Objec
ts-normal/arm64/Binary/Runner normal arm64
/* com.apple.actool.document.warnings */
/Users/me/AndroidStudioProjects/x/ios/Runner/Assets.xcassets:./AppIcon.appiconset/(null)[2d][Icon-App-50x50#1x.png]: warning:
The app icon set "AppIcon" has 6 unassigned children.
/Users/me/AndroidStudioProjects/x/ios/Runner/Assets.xcassets:./AppIcon.appiconset/(null)[2d][Icon-App-50x50#1x.png]: warning:
The app icon set "AppIcon" has 6 unassigned children.
/* com.apple.actool.compilation-results */
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon20x20#2x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon20x20#3x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29#2x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29#3x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon40x40#2x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon40x40#3x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon60x60#2x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon60x60#3x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon20x20~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon20x20#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon40x40~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon40x40#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon76x76~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon76x76#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon83.5x83.5#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/Assets.car
/Users/me/Library/Developer/Xcode/DerivedData/Runner-axlithrrzxajtgfxqkefalkhujgj/Build/Intermediates.noindex/Runner.build/Release-iphoneos/Runner.build/asset
catalog_generated_info.plist
Non-fat binary /Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/Frameworks/App.framework/App is not
armv7. Running lipo -info:
Non-fat file: /Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/Frameworks/App.framework/App is
architecture: x86_64
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning build
note: Constructing build description
This is a known issue with iOS 13.3.1 signing. It has no solution at this point in time. Current options include:
Use simulated device (rather than physical iPhone)
Use device with older iOS version
Use paid developer account (not personal team)
See this discussion that has up to date info:
https://github.com/flutter/flutter/issues/49504
For me the solution was to move to legacy mode buildfromNew Build` and everything worked properly !
It has been confirmed that the issue is fixed in iOS 13.4 beta 3 (17E5241d) release.

Can't build for release - Flutter, Xcode

I have built a couple of Flutter apps using IntelliJ and xcode on a Mac server to build for ios release, and it has worked fine. Now I am suddenly having troubles building for release.
To test to see if it was something in my app, I just started a new app from scratch in IntelliJ on the server, configured the framework (including directing to the flutter install), and tested it out.
It builds and runs on the simulator just fine. But when I try to build for release ("flutter build ios" from command line) I get an error, which I will paste at the end of this message.
I have been trying for some time to figure out why I am getting the errors when building my app. Now even the default app seems broken.
Does the problem have something to do with the server?
Thank you.
The error message that I get when building for release (I gave the project a silly name, added an icon, and gave the app a build and version number, but otherwise it is an untouched flutter default app):
74-80-250-218:untitled userxxxxx$ flutter build ios
Building com.burrito.untitled for device (ios-release)...
Automatically signing iOS for device deployment using specified development team
in Xcode project: xxxxxxxxxx
Running Xcode build...
├─Building Dart code... 22.7s
├─Generating dSYM file... 0.2s
├─Stripping debug symbols... 0.0s
├─Assembling Flutter resources... 1.2s
└─Compiling, linking and signing... 0.2s
Xcode build done. 26.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
In file included from
/Users/userxxxxxx/Desktop/untitled/ios/Runner/GeneratedPluginRegistrant.m:5:
/Users/userxxxxxx/Desktop/untitled/ios/Runner/GeneratedPluginRegistrant.h:8:
9: fatal error: 'Flutter/Flutter.h' file not found
#import
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from
/Users/userxxxxx/Desktop/untitled/ios/Runner/GeneratedPluginRegistrant.m:5:
/Users/userxxxxxx/Desktop/untitled/ios/Runner/GeneratedPluginRegistrant.h:8:
9: fatal error: 'Flutter/Flutter.h' file not found
#import
^~~~~~~~~~~~~~~~~~~
1 error generated.
Encountered error while building for device.
You could try deleting the ios folder on the project and generate an iOS build again by running flutter create --platforms=ios [PROJECT_PATH]. That should generate an iOS project from your Flutter code. After that, run flutter build ios again.

Resources