Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart Flatter中的launch_url插件出错_Dart_Flutter - Fatal编程技术网

Dart Flatter中的launch_url插件出错

Dart Flatter中的launch_url插件出错,dart,flutter,Dart,Flutter,我正在尝试在Flitter中使用launch_url插件,但当我单击按钮时,我的应用程序立即退出 我用于按钮的代码: new MaterialButton( child: const Text('M-COM'), height: 50.0, minWidth: 200.0, color: Colors.blue, textColor: Colors.white, splashColor: Colors.blueGrey,

我正在尝试在Flitter中使用launch_url插件,但当我单击按钮时,我的应用程序立即退出

我用于按钮的代码:

new MaterialButton(
      child: const Text('M-COM'),
      height: 50.0,
      minWidth: 200.0,
      color: Colors.blue,
      textColor: Colors.white,
      splashColor: Colors.blueGrey,
      onPressed: _launchURL,
)
_launchURL的代码:

_launchURL() async {
  const url = 'https://flutter.io';
  if (await canLaunch(url)) {
    await launch(url);
  } else {
    throw 'Could not launch $url';
  }
}
进口:

import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'dart:async';
依赖项:

dependencies:
  flutter:
    sdk: flutter
  url_launcher:
我得到的错误是:

F/libc    ( 6730): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xd in tid 6748 (Thread-2), pid 6730 (.flutterstarter)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_gphone_x86/generic_x86:9/PPP4.180612.007/4860066:userdebug/dev-keys'
Revision: '0'
ABI: 'x86'
pid: 6730, tid: 6748, name: Thread-2  >>> com.yourcompany.flutterstarter <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xd
Cause: null pointer dereference
    eax c8e6faac  ebx c8e6faac  ecx 0000000a  edx c7e0f570
    edi c5d175f0  esi c7e10408
    ebp c7e0f468  esp c7e0f468  eip c84aa1d8
backtrace:
    #00 pc 006981d8  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #01 pc 008f5b75  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #02 pc 008e87ea  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #03 pc 008ffb03  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #04 pc 008eb310  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #05 pc 008f5eea  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #06 pc 008e87ea  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #07 pc 008fe2fb  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #08 pc 008e8d97  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #09 pc 008fdcb7  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #10 pc 008eafb7  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #11 pc 008f997f  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #12 pc 008eaff8  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #13 pc 008fa175  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #14 pc 008eaf8a  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #15 pc 008f997f  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #16 pc 008eaff8  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #17 pc 008fcc16  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #18 pc 008eb034  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #19 pc 008ef41e  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #20 pc 008f0570  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #21 pc 0091433e  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #22 pc 0092fad4  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #23 pc 00932f2a  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #24 pc 00934573  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #25 pc 00933d2b  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #26 pc 0093004a  /data/app/com.yourcompany.flutterstarter-MdONNcPhZQnLdPJuB2HJaQ==/lib/x86/libflutter.so
    #27 pc 0000056b  <anonymous:c6440000>
Lost connection to device.
F/libc(6730):致命信号11(SIGSEGV),代码1(SEGV_-MAPERR),tid 6748(线程2)中的故障地址0xd,pid 6730(.1)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
构建指纹:“google/sdk\u gphone\u x86/generic\u x86:9/PPP4.180612.007/4860066:userdebug/dev keys”
修订:“0”
ABI:'x86'

pid:6730,tid:6748,名称:Thread-2>>>com.yourcompany.flatterstarter您使用的是哪种颤振版本?我得到了一个类似的错误(针对不同的代码),但最新的
dev
channelbuild为我修复了它。我使用的是v0.5.1-beta。您正在使用哪个开发版本?目前我正在使用
master
频道
flatterchannelmaster
,因为它为我修复了一个阻塞错误,除此之外,使用
master
是相当不鼓励的。通常应首选
beta
dev