简体   繁体   中英

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. 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. Exited (sigterm)

在此处输入图片说明

This issue is because of ADB configuration:

I have changed my laptop recently and forgot to configure Android sdk in Environment variables.

Possibilities:

  • You might Not configured environment variable in windows/mac for Android sdk and android platform tools as well
    • This can be tested by typing adb in new command prompt window. If the command is not reorganized. You will be able to see adb is not recognized as an internal or external. 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
  • There may be problem also in device connectivity like cable may be loose or USB problem or anything else. Check and ensure device is connected by typing adb command new command prompt window.

Once the device is recognized then try deploying flutter project again it will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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