How different problems with flutter 2 on some of my apps - flutter

I have several problems after updating to flutter 2 someone can help me solve them, I list the log below
Flutter console error:
objc[88773]: Class AMSupportURLConnectionDelegate is implemented in both ??
(0x1f9b08188) and ?? (0x113d382b8). One of the two will be used. Which one is undefined.
objc[88773]: Class AMSupportURLSession is implemented in both ?? (0x1f9b081d8) and ??
(0x113d38308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
Command CompileSwift failed with a nonzero exit code
In file included from
/Users/user/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Classes/
SharedPreferencesPlugin.m:5:
/Users/user/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.3/ios/Classes/
SharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
Command CompileSwift failed with a nonzero exit code
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 descriptionuser

I had the same issue. I saw the same error when I ran flutter build ios.
The error message was displayed red color on my VS code terminal, but it was kind of misleading. I found it was not the main issue.
The actual issue should be on the following error section.
So, please run flutter build ios --verbose and read the output carefully.
In my situation, there were other issues of the failure of flutter build ios. The issues were like forget to put in GoogleService-Info.plist or iOS target version is less than the requirement of flutter packages.

Related

iOS Simulator is not working the error code is objc[7830] in android studio

enter image description hereFailed to build iOS app
Error output from Xcode build:
↳
objc[7830]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x21ca5ab90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10443c2c8). One of the two will be used. Which one is undefined.
objc[7830]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x21ca5abe0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10443c318). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
Failed to package /Users/yashvardhan./AndroidStudioProjects/Yashvardhan.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 13.
First of all run
flutter doctor
to ensure that you have no issues with you development environment.
If it looks fine try
flutter clean
flutter pub get
and then try to run the app again.
As an additional step you can clean up the Derived data in XCode before rebuilding an app.

Flutter.h not found issue Flutter 2

I am having this issue where I the application isn't building because it says
fatal error: 'Flutter/Flutter.h'
file not found
#import <Flutter/Flutter.h>
I've been working on this issue the whole day, but haven't gotten anywhere. It's a simple program (the initial code that you get when you open flutter new project), and have added firebase_core.
Whole XCode output:
Xcode's output:
↳
In file included from
/Users/alfieanil/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_cor
e-1.10.0/ios/Classes/FLTFirebaseCorePlugin.m:5:
/Users/alfieanil/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_cor
e-1.10.0/ios/Classes/FLTFirebaseCorePlugin.h:9:9: fatal error: 'Flutter/Flutter.h'
file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
My Flutter was working fine until a month or two ago. Flutter version = 2.0.6
Any help is greatly appreciated.
Thanks
I managed to fix it by following these steps:
1. Open your terminal in root level of your project.
2. run flutter upgrade.
3. Change SDK version in pubspec.yaml file
4. In my pubspec.yaml I just changed This line sdk: “>=2.7.0 <3.0.0” and replaced with sdk: “>=2.12.0 <3.0.0”
5. flutter clean
6. flutter run.
Original Link: https://fluttercorner.com/error-null-safety-features-are-disabled-for-this-library/ (solution 1)

xcode Firebase Crashlytics Command PhaseScriptExecution failed with a nonzero exit code

I have an application that I wrote with swift. I want to see crash reports of the app after the release. I want to add Firebase Crashlytics for this. I do everything in this link. but during compilation i get the following error:
/bin/sh: /Users/durak/Library/Developer/Xcode/DerivedData/Kelimeci-auysdliostxzkgcllzdsmxabridn/Build/Intermediates.noindex/Kelimeci.build/Debug-iphonesimulator/Kelimeci.build/Script-65F1AA5C273CEB5C00F5B530.sh: /bin/shr: bad interpreter: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
I've been searching for hours and can't find a solution. I removed the pod and reinstalled it, still didn't work. What is the problem, where am I going wrong?
xcode 12.5
I have the same problem.
In my situation because I use nvm and node version 16.13.1 when I change the version to 16.6.0 it fixes the problem.
nvm alias default 16.6.0

Flutter, trying to add shared_preference error

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
lib/main.dart:1
Xcode build done. 7.9s
Failed to build iOS app
Error output from Xcode build:
↳
objc[67482]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1faf938f0) and ?? (0x118b582b8). One of the two will be used. Which one is undefined.
objc[67482]: Class AMSupportURLSession is implemented in both ?? (0x1faf93940) and ?? (0x118b58308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
/Users/rafy/Desktop/change_to_evo/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'shared_preferences' not found
#import shared_preferences;
add 'shared_preferences: ^0.5.12+4' to your pubspec. and run following commands to use it.
flutter clean
flutter packages get

flutter: Error: The non-abstract class 'RenderParagraphX' is missing implementations for these members, caused by sliding_up_panel-1.0.2

Since I updated flutter, yesterday, I am receiving the following error message:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 23,5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
../../.pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-1.3.4/lib/src/text_one_line.dart:207:7: Error: The non-abstract class 'RenderParagraphX' is missing implementations for these members:
- RenderParagraph.getFullHeightForCaret
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class RenderParagraphX extends RenderBox
^^^^^^^^^^^^^^^^
../../Applications/flutter%20env/flutter/flutter/packages/flutter/lib/src/rendering/paragraph.dart:750:11: Context: 'RenderParagraph.getFullHeightForCaret' is defined here.
double? getFullHeightForCaret(TextPosition position) {
^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/sliding_up_panel-1.0.2/lib/src/panel.dart:218:44: Error: Too few positional arguments: 1 required, 0 given.
VelocityTracker _vt = new VelocityTracker();
^
../../Applications/flutter%20env/flutter/flutter/packages/flutter/lib/src/gestures/velocity_tracker.dart:152:3: Context: Found this candidate, but the arguments don't match.
VelocityTracker(this.kind);
^^^^^^^^^^^^^^^
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
So I assume sliding_up_panel-1.0.2 has some issue with the newest release.
Unless I want to rely on a soon release of 1.0.3, I guess my only chance is to roll back to the previous flutter release, right (ok, I could also disable all related functionality)?
Is there a simpler approach than to uninstall and re-install the previous version via shell commands. Last time I had quite some difficulties with some configuration files. Currently I am enjoying the neat update feature of IntelliJ IDEA (besides, I am using a Mac).
I can build again :-D
this is what I have done, in case some else experiences this problem:
flutter channel stable
flutter upgrade
flutter clean
PS: Before, I removed all traces of sliding_up_panel, but still got the build errors. Now everything works, including the sliding_up_panel