I know this looks like a dupe, but I have read every thread here that speaks of this ADB error. I was not able to find a solution. This was working very well previously, this is a very sudden issue for me.
This is the output from the command prompt:
C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb devices
* daemon not running; starting now at tcp:5037
adb: CreateFileW 'nul' failed: The system cannot find the file specified. (2)
* failed to start daemon
adb.exe: failed to check server version: cannot connect to daemon
C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb kill-server
cannot connect to daemon at tcp:5037: cannot connect to 127.0.0.1:5037: No connection could be made because the target machine actively refused it. (10061)
C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb start-server
* daemon not running; starting now at tcp:5037
adb: CreateFileW 'nul' failed: The system cannot find the file specified. (2)
* failed to start daemon
error: cannot connect to daemon
C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb reconnect
* daemon not running; starting now at tcp:5037
adb: CreateFileW 'nul' failed: The system cannot find the file specified. (2)
* failed to start daemon
error: cannot connect to daemon
C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb reconnect device
* daemon not running; starting now at tcp:5037
adb: CreateFileW 'nul' failed: The system cannot find the file specified. (2)
* failed to start daemon
Systems: -Windows 10 Home -Android Version 9 (PAR-LX1M Huawei)
Things I have already tried:
-Checking if the port is being used by another process
-Restarting both devices
-Revoking and giving back USB Debugging authorization
-Reinstalling platform tools
-Removing the 3 ADB kit files only and reinstalling them
-Completely deleting Android studio with all the files and reinstalling it.
-Uninstalling HiSuite
-Disabling Firewall and Antivirus
-Ending the adb.exe task from the TaskManager (The task is not running in the first place in order to end it)
-Running adb nodaemon server this was the output
C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb nodaemon server
adb I 07-24 14:07:31 10484 47768 auth.cpp:437] adb_auth_init...
adb I 07-24 14:07:31 10484 11504 transport.cpp:282] [Phone Serial Number]: read thread spawning
adb I 07-24 14:07:31 10484 42584 transport.cpp:295] [Phone Serial Number]: write thread spawning
adb I 07-24 14:07:31 10484 47768 transport.cpp:1373] fetching keys for transport [Phone Serial Number]
adb I 07-24 14:07:31 10484 47768 auth.cpp:489] Calling send_auth_response
adb I 07-24 14:07:31 10484 47768 adb.cpp:114] [Phone Serial Number]: offline
and then it keeps running endlessly.
This issue did not start in Android Studio as I'm not currently using it for this project. This project uses Unity which gave me a blank error indicating that the SDK is not properly installed. Neither checking nor unchecking using the Android SDK tools with Unity helped, gives the same error Unity Error
This is the error in the Unity console
CommandWithNoStdoutInvokationFailure: Unable to start ADB server. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
UnityEditor.Android.Command.RunWithShellExecute (System.String command, System.String args, System.String workingdir, System.String errorMsg)
UnityEditor.Android.ADB.StartServer ()
UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidDeploymentTargetsExtension.GetKnownTargets (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.ProgressHandler progressHandler)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.GetTargetDevices (UnityEditor.Android.ADB adb)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Any help would be appreciated. TIA!
Update: This problem persists on another Android device.
Update 2: Running adb nodaemon server in the foreground and then building in Unity seems to work although the adb console says "offline". The question still stands, why is this happening and how can I get it to work normally like it used to?