Skip to content

Platform.executable throws Unhandled Exception: type 'Null' is not a subtype of type 'String' #83921

@ueman

Description

@ueman

Calling Platform.executable throws Unhandled Exception: type 'Null' is not a subtype of type 'String' on macOS.
It might be worth to check this on other platforms too.

Steps to Reproduce

import 'dart:io';

void main() {
  print(Platform.executable);
}

Expected results:

Any output regarding the executable.

Actual results:

Logs
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
#0      _Platform.executable (dart:io/platform_impl.dart:36:30)
#1      _Platform.executable (dart:io/platform_impl.dart)
#2      Platform.executable (dart:io/platform.dart:134:45)
#3      main
package:reproducable_example/main.dart:4
#4      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:142:25)
#5      _rootRun (dart:async/zone.dart:1354:13)
#6      _CustomZone.run (dart:async/zone.dart:1258:19)
#7      _runZoned (dart:async/zone.dart:1789:10)
#8      runZonedGuarded (dart:async/zone.dart:1777:12)
#9      _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:138:5)
#10     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:283:19)
#11     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
Analyzing reproducable_example...                                       
No issues found! (ran in 1.1s)
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.3.1 20E241 darwin-x64, locale de-DE)
    • Flutter version 2.2.1 at /Users/jonas/Documents/projects/flutter
    • Framework revision 02c026b03c (7 days ago), 2021-05-27 12:24:44 -0700
    • Engine revision 0fdb562ac8
    • Dart version 2.13.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/jonas/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Users/jonas/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7351085/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

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

[✓] Android Studio (version 4.2)
    • Android Studio at /Users/jonas/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7351085/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)

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.3.1 20E241 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 90.0.4430.212

• No issues found!

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: null-safetySupport for Dart's null safety featureengineflutter/engine related. See also e: labels.found in release: 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions