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

Error: Unexpected null value. #76690

Closed
pedromassango opened this issue Feb 24, 2021 · 3 comments
Closed

Error: Unexpected null value. #76690

pedromassango opened this issue Feb 24, 2021 · 3 comments
Labels
in triage Presently being triaged by the triage team

Comments

@pedromassango
Copy link
Member

Steps to Reproduce

  1. run any Flutter project on Chrome in Master channel
  2. See the null crash

Note: you may not see the error, it is probably that Chrome paused the debugger because of that error, go to Developer options and resume the debugger and see the crash on the console of your IDE.

code sample
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Cashex',
      routes: {
        '/': (_) => Scaffold(body: Center(child: Text('Hello Flutter'),),)
      }
    );
  }
}
flutter doctor -v
[✓] Flutter (Channel master, 1.27.0-5.0.pre.134, on macOS 11.2.1 20D74 darwin-x64, locale en-AO)
    • Flutter version 1.27.0-5.0.pre.134 at /Users/pedromassango/Code/flutter_master
    • Framework revision 354bd53f62 (2 hours ago), 2021-02-24 02:36:05 -0500
    • Engine revision 9061823775
    • Dart version 2.13.0 (build 2.13.0-68.0.dev)

[✓] 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 at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.1, Build version 12A7403
    ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✓] 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.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 53.1.5
    • Dart plugin version 203.6912

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.2.1 20D74 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 88.0.4324.192

! Doctor found issues in 1 category.
logs
Running "flutter pub get" in cashex_landing...
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
Debug service listening on ws://127.0.0.1:56126/1tWXqmQvm-Q=/ws

Running with unsound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety
Debug service listening on ws://127.0.0.1:56126/1tWXqmQvm-Q=/ws
Error: Unexpected null value.
    at Object.throw_ [as throw] (http://localhost:56000/dart_sdk.js:5347:11)
    at Object.nullCheck (http://localhost:56000/dart_sdk.js:5680:30)
    at _engine._PointerAdapter.new.[_getSanitizer] (http://localhost:56000/dart_sdk.js:166679:28)
    at http://localhost:56000/dart_sdk.js:166739:42
    at http://localhost:56000/dart_sdk.js:166697:16
    at http://localhost:56000/dart_sdk.js:166391:11
    at <anonymous>
    at http://localhost:56000/dart_sdk.js:50601:13
    at Generator.next (<anonymous>)
    at runBody (http://localhost:56000/dart_sdk.js:39187:34)
    at Object._async [as async] (http://localhost:56000/dart_sdk.js:39218:7)
    at http://localhost:56000/dart_sdk.js:50592:20
    at new Promise (<anonymous>)
    at Object._invokeExtension [as invokeExtension] (http://localhost:56000/dart_sdk.js:50589:12)
    at <anonymous>:1:31
@pedromassango
Copy link
Member Author

Current workaroud is to reload the webpage, but it is tedious.

Screen Shot 2021-02-24 at 11 40 00

@TahaTesser TahaTesser added the in triage Presently being triaged by the triage team label Feb 24, 2021
@TahaTesser
Copy link
Member

TahaTesser commented Feb 24, 2021

Hi @pedromassango
I can only see a white blank screen in Android Studio when running in debug mode on macOS and Windows, doesn't reproduce in VS Code or Terminal, reproducible on the beta, dev, and master, app launches in Android if you run without debug

flutter doctor -v
[✓] Flutter (Channel beta, 1.26.0-17.6.pre, on macOS 11.2.1 20D74 darwin-x64, locale en-GB)
    • Flutter version 1.26.0-17.6.pre at /Users/tahatesser/Code/flutter_beta
    • Framework revision a29104a69b (8 days ago), 2021-02-16 09:26:56 -0800
    • Engine revision 21fa8bb99e
    • Dart version 2.12.0 (build 2.12.0-259.12.beta)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.
[!] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] 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)
[✓] VS Code (version 1.53.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.19.0
[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.192
! Doctor found issues in 2 categories.
[✓] Flutter (Channel dev, 1.27.0-4.0.pre, on macOS 11.2.1 20D74 darwin-x64, locale en-GB)
    • Flutter version 1.27.0-4.0.pre at /Users/tahatesser/Code/flutter_dev
    • Framework revision f8cd24de95 (8 days ago), 2021-02-16 11:24:17 -0800
    • Engine revision 1d537824d6
    • Dart version 2.13.0 (build 2.13.0-30.0.dev)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.
[!] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] 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)
[✓] VS Code (version 1.53.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.19.0
[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.2.1 20D74 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 88.0.4324.192
! Doctor found issues in 2 categories.
[✓] Flutter (Channel master, 1.27.0-5.0.pre.134, on macOS 11.2.1 20D74 darwin-x64, locale en-GB)
    • Flutter version 1.27.0-5.0.pre.134 at /Users/tahatesser/Code/flutter_master
    • Framework revision 354bd53f62 (5 hours ago), 2021-02-24 02:36:05 -0500
    • Engine revision 9061823775
    • Dart version 2.13.0 (build 2.13.0-68.0.dev)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.
[!] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] 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)
[✓] VS Code (version 1.53.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.19.0
[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.2.1 20D74 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 88.0.4324.192
! Doctor found issues in 2 categories.

I just reopened to be sure #76680 from earlier today
I see there's an open issue addressing the case you described.
Please follow up on that issue, I'm closing the current one as a duplicate.
If you disagree, please write in the comments and I will reopen it.
Thank you

@github-actions
Copy link

github-actions bot commented Aug 5, 2021

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 Aug 5, 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

2 participants