Skip to content

localeResolutionCallback error on 0.11 #24288

Description

@gimox

After upgrade to 0.11, i got this error

flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building IconTheme(IconThemeData#2abdc(color:
flutter: Color(0xdd000000))):
flutter: A GlobalKey was used multiple times inside one widget's child list.
flutter: The offending GlobalKey was: [GlobalObjectKey _MaterialAppState#9d9bf]
flutter: The parent of the widgets with that key was:
flutter:   IconTheme(IconThemeData#2abdc(color: Color(0xdd000000)))
flutter: The first child to get instantiated with that key became:
flutter:   WidgetsApp-[GlobalObjectKey _MaterialAppState#9d9bf](dirty, state:
flutter:   _WidgetsAppState#0d591(lifecycle state: created))
flutter: The second child that was to be instantiated with that key was:
flutter:   IconTheme(IconThemeData#2abdc(color: Color(0xdd000000)))
flutter: A GlobalKey can only be specified on one widget at a time in the widget tree.

this happen on startup app after build, so i found that the problem is the localeResolutionCallback.

i have my app localized and working from 0.94, so then only solution for now is to remove the method: localeresolutioncallback.

I try a simple return like this above but not work:

  localeResolutionCallback:
            (Locale locale, Iterable<Locale> supportedLocales) {
return locale
}

So simply adding the method break the code!!

doctor:

✓] Flutter (Channel beta, v0.11.3, on Mac OS X 10.13.6 17G3025, locale it-IT)
    • Flutter version 0.11.3 at /Users/giorgiomodoni/development/flutter
    • Framework revision 72bf075e8d (3 days ago), 2018-11-09 20:36:17 -0800
    • Engine revision 5646e86a6f
    • Dart version 2.1.0 (build 2.1.0-dev.9.3 9c07fb64c4)

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/giorgiomodoni/Library/Android/sdk
    • Android NDK at /Users/giorgiomodoni/Library/Android/sdk/ndk-bundle
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /Users/giorgiomodoni/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 30.0.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.5)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 26.0.2
    • Dart plugin version 181.4892.1

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

[✓] Connected device (1 available)
    • iPhone 7 • 92528608-127A-4057-B6C8-634798F090C2 • ios • iOS 12.1 (simulator)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: internationalizationSupporting other languages or locales. (aka i18n)c: crashStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions