-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Method 'replaceFirst' cannot be called on 'String?' because it is potentially null. Try calling using ?. instead. #72216
Comments
|
Can you provide minimal complete reproducible code sample? |
Hi @jinfagang |
Anybody found the solution I'm having this problem too |
This problem I got is runing this project: https://github.com/PotatoProject/Leaflet |
Hi @jinfagang @KingOfPeru Please provide the complete output of |
@pedromassango @pedromassangocode Maybe @KingOfPeru can provides some detail |
The same issue occurs to me: Launching lib\main.dart on SM N960N in debug mode... Running Gradle task 'assembleDebug'... /~~/flutter/packages/flutter_localizations/lib/src/material_localizations.dart:413:7: Error: Method 'replaceFirst' cannot be called on 'String?' because it is potentially null. Try calling using ?. instead. ).replaceFirst(r'$selectedRowCount', formatDecimal(selectedRowCount)); ^^^^^^^^^^^^ /~~/flutter/packages/flutter_localizations/lib/src/material_localizations.dart:550:7: Error: Method 'replaceFirst' cannot be called on 'String?' because it is potentially null. Try calling using ?. instead. ).replaceFirst(r'$licenseCount', formatDecimal(licenseCount)); ^^^^^^^^^^^^ /~~/flutter/packages/flutter_localizations/lib/src/material_localizations.dart:659:7: Error: Method 'replaceFirst' cannot be called on 'String?' because it is potentially null. Try calling using ?. instead. ).replaceFirst(r'$remainingCount', formatDecimal(remainingCount)); ^^^^^^^^^^^^ $ flutter doctor -v [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [√] Chrome - develop for the web [√] Android Studio (version 4.1.0) [√] Connected device (3 available) • No issues found! $ flutter channel (beta, the same issue at master ) Flutter channels: master dev * beta stable $ about my_app.yaml ( some ommited because it is too large ) environment: sdk: ">=2.7.0 <3.0.0" #sdk: ">=2.12.0-0 <3.0.0" dependencies: flutter: sdk: flutter easy_localization: ^2.3.3+1 intl : ^0.17.0-nullsafety.2 dependency_overrides: intl: 0.16.0 |
Hi @kyounglee Logs
pubspec.yaml
flutter doctor
|
Without additional information, we are unfortunately not sure how to resolve this issue. Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of |
I also face same issue with same package versions |
I have the same issue since upgrading to 2.0.1.
Error log:
|
I Faced this issue when I upgraded flutter to flutter 2, it caused by (flutter_localizations ) package. I solved it by modifying "material_localizations.dart" file and commenting this line in every place it caused the error: Hope this help you! |
Same issue since upgrading to 2.0.1 |
Same here |
|
I have resolve it in my case by changing branch to stable, 2.0.1 |
I'm on the latest stable, 2.0.1 and still have this issue |
I'm on 2.0.2 still having the same issue. |
Doctor summary (to see all details, run flutter doctor -v): • No issues found! FAILURE: Build failed with an exception.
BUILD FAILED in 36s |
I'm on Flutter (Channel stable, 2.0.4, on Mac OS X 10.15.6 19G73 darwin-x64, locale en-GB) same issue. Help needed. Thanks |
@Nerogee did you solved this issue? Doctor summary (to see all details, run flutter doctor -v): pub: version: 1.0.0+1 environment: dependencies: The following adds the Cupertino Icons font to your application.Use with the CupertinoIcons class for iOS style icons.cupertino_icons: ^0.1.2 webview_flutter: ^webview_flutter: ^0.3.24 dev_dependencies: flutter_icons: dependency_overrides: error:
|
@adnandogar at last i downgrade flutter back to version 1 and update pub again. After that, all work again. |
Same issue
|
@MurtuzaSrashtaSoft downgrade this dependency to lower version and try: or try lower, it may help you. |
Try using intl: 0.17.0 working for me for flutter v2.2.1 |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
The text was updated successfully, but these errors were encountered: