Skip to content

[Bug] application deploy on Android 11 emulator fails with Mono.AndroidTools.AdbException: secure_mkdirs failed: Permission denied #4996

@pmahend1

Description

@pmahend1

Description

Last week upgraded Visual Studio 2019(Professional) which shipped Android 11 SDK updates
I changed the target SDK in both manifest and project application properties.
When I try to deploy the app I get the error. This error doesnt show up for Android Pie and Q emulators

Steps to Reproduce

  1. Update Visual Studio 2019 to 16.7
  2. Update all android SDKs
  3. Create an x86 emulator with Android 11(R)
  4. Build and Run Android app selecting Android 11 emulator

Expected Behavior

App should deploy and run successfully.

Actual Behavior

Severity	Code	Description	Project	File	Line	Suppression State
Error		ADB1000:  Deployment failed
Xamarin.AndroidTools.AndroidDeploymentException: FailedToSynchronizeFastDevAssemblies ---> Mono.AndroidTools.AdbException: secure_mkdirs failed: Permission denied
   at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token)
   at Mono.AndroidTools.Adb.AdbSyncClient.EndPushSyncItems(IAsyncResult result)
   at Mono.AndroidTools.Internal.AdbClientTaskExtensions.InnerInvoke(TaskCompletionSource`1 tcs, Func`2 endMethod, IAsyncResult l)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<InstallAssemblies>d__121.MoveNext()
   --- End of inner exception stack trace ---
   at Xamarin.AndroidTools.AndroidDeploySession.<InstallAssemblies>d__121.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<FastDevAsync>d__118.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<RunAsync>d__110.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>d__108.MoveNext()		 	0	

Basic Information

  • Version with issue: Xamarin Forms 4.8.0.XXXX
  • Last known good version: Not sure
  • IDE: Visual Studio 2019 Professional
  • Platform Target Frameworks:
    • iOS: N/A
    • Android: Android 11
    • UWP: N/A
  • Android Support Library Version:
  • Nuget Packages: Xamarin Forms 4.8.0.XXXX Xamarin.Android.Support 28.0.0.3
  • Affected Devices:

Screenshots

Reproduction Link

Workaround

Turn Use Fast Deployment Off
Reference : https://forums.xamarin.com/discussion/11383/deployment-failed-due-to-an-error-in-fastdev-assembly-synchronization

Metadata

Metadata

Assignees

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.bugComponent does not function as intended.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions