New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Add2App] No constructor 'Text.' with matching arguments declared in class 'Text'. #109602
Comments
Hi @zerryzarax
It looks like it's caused by a syntax error. It should be |
hi @huycozy |
At present, I have found a temporary adaptation solution:
|
Hello @zerryzarax. Thank you for the information. Can you provide a minimal, reproducible example in the form of a public repository so that we can investigate this issue? |
hi @exaby73 ,there is a bug demo,https://github.com/zerryzarax/flutter-3.0.3-bug-test-demo |
@zerryzarax I am unable to run the project you have provided. Could you provide some steps to run the project which has caused you to get this error? |
@exaby73
|
Hi @zerryzarax, thanks for providing very detailed steps to reproduce.
Logs➜ dart_demo git:(main) flutter attach
Multiple devices found:
iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios • iOS 15.5 19F77
iPhone 13 (mobile) • 2526BC1A-435D-4B08-B99C-44B928F2517B • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
[1]: iPhone (d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e)
[2]: iPhone 13 (2526BC1A-435D-4B08-B99C-44B928F2517B)
Please choose one (To quit, press "q/Q"): 2
Syncing files to device iPhone 13... 8.1s
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
💪 Running with sound null safety 💪
An Observatory debugger and profiler on iPhone 13 is available at: http://127.0.0.1:53510/QmQvQYXYoMY=/
The Flutter DevTools debugger and profiler on iPhone 13 is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:53510/QmQvQYXYoMY=/
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following NoSuchMethodError was thrown building ContainerMain(dirty, state:
_ContainerMain#a57e2):
No constructor 'Text.' with matching arguments declared in class 'Text'.
Receiver: Text
Tried calling: new Text.()
Found: new Text.(String, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign,
TextDirection? textDirection, Locale? locale, bool? softWrap, TextOverflow? overflow, double?
textScaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? textWidthBasis,
TextHeightBehavior? textHeightBehavior}) => Text
Widget creation tracking is currently disabled. Enabling it enables improved error messages. It can
be enabled by passing `--track-widget-creation` to `flutter run` or `flutter test`.
When the exception was thrown, this was the stack:
#0 NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:216:5)
#1 _ContainerMain.build (package:dart_demo/container.dart)
#2 StatefulElement.build (package:flutter/src/widgets/framework.dart:4919:27)
#3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4806:15)
#4 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#5 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#6 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2659:19)
#7 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:891:21)
#8 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:370:5)
#9 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1146:15)
#10 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1083:9)
#11 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:864:7)
(elided 4 frames from class _RawReceivePortImpl, class _Timer, and dart:async-patch)
════════════════════════════════════════════════════════════════════════════════════════════════════
Performing hot reload...
Reloaded 1 of 586 libraries in 426ms. flutter doctor -v[✓] Flutter (Channel stable, 3.0.5, on macOS 12.2.1 21D62 darwin-x64, locale en-VN)
• Flutter version 3.0.5 at /Users/huynq/Documents/GitHub/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f1875d570e (9 hours ago), 2022-07-13 11:24:16 -0700
• Engine revision e85ea0e79c
• Dart version 2.17.6
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
• IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.69.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.44.0
[✓] Connected device (3 available)
• SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 11 (API 30)
• macOS (desktop) • macos • darwin-x64 • macOS 12.2.1 21D62 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.114
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
[✓] Flutter (Channel master, 3.1.0-0.0.pre.2428, on macOS 12.5 21G72 darwin-x64, locale en-EE)
• Flutter version 3.1.0-0.0.pre.2428 on channel master at /Users/huynq/Documents/GitHub/flutter_master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 328545e5af (40 minutes ago), 2022-08-22 22:31:06 -0400
• Engine revision ca48808d06
• Dart version 2.19.0 (build 2.19.0-124.0.dev)
• DevTools version 2.16.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 13E113
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
• IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.70.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.46.0
[✓] Connected device (3 available)
• iPhone 13 (mobile) • 2526BC1A-435D-4B08-B99C-44B928F2517B • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 12.5 21G72 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.101
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
|
Not sure why the // The compiler emits a call to _throwNew when it cannot resolve a static
// method at compile time. The receiver is actually the literal class of the
// unresolved method.
@pragma("vm:entry-point", "call")
static void _throwNew(
Object receiver,
String memberName,
int invocationType,
int typeArgumentsLength,
Object? typeArguments,
List? arguments,
List? argumentNames) {
throw new NoSuchMethodError._withType(receiver, memberName, invocationType,
typeArgumentsLength, typeArguments, arguments, argumentNames);
} This doesn't reproduce from the Flutter module, just from the embedded add-to-app case. |
//cc @rmacnak-google a hot reload issue, though not sure why it should be an iOS only problem. |
I'm facing the issue on my android device. |
I'm using flutter module in my existing iOS app. While making changes Text, I use hot reload to see the output. It was working bad, Whether I use an emulator or iphone.(only way it work fine,it‘s using ’flutter run‘ directly rather than using xcode run) its giving me the exception like this:
======== Exception caught by widgets library =======================================================
The following NoSuchMethodError was thrown building ContainerMain(dirty, state: _ContainerMain#f0c96):
No constructor 'Text.' with matching arguments declared in class 'Text'.
Receiver: Text
Tried calling: new Text.()
Found: new Text.(String, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, Locale? locale, bool? softWrap, TextOverflow? overflow, double? textScaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior}) => Text
example code:
evironment:
1、flutter
[✓] Flutter (Channel stable, 3.0.3, on macOS 12.5 21G72 darwin-x64, locale
zh-Hans-CN)
• Flutter version 3.0.3 at /Users/xxxxx/Documents/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 676cefa (8 weeks ago), 2022-06-22 11:34:49 -0700
• Engine revision ffe7b86a1e
• Dart version 2.17.5
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version
32.1.0-rc1)
• Android SDK at /Users/xxxxx/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
11.0.12+0-b1504.28-7817840)
in flutter module
The text was updated successfully, but these errors were encountered: