I am getting the following error every time I try to run my app on a real device. Other people can run the same project using the same phone in another computer, so I think the problem is my computer.
Error:
I tried to update the Android Studio and it worked, but then in the next day the same problem started again… So strange!
Here is my Flutter doctor:
Flutter doctor -v:
I also have this log:
adb: failed to install
/Users/matheus/flutter/becare/develop2/becare_app/build/app/outputs/flutter-apk/app.apk:
[2:48:10 PM] [DAP] [Info] ==>
{"seq":28,"type":"event","event":"dart.log","body":{"message":"Error
launching application on Mi 9 SE.n","severity":2,"category":8}}
[2:48:10 PM] [DAP] [Info] ==>
{"seq":29,"type":"event","event":"output","body":{"category":"stderr","output":"Error
launching application on Mi 9 SE.n"}} [2:48:10 PM] [FlutterRun] [Error] [Flutter] Error launching application on Mi 9 SE. [2:48:10 PM] [DAP] [Info] ==>
{"seq":30,"type":"event","event":"dart.log","body":{"message":"<==
[{"event":"app.stop","params":{"appId":"3e89b0c8-b784-4d8e-9f3e-bc3eceed14cb"}}]rn","severity":0,"category":8}}
[2:48:10 PM] [DAP] [Info] ==>
{"seq":31,"type":"event","event":"dart.log","body":{"message":"Process
terminated! null, SIGTERM","severity":0,"category":8}} [2:48:10 PM] [DAP] [Info] ==>
{"seq":32,"type":"event","event":"dart.log","body":{"message":"Process
exited (sigterm)","severity":0,"category":10}} [2:48:10 PM] [DAP] [Info] ==>
{"seq":33,"type":"event","event":"output","body":{"category":"console","output":"Exited
(sigterm)n"}} [2:48:10 PM] [FlutterRun] [Info] [Flutter] <==
[{"event":"app.stop","params":{"appId":"3e89b0c8-b784-4d8e-9f3e-bc3eceed14cb"}}] [2:48:10 PM] [FlutterRun] [Info] [Flutter] Process terminated! null,
SIGTERM [2:48:10 PM] [DAP] [Info] ==>
{"seq":34,"type":"event","event":"terminated"
2
Answers
Solution: I installed a software called XDisplay and it looks like its installation was giving some conflict. After uninstalling it, it solved the problem.
Remove the existing app from the phone and run again.
If it still doesn’t work
And disable debugging in the developer settings and enable it to make sure ADB has access to the device