加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

android – Flutter dart调试器断点停止工作

发布时间:2020-12-14 14:52:20 所属栏目:百科 来源:网络整理
导读:我正在学习Dart和Flutter并在 Android Studio 3.1.2下开发一个小型Android Flutter应用程序.突然调试器断点停止工作 – 在调试模式下启动的应用程序永远不会在它们上停止,并且指示断点的红点变为红色点,其中x为内部.我的应用程序中唯一仍然可以工作的地方是m
我正在学习Dart和Flutter并在 Android Studio 3.1.2下开发一个小型Android Flutter应用程序.突然调试器断点停止工作 – 在调试模式下启动的应用程序永远不会在它们上停止,并且指示断点的红点变为红色点,其中x为内部.我的应用程序中唯一仍然可以工作的地方是main.dart模块.

我多次清理项目,在两个不同的设备上测试,完全卸载我的Flutter调试应用程序并开始新的 – 没有任何帮助.关于beta(当前beta 2)频道的颤动更新什么都不做.还尝试切换到开发和主通道 – 没有帮助.

有没有人遇到类似的情况,怎么处理呢?

编辑,添加flutter doctor的mail.dart和输出(当前在master分支上,但在切换到beta或dev分支后有相同的问题):

从main.dart导入,或更好的main.dart:

import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

import 'app_strings.dart';
import 'net_libs_page/net_libs_page.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      localizationsDelegates: [
        // ... app-specific localization delegate[s] here
        AppLocalizationsDelegate(),GlobalMaterialLocalizations.delegate,GlobalWidgetsLocalizations.delegate,//FallbackMaterialLocalisationsDelegate(),],supportedLocales: [
        Locale('en','US'),// English
        Locale('es','ES'),// Spanish
        Locale('pl','PL'),// ... other locales the app supports
      ],title: '@Voice Network Library',//_strings.title,theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then,without quitting the app,try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",// or press Run > Flutter Hot Reload in IntelliJ). Notice that the
        // counter didn't reset back to zero; the application is not restarted.
        primarySwatch: Colors.indigo,),home: NetLibsPage(),);
  }
}

颤动的医生输出:

Doctor summary (to see all details,run flutter doctor -v):
[√] Flutter (Channel master,v0.4.5-pre.52,on Microsoft Windows [Version 10.0.16299.431],locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[√] Android Studio (version 3.1)
[!] IntelliJ IDEA Ultimate Edition (version 2018.1)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code,32-bit edition (version 1.19.3)
[√] Connected devices (1 available)

! Doctor found issues in 2 categories.

解决方法

不要在lib / main.dart中使用相对导入

import 'app_strings.dart';
import 'net_libs_page/net_libs_page.dart';

改为使用

import 'package:my_app/app_strings.dart';
import 'package:my_app/net_libs_page/net_libs_page.dart';

其中my_app是名称:field中pubspec.yaml中的内容.

追踪https://github.com/dart-lang/sdk/issues/33076的问题

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读