Skip to content
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

Closed
lucasjinreal opened this issue Dec 13, 2020 · 27 comments
Labels
in triage Presently being triaged by the triage team

Comments

@lucasjinreal
Copy link

../../../../development/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));
      ^^^^^^^^^^^^                                                      
../../../../development/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));      
      ^^^^^^^^^^^^                                                      
../../../../development/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));  
      ^^^^^^^^^^^^                                                      
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                          
@lucasjinreal
Copy link
Author

[✓] Flutter (Channel master, 1.25.0-9.0.pre.42, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.45.1)
[✓] Connected device (3 available)

• No issues found!

@yash1200
Copy link
Contributor

Can you provide minimal complete reproducible code sample?

@pedromassangocode
Copy link

Hi @jinfagang
Please provide the reproducible steps.

@pedromassangocode pedromassangocode added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Dec 14, 2020
@KingOfPeru
Copy link

Anybody found the solution I'm having this problem too

@lucasjinreal
Copy link
Author

This problem I got is runing this project: https://github.com/PotatoProject/Leaflet
it claims compatible with master branch but actually occured this issue.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 4, 2021
@pedromassangocode
Copy link

pedromassangocode commented Jan 4, 2021

Hi @jinfagang @KingOfPeru
Are you able to reproduce the issue on a Flutter project without any third-party plugin/package?

Please provide the complete output of flutter doctor -v and the complete logs.

@pedromassangocode pedromassangocode added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 4, 2021
@lucasjinreal
Copy link
Author

@pedromassango @pedromassangocode Maybe @KingOfPeru can provides some detail

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 4, 2021
@pedromassangocode pedromassangocode added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 4, 2021
@kyounglee
Copy link

kyounglee commented Jan 6, 2021

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
[√] Flutter (Channel beta, 1.25.0-8.1.pre, on Microsoft Windows [Version 10.0.19041.685], locale ko-KR)
• Flutter version 1.25.0-8.1.pre at C:\flutter
• Framework revision 8f89f65 (3 weeks ago), 2020-12-15 15:07:52 -0800
• Engine revision 92ae191c17
• Dart version 2.12.0 (build 2.12.0-133.2.beta)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users~~\AppData\Local\Android\Sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: ~~\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at ~~\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
• Android Studio at ~~\Android\Android Studio1
• 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 1.8.0_242-release-1644-b01)

[√] Connected device (3 available)
• SM N960N (mobile) • 2958a1d5be1c7ece • android-arm64 • Android 10 (API 29)
• Chrome (web) • chrome • web-javascript • Google Chrome 87.0.4280.88
• Edge (web) • edge • web-javascript • Microsoft Edge 87.0.664.66

• 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 )
=> I am using intl : ^0.17.0-nullsafety.2 and override intl: 0.16.0

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

@pedromassangocode
Copy link

Hi @kyounglee
I still cannot reproduce the issue on latest master and beta channels.

Logs
Launching lib/main.dart on sdk gphone x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk...
I/flutter_exampl(21978): Not late-enabling -Xcheck:jni (already on)
I/flutter_exampl(21978): Unquickening 12 vdex files!
W/flutter_exampl(21978): Unexpected CPU variant for X86 using defaults: x86_64
W/flutter_example(21978): type=1400 audit(0.0:281): avc: denied { read } for name="max_map_count" dev="proc" ino=1856226 scontext=u:r:untrusted_app_27:s0:c155,c256,c512,c768 tcontext=u:object_r:proc_max_map_count:s0 tclass=file permissive=0 app=com.example.flutter_example
W/flutter_exampl(21978): Accessing hidden method Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J (greylist,test-api, reflection, allowed)
W/flutter_exampl(21978): Accessing hidden method Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J (greylist, reflection, allowed)
W/flutter_exampl(21978): Accessing hidden field Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; (greylist, reflection, allowed)
W/flutter_exampl(21978): Accessing hidden method Landroid/util/LongArray;->get(I)J (greylist, reflection, allowed)
Debug service listening on ws://127.0.0.1:54072/H9L8fnP679U=/ws
Syncing files to device sdk gphone x86 64...

pubspec.yaml
version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  intl : ^0.17.0-nullsafety.2

dependency_overrides:
  intl: 0.16.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_driver:
    sdk: flutter
  integration_test: ^1.0.1
  test: any
flutter doctor
[✓] Flutter (Channel beta, 1.25.0-8.2.pre, on Mac OS X 10.15.7 19H2 darwin-x64, locale en)
    • Flutter version 1.25.0-8.2.pre at /Users/pedromassango/dev/SDKs/flutter_beta
    • Framework revision b0a2299859 (17 hours ago), 2021-01-05 12:34:13 -0800
    • Engine revision 92ae191c17
    • Dart version 2.12.0 (build 2.12.0-133.2.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/pedromassango/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.1, Build version 12A7403
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • 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 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Community Edition (version 2020.3.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 52.1.5
    • Dart plugin version 203.6912

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

[✓] Connected device (2 available)
    • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 11 (API 30) (emulator)
    • Chrome (web)               • chrome        • web-javascript • Google Chrome 87.0.4280.88

• No issues found!
Process finished with exit code 0

@pedromassangocode
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 27, 2021
@virenvvarasadiya
Copy link

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
[√] Flutter (Channel beta, 1.25.0-8.1.pre, on Microsoft Windows [Version 10.0.19041.685], locale ko-KR)
• Flutter version 1.25.0-8.1.pre at C:\flutter
• Framework revision 8f89f65 (3 weeks ago), 2020-12-15 15:07:52 -0800
• Engine revision 92ae191c17
• Dart version 2.12.0 (build 2.12.0-133.2.beta)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users~~\AppData\Local\Android\Sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: ~~\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at ~~\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
• Android Studio at ~~\Android\Android Studio1
• 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 1.8.0_242-release-1644-b01)

[√] Connected device (3 available)
• SM N960N (mobile) • 2958a1d5be1c7ece • android-arm64 • Android 10 (API 29)
• Chrome (web) • chrome • web-javascript • Google Chrome 87.0.4280.88
• Edge (web) • edge • web-javascript • Microsoft Edge 87.0.664.66

• 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 )
    => I am using intl : ^0.17.0-nullsafety.2 and override intl: 0.16.0

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

I also face same issue with same package versions

@jessegeens
Copy link

I have the same issue since upgrading to 2.0.1.
flutter doctor -v:

[✓] Flutter (Channel stable, 2.0.1, on Linux, locale nl_BE.UTF-8)
    • Flutter version 2.0.1 at /opt/flutter
    • Framework revision c5a4b4029c (3 days ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /opt/android-sdk
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /opt/android-sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio
    • Android Studio at /opt/android-studio
    • 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 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Community Edition (version 2020.3)
    • IntelliJ at /usr/share/jetbrains-idea-ce
    • 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

[✓] Connected device (1 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

Error log:

Launching lib/main.dart on Android SDK built for x86 in debug mode...
lib/main.dart:1
/opt/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));
      ^^^^^^^^^^^^
/opt/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));
      ^^^^^^^^^^^^
/opt/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));
      ^^^^^^^^^^^^

@saraalshareef97
Copy link

I have the same issue since upgrading to 2.0.1.
flutter doctor -v:

[✓] Flutter (Channel stable, 2.0.1, on Linux, locale nl_BE.UTF-8)
    • Flutter version 2.0.1 at /opt/flutter
    • Framework revision c5a4b4029c (3 days ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /opt/android-sdk
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /opt/android-sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio
    • Android Studio at /opt/android-studio
    • 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 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Community Edition (version 2020.3)
    • IntelliJ at /usr/share/jetbrains-idea-ce
    • 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

[✓] Connected device (1 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

Error log:

Launching lib/main.dart on Android SDK built for x86 in debug mode...
lib/main.dart:1
/opt/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));
      ^^^^^^^^^^^^
/opt/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));
      ^^^^^^^^^^^^
/opt/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));
      ^^^^^^^^^^^^

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:
// ).replaceFirst(r'$selectedRowCount', formatDecimal(selectedRowCount));

Hope this help you!

@a-yarohovich
Copy link

a-yarohovich commented Mar 11, 2021

Same issue since upgrading to 2.0.1

@lecicdjuro
Copy link

Same here

@pedromassangocode
Copy link

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

@virenvvarasadiya
Copy link

I have resolve it in my case by changing branch to stable, 2.0.1

@lecicdjuro
Copy link

I'm on the latest stable, 2.0.1 and still have this issue

@CMGVirakyuthPK
Copy link

I'm on 2.0.2 still having the same issue.

@zieru
Copy link

zieru commented Mar 28, 2021

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.3, on Microsoft Windows [Version 10.0.19042.870], locale id-ID)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] Connected device (3 available)

• No issues found!
`/D:/ANDROID_SDK/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));
^^^^^^^^^^^^
/D:/ANDROID_SDK/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));
^^^^^^^^^^^^
/D:/ANDROID_SDK/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));
^^^^^^^^^^^^

FAILURE: Build failed with an exception.

  • Where:
    Script 'D:\ANDROID_SDK\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'D:\ANDROID_SDK\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 36s
Exception: Gradle task assembleDebug failed with exit code 1
`

@Nerogee
Copy link

Nerogee commented Apr 4, 2021

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

@adnandogar
Copy link

@Nerogee did you solved this issue?
I am using with flutter:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.26.0-2.0.pre.167, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] Connected device (2 available)

pub:

version: 1.0.0+1

environment:
sdk: ">=2.2.2 <3.0.0"

dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.16.1
timeago: ^2.0.26
feather_icons_flutter: ^4.7.4
cached_network_image: ^2.2.0+1
flutter_html: ^1.0.0-pre.1

The following adds the Cupertino Icons font to your application.

Use with the CupertinoIcons class for iOS style icons.

cupertino_icons: ^0.1.2
carousel_slider: ^1.3.0
flutter_easyloading: ^2.0.0
fluttertoast: ^7.0.2
http: ^0.12.2
shared_preferences: ^0.5.8
shimmer: ^1.1.2
polls: ^0.2.2
line_icons:
camera: ^0.5.8+17
path_provider: ^1.6.22
video_player: ^0.10.11+2
dio: ^3.0.8
path: ^1.6.4
file_picker: ^1.4.3+2
share: any
youtube_player_flutter: ^7.0.0+7
vimeoplayer: ^0.1.8
marquee_widget: ^1.0.0

webview_flutter: ^

webview_flutter: ^0.3.24
url_launcher: ^5.4.5
xfile: ^1.1.0
permission_handler: ^5.1.0+2
flutter_automation: ^1.1.4

dev_dependencies:
flutter_test:
sdk: flutter
change_app_package_name: ^0.1.2
flutter_launcher_icons: ^0.8.0

flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/icon.png"

dependency_overrides:
intl: ^0.16.1

error:
../flutter/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/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/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));
^^^^^^^^^^^^

  ====================
  Please help me out.thanks

@Nerogee
Copy link

Nerogee commented Apr 10, 2021

@adnandogar at last i downgrade flutter back to version 1 and update pub again. After that, all work again.

@MurtuzaSrashtaSoft
Copy link

MurtuzaSrashtaSoft commented May 5, 2021

Same issue

[+20805 ms] [+20751 ms] ../../Library/Android/flutter/packages/flutter_localizations/lib/src/material_localizations.dart:413:7: Error: Method 'replaceFirst' cannot be called on 'String?' because it is potentially null.
[  +10 ms] [   +3 ms] Try calling using ?. instead.
[        ] [        ]     ).replaceFirst(r'$selectedRowCount', formatDecimal(selectedRowCount));
[        ] [        ]       ^^^^^^^^^^^^
[        ] [  +14 ms] ../../Library/Android/flutter/packages/flutter_localizations/lib/src/material_localizations.dart:550:7: Error: Method 'replaceFirst' cannot be called on 'String?' because it is potentially null.
[✓] Flutter (Channel stable, 2.0.6, on macOS 11.3.1 20E241 darwin-x64, locale en-IN)
    • Flutter version 2.0.6 at /Users/murtuzanalawala/Library/Android/flutter
    • Framework revision 1d9032c7e1 (6 days ago), 2021-04-29 17:37:58 -0700
    • Engine revision 05e680e202
    • Dart version 2.12.3

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at /Users/murtuzanalawala/Library/Android/sdk
    • Platform android-30, build-tools 30.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.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.8+10-b944.6916264)
environment:
  sdk: '>=2.10.0 <3.0.0'

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
 .......... 
dependency_overrides:
  intl: ^0.16.1

@adnandogar
Copy link

@MurtuzaSrashtaSoft downgrade this dependency to lower version and try:
dependency_overrides:
intl: ^0.15.1

or try lower, it may help you.

@kartikmalhotra
Copy link

Try using intl: 0.17.0 working for me for flutter v2.2.1

@github-actions
Copy link

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in triage Presently being triaged by the triage team
Projects
None yet
Development

No branches or pull requests