【发布时间】:2020-06-29 09:25:20
【问题描述】:
我是颤振的初学者。我使用 vscode 进行开发。我还使用我的物理 android 设备而不是模拟器进行调试。我构建了一个简单的颤振应用程序。使用颤振运行执行。构建完成后,我的手机出现白屏,然后很快出现对话框“不幸的是,quiz_app 已停止。”,其中 quiz_app 是项目名称。我有一台 Ryzen-5 机器。这是$ flutter -v的输出:
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale en-IN)
• Flutter version 1.12.13+hotfix.8 at C:\src\flutter
• Framework revision 0b8abb4724 (5 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\haari\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.
[!] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
这是我做$ flutter run时的控制台日志:
Launching lib\main.dart on SM G531F in debug mode...
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 20.0s
√ Built build\app\outputs\apk\debug\app-debug.apk.
D/FlutterActivity( 8697): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate( 8697): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate( 8697): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
E/DartVM ( 8697): version=2.7.0 (Fri Dec 6 16:26:51 2019 +0100) on "android_arm"
E/DartVM ( 8697): thread=8697, isolate=vm-isolate(0xab699540)
E/DartVM ( 8697): pc 0x54cfcfcd fp 0xffcb8e58 libflutter.so+0x1321fcd
E/DartVM ( 8697): -- End of DumpStackTrace
这是 main.dart 代码:-
import 'package:flutter/material.dart';
void main() => runApp(QuizApp());
class QuizApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('JIT Quiz App'),
),
body: Column(
children: <Widget>[
Text('What is your favourite subject?'),
RaisedButton(child: Text('DBMS'), onPressed: null),
RaisedButton(child: Text('DAA'), onPressed: null),
RaisedButton(child: Text('CA'), onPressed: null),
RaisedButton(child: Text('PQT'), onPressed: null),
],
),
),
);
}
}
我尽量避免使用模拟器进行调试。
【问题讨论】:
-
如果您显示一些代码会很有帮助。
-
@ArshShaikh 我已根据您的要求添加了源代码。
-
请添加堆栈跟踪
-
@MarcinOrlowski 我尝试使用
adb logcat并从我的 cmd 得到大量响应,您确定我以正确的方式进行操作还是有其他方法可以做到这一点。 -
试试flutter clean命令然后再运行,你试过了吗!!!