簡體   English   中英

Android studio模擬器:啟動應用程序時出錯?

[英]Android studio Emulator :Error launching application?

我正在嘗試將代碼運行到我的Flutter應用程序中! 我嘗試運行main.dart但是當我運行代碼時,它在模擬器上不起作用

這是我的代碼:

    import 'package:flutter/material.dart';

void main() =>
    runApp(MaterialApp(
      home : NinjaCard () ,

  ));
class NinjaCard extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold (
      appBar: AppBar (
        title : Text(' Ninja Card Id ') ,
      ),
    );
  }
}
I try to run my code  on Android Studio emulator and I get this error:


Launching lib\main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
cmd: Can't find service: activity
Installing build\app\outputs\apk\app.apk...
Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install D:\apps\firas_id\build\app\outputs\apk\app.apk: cmd: Can't find service: package
Error launching application on sdk gphone x86 arm.
Does anyone know how to fix it? Thank you in advance.

我正在嘗試將代碼運行到我的Flutter應用程序中! 我嘗試運行main.dart但是當我運行代碼時,它在模擬器上不起作用

這是我的代碼:

    import 'package:flutter/material.dart';

void main() =>
    runApp(MaterialApp(
      home : NinjaCard () ,

  ));
class NinjaCard extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold (
      appBar: AppBar (
        title : Text(' Ninja Card Id ') ,
      ),
    );
  }
}
I try to run my code  on Android Studio emulator and I get this error:


Launching lib\main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
cmd: Can't find service: activity
Installing build\app\outputs\apk\app.apk...
Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install D:\apps\firas_id\build\app\outputs\apk\app.apk: cmd: Can't find service: package
Error launching application on sdk gphone x86 arm.
Does anyone know how to fix it? Thank you in advance.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM