Flutter, trying to add shared_preference error - flutter

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

Related

failed iOS build from Codemagic

Im trying to build a iOS in codemagic.io and after try it, it return the error below
== Building for iOS ==
> flutter build ios --debug --no-codesign
Running "flutter pub get" in clone... 1,350ms
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.testing.correiosNovo for device (ios)...
Upgrading Info.plist
Running pod install... 1,296ms
Running Xcode build...
Xcode build done. 14.6s
Build failed :|
Failed to build for iOS
Failed to build iOS app
Error output from Xcode build:
↳
2022-09-23 23:19:22.708 xcodebuild[1114:7432] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-09-23 23:19:22.709 xcodebuild[1114:7432] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
** BUILD FAILED **
Xcodes output:
↳
Writing result bundle at path:
../programs/flutter_3_3_2/.pub-cache/hosted/pub.dartlang.org/win32-2.3.6/lib/src/structs.g.dart:661:31: Error: Member not found: 'UnicodeChar'.
int get UnicodeChar => Char.UnicodeChar;
^^^^^^^^^^^
../programs/flutter_3_3_2/.pub-cache/hosted/pub.dartlang.org/win32-2.3.6/lib/src/structs.g.dart:662:38: Error: Setter not found: 'UnicodeChar'.
set UnicodeChar(int value) => Char.UnicodeChar = value;
^^^^^^^^^^^
../programs/flutter_3_3_2/.pub-cache/hosted/pub.dartlang.org/win32-2.3.6/lib/src/structs.g.dart:664:29: Error: Member not found: 'AsciiChar'.
int get AsciiChar => Char.AsciiChar;
^^^^^^^^^
../programs/flutter_3_3_2/.pub-cache/hosted/pub.dartlang.org/win32-2.3.6/lib/src/structs.g.dart:665:36: Error: Setter not found: 'AsciiChar'.
set AsciiChar(int value) => Char.AsciiChar = value;
^^^^^^^^^
Failed to package /Users/builder/clone.
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
Result bundle written to path:
Encountered error while building for device.
I do the process to build iOS in my computer
flutter build ios
after it, upload to Codemagic and start the process to generate app to iOS, but it return the error above, I try to find any solution to it, and can't, it returns the error every time I build it.
I think you use old Flutter version on your local machine and latest 3.3.2 when you building on Codemagic and some packages are not compatible with this version.
At Codemagic you can specify any Flutter version in build settings to reproduce your local environment and this should fix the error.
Alternative solution will be to upgrade your packages. Check this thread for more information https://github.com/flutter/flutter/issues/103565

GeneratedPluginRegistrant.m:12:9: fatal error: module 'device_info' not found when build flutter app

When I start build the flutter 2.10.x project in macOS 12.4, shows error like this:
"af": 5 untranslated message(s).
To see a detailed report, use the untranslated-messages-file
option in the l10n.yaml file:
untranslated-messages-file: desiredFileName.txt
<other option>: <other selection>
This will generate a JSON format file containing all messages that
need to be translated.
Launching lib/main_pro.dart on iPod touch (7th generation) in debug mode...
Running Xcode build...
Xcode build done. 7.1s
Failed to build iOS app
Error output from Xcode build:
↳
2022-06-29 22:18:45.452 xcodebuild[24800:2158061] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-06-29 22:18:45.452 xcodebuild[24800:2158061] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-06-29 22:18:45.573 xcodebuild[24800:2158072] apply_selection_policy_once: avoid use of removable GPUs (via com.apple.dt.xcodebuild:GPUSelectionPolicy->avoidRemovable)
** BUILD FAILED **
Xcode's output:
↳
/Users/xiaoqiangjiang/source/reddwarf/frontend/cruise-open/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'device_info' not found
#import device_info;
~~~~~~~^~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Could not build the application for the simulator.
Error launching application on iPod touch (7th generation).
anyone facing the similiar problem? what should I do to fixed this problem?

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.

How different problems with flutter 2 on some of my apps

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.

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