Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying fails with null reference exception #8199

Closed
Youssef1313 opened this issue Jul 19, 2023 · 4 comments
Closed

Deploying fails with null reference exception #8199

Youssef1313 opened this issue Jul 19, 2023 · 4 comments
Assignees
Labels
needs-triage Issues that need to be assigned. vs-sync For internal use only; creates a VSTS "mirror" issue.

Comments

@Youssef1313
Copy link
Contributor

Youssef1313 commented Jul 19, 2023

Android application type

.NET Android (net7.0-android, etc.)

Affected platform version

VS 2022 17.7 Preview 4

Description

Xamarin.VisualStudio.Android.dll!Xamarin.VisualStudio.Android.CommandHandlers.DeployCommandHandler.CanExecute.AnonymousMethod__13_2(Xamarin.VisualStudio.Android.Setup.IAndroidProjectSetup x) Line 94
	at D:\a\_work\1\s\src\Core\VisualStudio.Android\CommandHandlers\DeployCommandHandler.cs(94)
System.Core.dll!System.Linq.Enumerable.FirstOrDefault<Xamarin.VisualStudio.Android.Setup.IAndroidProjectSetup>(System.Collections.Generic.IEnumerable<Xamarin.VisualStudio.Android.Setup.IAndroidProjectSetup> source, System.Func<Xamarin.VisualStudio.Android.Setup.IAndroidProjectSetup, bool> predicate)
Xamarin.VisualStudio.Android.dll!Xamarin.VisualStudio.Android.CommandHandlers.DeployCommandHandler.CanExecute(Xamarin.VisualStudio.Android.DeployCommand command) Line 94
	at D:\a\_work\1\s\src\Core\VisualStudio.Android\CommandHandlers\DeployCommandHandler.cs(94)
[Lightweight Function]
Xamarin.VisualStudio.Shell.dll!Xamarin.VisualStudio.Shell.CommandHandlers.DeployProjectAsyncCommandHandler.ExecutePlatformCommandAsync(dynamic command, System.Threading.CancellationToken cancellation) Line 112
	at D:\a\_work\1\s\src\Core\VisualStudio.Shell\CommandHandlers\DeployProjectCommandHandler.cs(112)
Xamarin.VisualStudio.Shell.dll!Xamarin.VisualStudio.Shell.CommandHandlers.DeployProjectAsyncCommandHandler.ExecuteAsync(Xamarin.VisualStudio.Contracts.Commands.DeployProjectAsync command, System.Threading.CancellationToken cancellation) Line 79
	at D:\a\_work\1\s\src\Core\VisualStudio.Shell\CommandHandlers\DeployProjectCommandHandler.cs(79)
[Resuming Async Method]
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(980)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(928)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(1070)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() Line 977
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(977)
mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() Line 288
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\TaskAwaiter.cs(288)
mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\TaskContinuation.cs(810)
mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\Task.cs(3617)
mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Line 490
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\Future.cs(490)
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<Xamarin.VisualStudio.Devices.IDevice>.SetResult(Xamarin.VisualStudio.Devices.IDevice result) Line 603
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(603)
[Completed] Xamarin.VisualStudio.Shell.dll!Xamarin.VisualStudio.Shell.CommandHandlers.DeployProjectAsyncCommandHandler.GetTargetDeviceAsync(Xamarin.VisualStudio.Contracts.Commands.DeployProjectAsync command) Line 134
	at D:\a\_work\1\s\src\Core\VisualStudio.Shell\CommandHandlers\DeployProjectCommandHandler.cs(134)
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(980)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(928)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(1070)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() Line 977
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(977)
mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() Line 288
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\TaskAwaiter.cs(288)
mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\TaskContinuation.cs(810)
mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\Task.cs(3617)
mscorlib.dll!System.Threading.Tasks.Task<bool>.TrySetResult(bool result) Line 490
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\Future.cs(490)
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<bool>.SetResult(bool result) Line 603
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(603)
[Completed] Xamarin.VisualStudio.Android.dll!Xamarin.VisualStudio.Android.MonoAndroidDeviceManager.AppliesToAsync(Xamarin.VisualStudio.ProjectSystem.IProjectState project) Line 75
	at D:\a\_work\1\s\src\Core\VisualStudio.Android\Devices\MonoAndroidDeviceManager.cs(75)
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(980)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(928)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(1070)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() Line 977
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(977)
mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() Line 288
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\TaskAwaiter.cs(288)
mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\TaskContinuation.cs(810)
mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\Task.cs(3617)
mscorlib.dll!System.Threading.Tasks.Task<bool>.TrySetResult(bool result) Line 490
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\Future.cs(490)
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<bool>.SetResult(bool result) Line 603
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(603)
[Completed] Xamarin.VisualStudio.Windows.dll!Xamarin.VisualStudio.ProjectSystem.MultiTargetingProjectTracker.AppliesToAsync(string projectCapabilities) Line 97
	at D:\a\_work\1\s\src\Core\VisualStudio\ProjectSystem\MultiTargetingProjectTracker.cs(97)
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(980)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(928)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(1070)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() Line 977
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(977)
mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() Line 288
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\TaskAwaiter.cs(288)
mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) Line 810
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\TaskContinuation.cs(810)
mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() Line 3617
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\Task.cs(3617)
mscorlib.dll!System.Threading.Tasks.Task<bool>.TrySetResult(bool result) Line 490
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\Future.cs(490)
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<bool>.SetResult(bool result) Line 603
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(603)
[Completed] Xamarin.VisualStudio.Android.dll!Xamarin.VisualStudio.Android.ProjectSystem.AndroidAppProjectTracker.AppliesToAsync(string projectCapabilities) Line 279
	at D:\a\_work\1\s\src\Core\VisualStudio.Android\ProjectSystem\AndroidProjectTracker.cs(279)
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(980)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928
	at f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs(928)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Line 1070
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(1070)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() Line 977
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\AsyncMethodBuilder.cs(977)
mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() Line 288
	at f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\TaskAwaiter.cs(288)
mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.ExecuteWorkItemHelper() Line 681
	at f:\dd\ndp\clr\src\BCL\system\threading\Tasks\TaskContinuation.cs(681)
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Line 820
	at f:\dd\ndp\clr\src\BCL\system\threading\threadpool.cs(820)
[Async Call Stack]
[Async] Xamarin.VisualStudio.Shell.dll!Xamarin.VisualStudio.Shell.XamarinCommandBus.ExecuteAsync<bool>(Merq.IAsyncCommand<bool> command, System.Threading.CancellationToken cancellation) Line 125
	at D:\a\_work\1\s\src\Core\VisualStudio.Shell\XamarinCommandBus.cs(125)
[Async] Xamarin.VisualStudio.Shell.dll!Microsoft.VisualStudio.ProjectSystem.Mobile.MobilePlatformDeployProvider.DeployAsync(Microsoft.VisualStudio.ProjectSystem.ConfiguredProject configuredProject, System.Threading.CancellationToken cancellationToken, System.IO.TextWriter outputPaneWriter) Line 68
	at D:\a\_work\1\s\src\Core\VisualStudio.Shell\CommonProjectSystem\Multiplatform\Platforms\Mobile\MobilePlatformDeployProvider.cs(68)
[Async] Xamarin.VisualStudio.Shell.dll!Xamarin.VisualStudio.ProjectSystem.DeployProvider.DeployAsync(System.Threading.CancellationToken cancellationToken, System.IO.TextWriter outputPaneWriter) Line 93
	at D:\a\_work\1\s\src\Core\VisualStudio.Shell\CommonProjectSystem\Debug\DeployProvider.cs(93)
[Async] [Awaited by multiple tasks/threads]

Output

20:36:25:897	Build started...
20:36:27:727	1>------ Build started: Project: Uno.netcoremobile, Configuration: Debug Any CPU ------
20:36:28:132	2>------ Build started: Project: Uno.UI.netcoremobile, Configuration: Debug Any CPU ------
20:36:29:111	3>------ Build started: Project: SamplesApp.netcoremobile, Configuration: Debug Any CPU ------
20:36:30:677	3>C:\Users\PC\Desktop\uno\src\SamplesApp\SamplesApp.netcoremobile\Android\AndroidManifest.xml : warning XA4216: AndroidManifest.xml //uses-sdk/@android:minSdkVersion '16' is less than API-19, this configuration is not supported.
20:36:30:677	3>C:\Users\PC\Desktop\uno\src\SamplesApp\SamplesApp.netcoremobile\Android\AndroidManifest.xml : warning XA4211: AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '30' is less than $(TargetFrameworkVersion) ''. Using API-33 for ACW compilation.
20:36:36:678	3>SamplesApp.netcoremobile -> C:\Users\PC\Desktop\uno\src\SamplesApp\SamplesApp.netcoremobile\bin\Debug\net7.0-android\SamplesApp.dll
20:36:39:986	3>C:\Users\PC\Desktop\uno\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets(53,3): warning : The Uno.UI.Tasks build task is running under devenv.exe you will have to restart Visual Studio to rebuild it.
20:36:40:076	3>Done building project "SamplesApp.netcoremobile.csproj".
20:36:40:294	3>obj\Debug\net7.0-android\android\AndroidManifest.xml : warning XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-33\optional\androidx.window.extensions.jar
20:36:40:294	3>obj\Debug\net7.0-android\android\AndroidManifest.xml : warning XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-33\optional\androidx.window.sidecar.jar
20:36:41:698	3>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.68\tools\Xamarin.Android.Aapt2.targets(212,3): warning APT2000: warn: removing resource uno.platform.unosampleapp:string/Given_ResourceMap_When_MainMap without required default value.
20:36:41:698	3>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.68\tools\Xamarin.Android.Aapt2.targets(212,3): warning APT2000: warn: removing resource uno.platform.unosampleapp:string/Prefix_Given_ResourceLoader_When_PrefixedNamedLoader without required default value.
20:36:41:967	3>Done building project "SamplesApp.netcoremobile.csproj".
20:36:42:037	4>------ Deploy started: Project: SamplesApp.netcoremobile, Configuration: Debug Any CPU ------
20:43:58:301	4>Object reference not set to an instance of an object.
20:43:58:639	========== Build: 3 succeeded, 0 failed, 20 up-to-date, 0 skipped ==========
20:43:58:639	========== Build started at 8:35 PM and took 08:04.055 minutes ==========
20:43:58:639	========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
20:43:58:639	========== Deploy started at 8:35 PM and took 08:04.055 minutes ==========

Steps to Reproduce

None available. Doesn't seem consistent.

Did you find any workaround?

No response

Relevant log output

No response

@nickrandolph
Copy link

This seems to be an issue with VS 17.6.5 as well if you have a side-by-side install of VS preview

@jpobst
Copy link
Contributor

jpobst commented Jul 24, 2023

@dellis1972 Does this look like the VS extension to you? It doesn't look like our deploy.

@dellis1972
Copy link
Contributor

@jpobst this looks like its the VS extension that is having the issue. @tondat any chance your team can take a look?

@jpobst jpobst added the vs-sync For internal use only; creates a VSTS "mirror" issue. label Jul 24, 2023
@jpobst
Copy link
Contributor

jpobst commented Jul 24, 2023

This issue likely occurs in the Visual Studio integration, which is owned by a different team who does not use GitHub for issue tracking.

Please use the tools available inside of VS to report this issue. This allows the issue to be routed to the correct team, and provides them the correct logs they need to diagnose it.

Thanks!

@jpobst jpobst closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-triage Issues that need to be assigned. vs-sync For internal use only; creates a VSTS "mirror" issue.
Projects
None yet
Development

No branches or pull requests

4 participants