Lexi Wozniak
Lexi Wozniak

Reputation: 91

How do I fix: "Error: Dart library 'dart:html' is not available on this platform." in ios/android development Flutter?

Was testing a UI change on my android emulator with Flutter. Emulator crashed and I got this message:

"Error: Dart library 'dart:html' is not available on this platform. lib/…/pages/sign_up.dart:1 import 'dart:html';"

I also got this message:

FAILURE: Build failed with an exception.

Process 'command '/Users/calyxwozniak/dev/flutter/bin/flutter'' finished with non-zero exit value 1

build.gradle says there is an error in my flutterRoot

def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")

Upon looking at others similar questions I have tried: -flutter clean -flutter pub cache repair -flutter pub outdated -deleted and recreated the pubspec.lock folder -updated dependencies Path version -changing minsdkversion in gradle local properties

None of this resolves the error or allows me to run the emulator without it crashing immediately.

Upvotes: 8

Views: 9040

Answers (0)

Related Questions