简体   繁体   English

Flutter来自ADB的意外故障:无效参数:源不得为空在设备上启动应用程序时出错

[英]Flutter Unexpected failure from adb: Invalid argument(s): The source must not be null Error launching application on device

I am new to flutter. 我是新来的扑扑。 I have created flutter project and while am trying to run the same in my android device. 我创建了flutter项目,并试图在我的android设备中运行该项目。 I was getting this error:: 我收到此错误::

Unexpected failure from adb: Invalid argument(s): The source must not be null Error launching application on motorola one power. 来自adb的意外故障:无效的参数:来源不能为null在Motorola一种电源上启动应用程序时出错。 Exited (sigterm) 退出(sigterm)

在此处输入图片说明

This issue is because of ADB configuration: 此问题是由于ADB配置引起的:

I have changed my laptop recently and forgot to configure Android sdk in Environment variables. 我最近更换了笔记本电脑,忘记在环境变量中配置Android sdk。

Possibilities: 可能性:

  • You might Not configured environment variable in windows/mac for Android sdk and android platform tools as well 您可能没有在Windows / Mac中为Android SDK和Android平台工具配置环境变量
    • This can be tested by typing adb in new command prompt window. 可以通过在新的命令提示符窗口中键入adb进行测试。 If the command is not reorganized. 如果命令未重组。 You will be able to see adb is not recognized as an internal or external. 您将能够看到adb不被识别为内部或外部。 To fix the issue configure Environment variable as below. 要解决此问题,请按如下所示配置环境变量。 command 命令
    • Configure Environment variable -> system Variables -> path -> new -> C:\\Users\\username\\AppData\\Local\\Android\\Sdk (Path depends as it placed in your system) C:\\Users\\username\\AppData\\Local\\Android\\Sdk\\platform-tools (Path depends as it placed in your system) Restart the system - Type adb in command prompt - adb should reorganized 配置环境变量->系统变量->路径->新建-> C:\\ Users \\ username \\ AppData \\ Local \\ Android \\ Sdk(路径取决于系统中放置的路径)C:\\ Users \\ username \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools(路径取决于放置在系统中的路径)重新启动系统-在命令提示符下键入adb-应该重新组织adb
  • There may be problem also in device connectivity like cable may be loose or USB problem or anything else. 设备连接也可能存在问题,例如电缆可能松动或USB问题或其他任何问题。 Check and ensure device is connected by typing adb command new command prompt window. 通过键入adb命令新命令提示符窗口来检查并确保设备已连接。

Once the device is recognized then try deploying flutter project again it will work. 一旦识别出设备,然后尝试再次部署flutter项目,它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM