7

Good night everybody!

I'm trying to get started developing with Xamarin, but i'm out of luck to get things running in first place. I recently installed VS2015 with the custom option, where I checked to instal Xamarin. After the setup completion I updated Xamarin and the android SDK to the latest version. When I try to deploy a simple app (just created a new project and tried to start) the deploy fails. I tried many solutions, such as: re-installing everything, updating android sdk, downloading xamarin android player, creating new devices, updating java sdk to the 1.8.0 version, etc. All without success. Does anyone could give me a light? I'm running out of options here. Below the stack trace of the error:

1>The "InstallPackageAssemblies" task failed unexpectedly.
1>System.AggregateException: One or more errors occurred. ---> Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.AdbException: Read-only file system
1>   at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token)
1>   at Mono.AndroidTools.Adb.AdbSyncClient.EndPush(IAsyncResult result)
1>   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
1>   --- End of inner exception stack trace ---
1>   at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>d__99.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at Xamarin.AndroidTools.AndroidDeploySession.<StartAsync>d__98.MoveNext()
1>   --- End of inner exception stack trace ---
1>   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
1>   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
1>   at System.Threading.Tasks.Task.Wait()
1>   at Xamarin.Android.Tasks.InstallPackageAssemblies.Execute()
1>   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>---> (Inner Exception #0) Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.AdbException: Read-only file system
1>   at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token)
1>   at Mono.AndroidTools.Adb.AdbSyncClient.EndPush(IAsyncResult result)
1>   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
1>   --- End of inner exception stack trace ---
1>   at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>d__99.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at Xamarin.AndroidTools.AndroidDeploySession.<StartAsync>d__98.MoveNext()<---
1>
1>Build FAILED.
1>
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

And here the current config of Xamarin and the android virtual device: Xamarin config Android virtual device

---------EDIT---------

I managed to run the android virtual machine through xamarin android player and Visual Studio Emulator for android. But I'm still not able to deploy an app. Now I'm getting the error:

Android application is debugging.
10-12 02:20:32.251 D/dalvikvm( 1429): Late-enabling CheckJNI
10-12 02:20:32.279 D/dalvikvm( 1429): Trying to load lib /data/app-lib/App2.App2-1/libmonodroid.so 0xa8fb7c58
10-12 02:20:32.279 D/dalvikvm( 1429): Added shared lib /data/app-lib/App2.App2-1/libmonodroid.so 0xa8fb7c58
10-12 02:20:32.279 W/monodroid( 1429): Using override path: /data/data/App2.App2/files/.override
10-12 02:20:32.279 W/monodroid( 1429): Trying to load sgen from: /data/data/App2.App2/files/.override/libmonosgen-2.0.so
10-12 02:20:32.279 W/monodroid( 1429): Trying to load sgen from: /storage/emulated/0/Android/data/App2.App2/files/.override/libmonosgen-2.0.so
10-12 02:20:32.279 W/monodroid( 1429): Trying to load sgen from: /data/app-lib/App2.App2-1/libmonosgen-2.0.so
10-12 02:20:32.279 W/monodroid( 1429): Trying to load sgen from: /data/data/App2.App2/files/.override/links/libmonosgen-2.0.so
10-12 02:20:32.283 W/monodroid-debug( 1429): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8933,server=y,embedding=1
10-12 02:20:32.467 W/monodroid-debug( 1429): Accepted stdout connection: 43
10-12 02:20:33.239 D/Mono ( 1429): Image addref mscorlib[0xb7dd76f0] -> mscorlib.dll[0xb7de49e0]: 1
10-12 02:20:33.239 D/Mono ( 1429): AOT module 'mscorlib.dll.so' not found: dlopen failed: library "/data/app-lib/App2.App2-1/libaot-mscorlib.dll.so" not found
10-12 02:20:33.239 D/Mono ( 1429): AOT module '/Users/builder/data/lanes/3819/96c7ba6c/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/mscorlib.dll.so' not found: dlopen failed: library "/data/app-lib/App2.App2-1/libaot-mscorlib.dll.so" not found
10-12 02:20:33.239 D/Mono ( 1429): Config attempting to parse: 'mscorlib.dll.config'.
10-12 02:20:33.239 D/Mono ( 1429): Config attempting to parse: '/Users/builder/data/lanes/3819/96c7ba6c/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/mscorlib/mscorlib.config'.
Could not connect to the debugger.

What I've tried so far:
-Disabling fast deployment.
-Add the following permission to the manifest: ACCESS_COARSE_LOCATION, INTERNET.
-Checked the supported architectures: armeabi, armeabi-v7a.
-Checked the option “Migrate to a physical computer with a different processor version” at the hyper-v compatibility tab.

None of the above worked for me, and I couldn't find any other solution so far.

Thanks in advance! Best regards.

Abner
  • 416
  • 5
  • 18
  • The error at hand is `Mono.AndroidTools.AdbException: Read-only file system` meaning that `adb` is having issues connecting to the emulator as it's read-only. I would guess that you may want to add some memory to the SD card, double check the `android.permission.WRITE_EXTERNAL_STORAGE` permission. Finally ensure that the installation preferred location is internal. – Jon Douglas Oct 12 '16 at 02:57
  • I managed to fix the problem by enabling AMD-V at the BIOS options and then updating the Oracle VM VirtualBox to the latest version. Thanks for the attention! Now i'm getting another error to deploy the app: " Couldn't connect to logcat, GetProcessId returned: 0". Even unchecking the fast deploy option didn't fixed this one. – Abner Oct 12 '16 at 04:05
  • One note: Xamarin Android Player is deprecated - https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-emulator/#Emulator_Choices For the VS Android Emulator troubleshooting, you may want to see this doc instead: https://msdn.microsoft.com/en-us/library/mt228282.aspx (Some of these troubleshooting steps require you to uninstall the Xamarin Android Player and ensure the ip is open to connect to for debugging) – Jon Douglas Oct 12 '16 at 16:22
  • @JonDouglas thanks for your efforts, I tried the solutions indicated by MSDN troubleshooting without success. I managed to make android studio run and deploy an app to the visual studio android emulator without problems. I'm very minded to go for android studio and forget about Xamarin. Spent more than 6 hours using google to solve my problems with Xamarin, without success. – Abner Oct 12 '16 at 16:46
  • I have the exact same problem and unfortunately your suggestions didn't help @JonDouglas. It made me hopeful though since I have 0 SD Card space and the external permission wasn't set haha. – dee-see Oct 14 '16 at 02:40

3 Answers3

7

simple just uncheck fast deployment.

enter image description here

A.W.
  • 2,858
  • 10
  • 57
  • 90
john smit
  • 81
  • 1
  • 2
3

The above suggestion "simple just uncheck fast deployment." works also on new MacBook M1 Apple arm processor Visual Studio Xamarin with the android emulator (https://github.com/google/android-emulator-m1-preview).

enter image description here

Isidoros Moulas
  • 520
  • 3
  • 10
2

I solve this problem by doing this :

  • Go to "Turn Windows features On or Off"
  • Turn Hyper-V off: un check the Hyper-V
  • Reboot

after that :

  • Go to "Turn Windows features On or Off"
    • Turn Hyper-V on: check the Hyper-V
    • Reboot

Finally, every thing will be working good.

Hamdan Hejazi
  • 139
  • 1
  • 1
  • 11