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

flutter pub get _CastError: Null check operator used on a null value #119181

Closed
cgonzalezandrades opened this issue Jan 25, 2023 · 3 comments
Closed
Assignees
Labels
P1 High-priority issues at the top of the work list tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@cgonzalezandrades
Copy link

cgonzalezandrades commented Jan 25, 2023

Im getting the following error after updating flutter to latest version on stable branch. This error occurs when building doing flutter pub get.

The issue seems to be with localizations.

The project used to run before update.

Thanks

Flutter crash report.
Please report a bug at https://github.com/flutter/flutter/issues.

command

flutter --no-color pub get

exception

_CastError: Null check operator used on a null value

#0      LocalizationsGenerator._generateMethod.generateVariables (package:flutter_tools/src/localizations/gen_l10n.dart:1166:54)
#1      LocalizationsGenerator._generateMethod.generateVariables.<anonymous closure> (package:flutter_tools/src/localizations/gen_l10n.dart:1126:20)
#2      MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)
#3      ListIterator.moveNext (dart:_internal/iterable.dart:344:26)
#4      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#5      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#6      new List.of (dart:core-patch/array_patch.dart:52:28)
#7      ListIterable.toList (dart:_internal/iterable.dart:214:7)
#8      LocalizationsGenerator._generateMethod.generateVariables (package:flutter_tools/src/localizations/gen_l10n.dart:1127:14)
#9      LocalizationsGenerator._generateMethod (package:flutter_tools/src/localizations/gen_l10n.dart:1212:34)
#10     LocalizationsGenerator._generateBaseClassFile.<anonymous closure> (package:flutter_tools/src/localizations/gen_l10n.dart:918:14)
#11     MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)
#12     ListIterable.join (dart:_internal/iterable.dart:156:22)
#13     LocalizationsGenerator._generateBaseClassFile (package:flutter_tools/src/localizations/gen_l10n.dart:931:41)
#14     LocalizationsGenerator._generateCode (package:flutter_tools/src/localizations/gen_l10n.dart:1026:46)
#15     LocalizationsGenerator.writeOutputFiles (package:flutter_tools/src/localizations/gen_l10n.dart:1230:47)
#16     generateLocalizations (package:flutter_tools/src/localizations/gen_l10n.dart:73:9)
#17     GenerateLocalizationsTarget.build (package:flutter_tools/src/build_system/targets/localizations.dart:56:5)
#18     _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:847:27)
<asynchronous suspension>
#19     FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:614:16)
<asynchronous suspension>
#20     generateLocalizationsSyntheticPackage (package:flutter_tools/src/dart/generate_synthetic_packages.dart:58:30)
<asynchronous suspension>
#21     PackagesGetCommand._runPubGet (package:flutter_tools/src/commands/packages.dart:132:7)
<asynchronous suspension>
#22     PackagesGetCommand.runCommand (package:flutter_tools/src/commands/packages.dart:175:5)
<asynchronous suspension>
#23     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1257:27)
<asynchronous suspension>
#24     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#25     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#26     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:283:9)
<asynchronous suspension>
#27     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#28     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#29     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#30     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#31     main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>

flutter doctor

[✓] Flutter (Channel stable, 3.7.0, on macOS 12.6 21G115 darwin-x64, locale en-US)
    • Flutter version 3.7.0 on channel stable at /Users/carlosgonzalez/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b06b8b2710 (2 days ago), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/carlosgonzalez/Library/Android/sdk
    • Platform android-33, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

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

[✓] Android Studio (version 2022.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 11.0.15+0-b2043.56-8887301)

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 12.6 21G115 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 109.0.5414.119
    ! Error: Carlos’s iPhone is not paired with your computer. To use Carlos’s iPhone with Xcode, unlock it and choose to trust this computer when prompted. (code -9)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
@christopherfujino
Copy link
Member

Thanks for filing!

@christopherfujino christopherfujino added tool Affects the "flutter" command-line tool. See also t: labels. P1 High-priority issues at the top of the work list labels Jan 25, 2023
@christopherfujino christopherfujino self-assigned this Jan 25, 2023
@christopherfujino
Copy link
Member

This is actually the same as #116459, which was fixed upstream in #116622. I will file a cherrypick request for this.

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

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 Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 High-priority issues at the top of the work list tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

2 participants