Xamarin/Visual studio: Deployment failed. How to troubleshoot - xamarin

Im quite new to Xamarin and android development. I have made a new virtual device but when Im trying to run debug (by hitting "play" in Visual Studio) I get the message "Deployment failed", but I cant find any error message or logs.
Any tips on how to find that or troubleshoot for failing deployments?
(I can deploy when using a simple program and the pre-installed kit kat 4.4)
EDIT:
From output window:
Starting deploy 0001 ...
Starting emulator 0001 ...
An error occured. See full exception on logs for more details.
An error occured. See full exception on logs for more details.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Related

NuGet MSTest.TestAdapter.3.0.0 crashes in .Net "Framework" 4.8

Edited: as #Diego Malanij pointed out in answer
https://stackoverflow.com/a/74768591/4489263 it's the MSTest.TestAdapter 3.0.0 package causing the following observed misbehavior, whereas MSTest.TestFramework 3.0.0 works well
After updating NuGet packages in a .Net 4.8 solution, MS UnitTests just reproducibly stopped working here in Visual Studio 2022 "Community Edition" on Windows 10 without having changed anything in the custom solution itself.
The same update(s) work well in a .Net6.0 solution
UnitTests
Updates:
MSTest.TestFramework.2.2.10 -> MSTest.TestFramework.3.0.0
MSTest.TestAdapter.2.2.10 -> MSTest.TestAdapter.3.0.0
The Output window in the .Net4.8 solution shows exceptions, and the Test Explorer says:
UnitTests
Tests in group: 134
Outcomes
 134 Not Run
Output Window :
========== Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 127 ms ==========
Log level is set to Informational (Default).
Source code repository not available. Some features may not work as expected.
Connected to test environment '< Local Windows Environment >'
Test data store opened in 0,139 sec.
========== Starting test discovery ==========
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager.Data\bin\Debug\RingManager.Data.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager\bin\Debug\RingManager.exe. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager.CommonViews\bin\Debug\RingManager.CommonViews.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager.Common\bin\Debug\RingManager.Common.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
========== Test discovery finished: 134 Tests found in 3 sec ==========
========== Starting test run ==========
========== Test run finished: 134 Tests (134 Passed, 0 Failed, 0 Skipped) run in 16,7 sec ==========
Starting test discovery for requested test run
========== Starting test discovery ==========
========== Test discovery finished: 134 Tests found in 1,7 sec ==========
========== Starting test run ==========
An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Stack trace:
at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.TestDeployment.GetDeploymentInformation(String source)
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.ExecuteTestsInSource(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle, String source, Boolean isDeploymentDone) at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.ExecuteTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle, Boolean isDeploymentDone)
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.RunTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle, TestRunCancellationToken runCancellationToken) at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.MSTestExecutor.RunTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithTests.InvokeExecutor(LazyExtension2 executor, Tuple2 executorUri, RunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.<>c__DisplayClass46_0.b__0()
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.<>c__DisplayClass0_0.b__0()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.Run(Action action, PlatformApartmentState apartmentState, Boolean waitForCompletion)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.TryToRunInStaThread(Action action, Boolean waitForCompletion)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable`1 executorUriExtensionMap, Int64 totalTests)
========== Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 127 ms ==========
After reverting the changes via version control system - and restarting VS - all is back to normal.
So I guess I'll wait a little and then might try again with a next NuGet version, and this is more a warning than a question asking for help
I've found the same issue with my solution. Today I was able to dig a bit deeper with fusion log and the problem is that the assembly is being searched in the appbase for the testhost, rather than the location of the unit test output itself (meaning bin\debug or bin\release).
I've taken a look at the MSTest.TestAdapter package itself and its props... it has changed the structure regarding the previous version, and now it contains the Microsoft.VisualStudio.TestPlatform.TestFramework assembly (which is loaded from the packages\MSTest.TestAdapter.3.0.0\build\net462 location), but the extensions are no there.
I tried copying the missing dll in that location and tests execution succeeded, however that's clearly not a solution.
In my case this is with Visual Studio 2019, and I thought 2022 might have this solved but clearly after finding your post, that's not the case; I'll try to go a bit further with the analysis later, but as for now the only option is not updating the MSTest.TestAdapter package (the MSTest.TestFramwork is fine at 3.0.0).
MSTest.TestAdapter.3.0.1 now being available apparently cures the symptom, may have been a temporary bug in its version 3.0.0.
After installing NuGet
Updates:
MSTest.TestFramework.3.0.0 -> MSTest.TestFramework.3.0.1
MSTest.TestAdapter.2.2.10 -> MSTest.TestAdapter.3.0.1
... all seems to be okay again

Microsoft Visual Studio Community 2022 (64-bit) 17.4.2 can't debug .Net Standard 2.0 Xamarin on Samsung Galaxy J5 2016 with Android 7.1.1

I made that question to the Microsoft community months ago, the solution I came up with was to install the previous version of Visual Studio, 17.2.6, that could work with that phone. Then I got a new testing phone and I could debug on it just fine with any later Visual Studio version. But that old problem resurfaced when I tried to debug on my old phone again lately.
So, when I try to debug on the Samsung J5 I get the message that deployment is successful but debugging and the app stop. The app gets installed on the phone just fine, I can run it and test things, and for those parts that I would have added breakpoints I add temporary log entries to see what is happening. But debugging would be so much faster and easier. So I don't know what happened to Visual Studio 2022 after version 17.2.6 and the debugging on the J5 stopped working without changing the Android project's settings.
On to the output. The last lines of the Build output:
Found device: dbb6c608
Creating "obj\Debug\130\upload.flag" because "AlwaysCreate" was specified.
Creating directory "obj\.cache\".
Done building project "iService5.Droid.csproj".
Build succeeded.
2>Deployment was successful to Samsung SM-J510FN.
========== Build: 1 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
========== Elapsed 02:07,822 ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
========== Elapsed 02:07,824 ==========
Last lines of Build Order output:
2>Starting deployment to Samsung SM-J510FN ...
2>Deploying to Samsung SM-J510FN ...
2>Deployment was successful to Samsung SM-J510FN.
========== Build: 1 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
========== Elapsed 02:07,822 ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
========== Elapsed 02:07,824 ==========
On Debug output:
This debug engine does not support exception conditions. The condition(s) will be ignored.
Forwarding debugger port 8815
Detecting existing process
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.bshg.iservice5.droid/crc649586142a72936f38.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.bshg.iservice5.droid/crc649586142a72936f38.MainActivity launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0 } }
The error I get in Xamarin Diagnostics window:
[E:]: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(String format, Object[] args)
at Mono.AndroidTools.AndroidLogger.LogError(String task, String format, Object[] args) in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AndroidLogger.cs:line 63
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass118_0.<RunShellCommandAsync>b__0() in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 1012
[D:RunShellCommand]: dbb6c608 setprop "debug.mono.extra" ""
-- Start SetProperty - 12/02/2022 13:15:16 (148.7124ms) --
[INPUT] setprop "debug.mono.extra" ""
[OUTPUT]
-- End SetProperty --
[D:RunShellCommand]: dbb6c608 am force-stop com.bshg.iservice5.droid
-- Start ForceStop - 12/02/2022 13:15:16 (1794.4007ms) --
[INPUT] am force-stop com.bshg.iservice5.droid
[OUTPUT]
-- End ForceStop --
I have searched and searched and I can't find anything usefull. As for the configuration:
Android Options
Advanced Android Options
Deleting bin and obj after testing different Android options made no difference. The same options debug on the new phone just fine. And I haven't changed the developers setting in the J5. They are the same ones that VS 17.2.6 could debug with.
I am currently installing 17.2.6 to exist in parallel with 17.4.2 on my pc to see if that will help. But any insights regarding the reason behind my problem would be greately appreciated!
Edit: Community is not available for versions before 17.2.10 anymore. So I'll try 17.2.10.
Edit 2: 17.2.10 debugs on my old phone just fine. Same settings, same everything. So, since our target android version is now 13 on the solution on latest vs, I also created a clone of the repo to work with on the old phone because older vs can have only up to android 12.1 as a target version.

Delphi 10.3.3 fails macOS notarization

My program was being notarized in Delphi 10.3.2, but fails in 10.3.3. PAClient exits with code 1. Is there a log that will help me diagnose the problem? If so, how do I find it?
Here is the whole error afterward:
Connecting to 192.168.1.231 on port 64211...
Status Code: 2, LogFileURL:
c:\program files (x86)\embarcadero\studio\20.0\bin\CodeGear.Deployment.targets(581,5): error MSB6006: "paclient" exited with code 1.
Done building target "_OSXDeveloperID" in project "MintToReport4.dproj" -- FAILED.
Done building project "MintToReport4.dproj" -- FAILED.
Build FAILED.
c:\program files (x86)\embarcadero\studio\20.0\bin\CodeGear.Deployment.targets(581,5): error MSB6006: "paclient" exited with code 1.
0 Warning(s)
1 Error(s)

Visual Studio deploy fails with "The method or operation is not implemented"

I'm trying to remotely debug a Windows 8.1 app on an x86 tablet.
The Remote Debugger is started on the Tablet, but every time I try to deploy the app to the Tablet, the Visual Studio output window shows this:
1>------ Build started: Project: $REDACTED, Configuration: Debug x86 ------
1> $REDACTED-> C:\Users\$REDACTED\bin\x86\Debug\$REDACTED.exe
2>------ Deploy started: Project: $REDACTED, Configuration: Debug x86 ------
2>Error: The method or operation is not implemented.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Also, the Remote Debugger on the tablet prints Failed attempt to connect from $REDACTED
Changing remote machine (VS 2015 Remote Debugger settings) from No Authentication to Windows Authentication fixed the problem for me.

Deployment error in local pc using visual studio

I am getting problem while deploying fake driver in my local windows virtual Computer.
I am getting error like,
Deploying driver files for project "C:\ioctl\sys\sioctl-Package\sioctl-Package.vcxproj". Deployment may take a few minutes...
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\x64\ImportAfter\DriverDeployment8.0.targets(69,9): error : Kernel mode drivers cannot be deployed to the local machine
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\x64\ImportAfter\DriverDeployment8.0.targets(69,9): error : Value cannot be null.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\x64\ImportAfter\DriverDeployment8.0.targets(69,9): error : Parameter name: path
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

Resources