【问题标题】:How to solve flutter inappwebview stopped working?如何解决flutter inappwebview停止工作?
【发布时间】:2020-02-18 12:22:26
【问题描述】:

我创建了一个应用程序来显示带有 flutter_inappwebview 插件的 html 文件,但出现以下错误:
pubspec.yaml

flutter_inappwebview: ^2.1.0

这是我的 main.dart

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
Future main() async {
  runApp(new MyApp());
}
class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
  InAppWebViewController webView;
  String url = "";
  double progress = 0;
  @override
  void initState() {
    super.initState();
  }
  @override
  void dispose() {
    super.dispose();
  }
  @override
  Widget build(BuildContext context) {
    return Container(
      height: 200,
      child: InAppWebView(
        initialUrl: 'https://www.google.com',
      ),
    );
  }
}

当我运行代码时,应用程序不幸停止了。
这是模拟器中的错误。


这是 Android Studio 3.5.3 中的错误

有什么解决办法吗?

【问题讨论】:

  • 它抛出的任何错误,如果你在这里发布错误日志会很好
  • 我已经更新了错误图片,谢谢!

标签: flutter


【解决方案1】:

在 github issue link 中查看问题后,解决方案如下:

来自

dependencies:
  flutter_inappwebview: ^2.1.0+1

收件人

dependencies:
  flutter_inappwebview:
      git:
        url: https://github.com/pichillilorenzo/flutter_inappwebview.git

然后运行flutter clean 然后运行应用程序。它应该可以解决问题。

【讨论】:

    猜你喜欢
    • 2021-03-26
    • 2012-01-25
    • 2019-10-31
    • 1970-01-01
    • 1970-01-01
    • 2022-10-17
    • 2022-10-21
    • 2018-10-18
    • 1970-01-01
    相关资源
    最近更新 更多