Ошибка при развертывании xamarin

I just installed VS 2015, the installation was finish (after some fail time caused by the slow network, I run setup again).

I create a project as Android > Android blank project
When I press F5, the build is seem to by success but the deploy is fail, there isn’t error message. Tried set Tool->Option->Build->Diagnostic, no result. VS 2015 is pretty new, is anyone met this? How can I fix this?

Axifive's user avatar

Axifive

1,1612 gold badges19 silver badges31 bronze badges

asked Jul 29, 2015 at 5:11

Andiana's user avatar

8

I bumped into the same, but I started VS2015 as Administrator and solved the problem.

answered Dec 23, 2015 at 21:04

userb00's user avatar

userb00userb00

5891 gold badge8 silver badges16 bronze badges

1

Is any Android Virtual Device running?


  1. Open AVD menu
    AVD icon

  1. Launch the device
    enter image description here

  1. Wait for it to fully load
  2. Build and deploy
  3. Find your app in device’s menu and execute it

answered Aug 20, 2016 at 9:53

m93a's user avatar

m93am93a

8,8859 gold badges40 silver badges58 bronze badges

3

Visual Studio gets stuck trying to deploy the app to the emulator or the emulator does not appear as a debug target in other IDEs

If the emulator is running, but it does not appear to be connected to ADB (Android Debug Bridge) or it does not appear in Android tools that make use of ADB (for example, Android Studio or Eclipse), you may need to adjust where the emulator looks for ADB.

The emulator uses a registry key to identify the base location of your Android SDK, and looks for the \platform-tools\adb.exe file under that directory. To modify the Android SDK path used by the emulator:

Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK.

Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools in the folder tree on the left.

Modify the Path registry variable to match the path to your Android SDK.

Restart the emulator and you should now be able to see the emulator connected to ADB and associated Android tools.

Priya's user avatar

Priya

1,3596 gold badges21 silver badges41 bronze badges

answered Jun 29, 2016 at 0:41

mohammad jaber's user avatar

0

And yet another recipe of fixing this:

  • clean projects
  • remove all bin, obj folders
  • mark your android-project
    as startup

then try to deploy again

As for me, in some cases, if visual studio stucked on project building, it requires pc reboot.

answered Oct 21, 2016 at 10:21

Fragment's user avatar

FragmentFragment

1,5551 gold badge26 silver badges33 bronze badges

I had the same annoying issue. Going to Options -> Xamarin -> Android Setting and checking Preserve application data/cache on device between deploys solved my problem.

answered Jul 10, 2016 at 5:32

Ali Seyedi's user avatar

Ali SeyediAli Seyedi

1,7581 gold badge19 silver badges24 bronze badges

I was facing same issue.
Just reopen visual studio and rebuild your project..and then try to deploy.

Its worked for me!

Divyang Desai's user avatar

answered Aug 22, 2016 at 11:42

Neelam Prajapati's user avatar

Neelam PrajapatiNeelam Prajapati

3,7743 gold badges28 silver badges62 bronze badges

According to Magnus Grindal Bakken’s comment, I found the solution.

1) The installation must have an internet connection to be completed.
Any interruption may cause components to be excluded.

2) You need android emulator. Installing the Android SDK and Visual Studio 2015, is not sufficient, You either need the Microsoft emulator, the android one or another third party emulator (like Genymotion). You also need to ensure that the Xamarin plugins for Visual Studio are installed.

Xamarin for Visual Studio can be downloaded here. Once it is installed Visual Studio will be able to create and run Xamarin projects. Xamarin for VS includes the Xamarin Player for emulation. I think it’s even better than Genymotion.

Duncan Hoggan's user avatar

answered Apr 5, 2016 at 0:33

Andiana's user avatar

AndianaAndiana

1,9125 gold badges37 silver badges74 bronze badges

Start emulator via AVD manger … [start] button (as user m93a suggested).

And next option contains check option «wipe user data«. Check it !

It helps me solve this problem. Then deploy or debug the application and all process will works as expected.

answered Dec 1, 2016 at 13:34

Pavel Vanecek's user avatar

I had the same problem with my XF App, it didn’t deploy and just one message saying Deployment Failed, internal error….

I solved it. Working on Mac with Xamarin Studio, make sure that the ABI of your simulator is supported by your app.

Xamarin Studio Android project Options

answered Jan 9, 2017 at 12:28

Ivo Krugers's user avatar

0

Just run your Visual studio as Administrator mode.

answered Mar 19, 2021 at 8:39

ajd.nas's user avatar

ajd.nasajd.nas

3542 silver badges12 bronze badges

Sometimes the physical Android device gets confused about versions.

On the device, to go settings | Applications Manager | All applications.

Manually delete your application.
Manually delete «Mono Shared Runtime» (don’t worry it will reinstall during deploy)

Make any change in your project so it is seen as altered and needing to be recompiled: Add a new blank-line to a .cs file or something.

Build
Debug/deploy

answered Oct 7, 2016 at 17:45

Clint StLaurent's user avatar

I faced that problem couple hours ago, I tried to deactivate hyper-V and it worked for me.

answered Nov 9, 2016 at 10:10

Alican Uzun's user avatar

Alican UzunAlican Uzun

3491 gold badge6 silver badges20 bronze badges

In the Android App project Properties in Visual Studio I had to go to Android Options>Advanced and make sure the Support architectures had the architecture of my AVD checked.

In my case this was x86_64 (which, by the way, does not have a particularly discovereable method of installation — took me days).

answered Nov 12, 2016 at 13:51

Peter's user avatar

PeterPeter

1,2924 gold badges15 silver badges33 bronze badges

First of all, we can find the error in «Details» when we click «Start» button on «AVD Manager» for «Android_Accelerated_x86«. If the error is as follows :

Please ensure Intel HAXM is properly installed and usable. CPU
acceleration status: HAXM is not installed on this machine

So, in this case we need to install «Intel® Hardware Accelerated Execution Manager«. It can be downloaded from following link :

haxm-windows_v6_0_6.zip (6.0.6)

Note: After installing Xamarin for the first time in visual studio 2015 i had the same error to run «Android_Accelerated_x86«. After installing this accelerated emulator is now up and running.

RBT's user avatar

RBT

24.2k21 gold badges159 silver badges240 bronze badges

answered Jan 8, 2017 at 2:11

Shantu's user avatar

ShantuShantu

14511 bronze badges

1

If the emulator does not even lauch, maybe deploy is skipped.
You cas see this in the output console.
If so, you may have to activate the deploy by checking it in the solution’s (not project) parameters.

If the emulator launches but the deploy won’t end after minutes, with no error, try the steps described here : https://stackoverflow.com/a/32564067/7505268
That solved it for me.

Community's user avatar

answered Feb 2, 2017 at 16:06

Colin Calvat's user avatar

1

I had Xamarin Android Player opened while trying to deploy the Android project. This steps worked for me:

  1. Closed Xamarin Android Player
  2. Ran Android project again

answered Mar 6, 2017 at 22:10

ndarriulat's user avatar

ndarriulatndarriulat

7491 gold badge9 silver badges11 bronze badges

in my case I had this problem because «Solution Configuration» was set to Release. I change it back to Debug and I solve the problem

answered Jul 11, 2017 at 23:34

Ardenne's user avatar

ArdenneArdenne

8972 gold badges13 silver badges23 bronze badges

Try one of the following and see if you can get the app to deploy to your device.

  • Clean and build project/solution
  • Make sure you have updated all the NuGet packages (Right click on solution and click on Manage NuGet Packages…. Then check in Updates section whether there are any updates)
  • Make sure you have installed all the necessary SDKs from the Android SDK Manager
  • Check whether you have selected the correct project as the startup
  • Check if you have set the correct path for Android SDK and NDK locations
  • Make sure you have checked Deploy for your selected project from Build -> Configuration Manager

answered Sep 6, 2017 at 9:18

Curiosity's user avatar

CuriosityCuriosity

1,7633 gold badges25 silver badges47 bronze badges

Well there can be many reasons,one of them could be that from the Build section in your toolbar,if you check the configuration manager there will be project names that are available in your current solution all you have to check is if the deploy checkbox is checked or not.If not kindly check it and things will work just fine

answered Sep 7, 2017 at 9:49

FreakyAli's user avatar

FreakyAliFreakyAli

13.4k3 gold badges24 silver badges64 bronze badges

This worked for me:

  • Making sure that Define DEBUG constant is checked.

enter image description here

  • Using Log.Info("yourTag-AnyString", "Error before/after ");

            protected override void OnCreate(Bundle bundle)
            {
                base.OnCreate(bundle);
    
                // Set our view from the "main" layout resource
                Log.Info(tag, "Error before Layout");
                SetContentView(Resource.Layout.Main);
    
                // Get our button from the layout resource,
                // and attach an event to it
                //Button button = FindViewById<Button>(Resource.Id.MyButton);
    
                //button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
                Log.Info(tag, "Error before variables");
                userName = FindViewById<EditText>(Resource.Id.editTextUsername);
                password = FindViewById<EditText>(Resource.Id.editTextPassword);
                btnInsert = FindViewById<Button>(Resource.Id.btnInsert);
                Log.Info(tag, "Error after variables");
                btnInsert.Click += BtnInsert_Click;
            }
    
  • changing emulators or exporting the signed .apk instead

  • For android apps, using android device logging

answered Oct 21, 2017 at 23:20

Jamezuh's user avatar

JamezuhJamezuh

1211 silver badge6 bronze badges

There is actually a connection between running Visual Studio as administrator and setting the registry path.

I followed the instructions here but it only worked after running VS as admin because my Android SDK path is in «C:\Program Files (x86)». So in order to add or change files there you need admin rights. Alternatively you can change the permissions of the «Android» folder so that the group «Users» as full access. This worked for me as well.

Or you make sure you don’t even install the Android SDK in «C:\Program Files (x86)».

By the way I found that restarting VS, or even the Emulator again wasn’t necessary after I added the registry key. It picks it up when it needs to.

answered Jan 7, 2018 at 0:30

penCsharpener's user avatar

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.

I just installed VS 2015, the installation was finish (after some fail time caused by the slow network, I run setup again).

I create a project as Android > Android blank project
When I press F5, the build is seem to by success but the deploy is fail, there isn’t error message. Tried set Tool->Option->Build->Diagnostic, no result. VS 2015 is pretty new, is anyone met this? How can I fix this?

Axifive's user avatar

Axifive

1,1612 gold badges19 silver badges31 bronze badges

asked Jul 29, 2015 at 5:11

Andiana's user avatar

8

I bumped into the same, but I started VS2015 as Administrator and solved the problem.

answered Dec 23, 2015 at 21:04

userb00's user avatar

userb00userb00

5891 gold badge8 silver badges16 bronze badges

1

Is any Android Virtual Device running?


  1. Open AVD menu
    AVD icon

  1. Launch the device
    enter image description here

  1. Wait for it to fully load
  2. Build and deploy
  3. Find your app in device’s menu and execute it

answered Aug 20, 2016 at 9:53

m93a's user avatar

m93am93a

8,8859 gold badges40 silver badges58 bronze badges

3

Visual Studio gets stuck trying to deploy the app to the emulator or the emulator does not appear as a debug target in other IDEs

If the emulator is running, but it does not appear to be connected to ADB (Android Debug Bridge) or it does not appear in Android tools that make use of ADB (for example, Android Studio or Eclipse), you may need to adjust where the emulator looks for ADB.

The emulator uses a registry key to identify the base location of your Android SDK, and looks for the \platform-tools\adb.exe file under that directory. To modify the Android SDK path used by the emulator:

Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK.

Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools in the folder tree on the left.

Modify the Path registry variable to match the path to your Android SDK.

Restart the emulator and you should now be able to see the emulator connected to ADB and associated Android tools.

Priya's user avatar

Priya

1,3596 gold badges21 silver badges41 bronze badges

answered Jun 29, 2016 at 0:41

mohammad jaber's user avatar

0

And yet another recipe of fixing this:

  • clean projects
  • remove all bin, obj folders
  • mark your android-project
    as startup

then try to deploy again

As for me, in some cases, if visual studio stucked on project building, it requires pc reboot.

answered Oct 21, 2016 at 10:21

Fragment's user avatar

FragmentFragment

1,5551 gold badge26 silver badges33 bronze badges

I had the same annoying issue. Going to Options -> Xamarin -> Android Setting and checking Preserve application data/cache on device between deploys solved my problem.

answered Jul 10, 2016 at 5:32

Ali Seyedi's user avatar

Ali SeyediAli Seyedi

1,7581 gold badge19 silver badges24 bronze badges

I was facing same issue.
Just reopen visual studio and rebuild your project..and then try to deploy.

Its worked for me!

Divyang Desai's user avatar

answered Aug 22, 2016 at 11:42

Neelam Prajapati's user avatar

Neelam PrajapatiNeelam Prajapati

3,7743 gold badges28 silver badges62 bronze badges

According to Magnus Grindal Bakken’s comment, I found the solution.

1) The installation must have an internet connection to be completed.
Any interruption may cause components to be excluded.

2) You need android emulator. Installing the Android SDK and Visual Studio 2015, is not sufficient, You either need the Microsoft emulator, the android one or another third party emulator (like Genymotion). You also need to ensure that the Xamarin plugins for Visual Studio are installed.

Xamarin for Visual Studio can be downloaded here. Once it is installed Visual Studio will be able to create and run Xamarin projects. Xamarin for VS includes the Xamarin Player for emulation. I think it’s even better than Genymotion.

Duncan Hoggan's user avatar

answered Apr 5, 2016 at 0:33

Andiana's user avatar

AndianaAndiana

1,9125 gold badges37 silver badges74 bronze badges

Start emulator via AVD manger … [start] button (as user m93a suggested).

And next option contains check option «wipe user data«. Check it !

It helps me solve this problem. Then deploy or debug the application and all process will works as expected.

answered Dec 1, 2016 at 13:34

Pavel Vanecek's user avatar

I had the same problem with my XF App, it didn’t deploy and just one message saying Deployment Failed, internal error….

I solved it. Working on Mac with Xamarin Studio, make sure that the ABI of your simulator is supported by your app.

Xamarin Studio Android project Options

answered Jan 9, 2017 at 12:28

Ivo Krugers's user avatar

0

Just run your Visual studio as Administrator mode.

answered Mar 19, 2021 at 8:39

ajd.nas's user avatar

ajd.nasajd.nas

3542 silver badges12 bronze badges

Sometimes the physical Android device gets confused about versions.

On the device, to go settings | Applications Manager | All applications.

Manually delete your application.
Manually delete «Mono Shared Runtime» (don’t worry it will reinstall during deploy)

Make any change in your project so it is seen as altered and needing to be recompiled: Add a new blank-line to a .cs file or something.

Build
Debug/deploy

answered Oct 7, 2016 at 17:45

Clint StLaurent's user avatar

I faced that problem couple hours ago, I tried to deactivate hyper-V and it worked for me.

answered Nov 9, 2016 at 10:10

Alican Uzun's user avatar

Alican UzunAlican Uzun

3491 gold badge6 silver badges20 bronze badges

In the Android App project Properties in Visual Studio I had to go to Android Options>Advanced and make sure the Support architectures had the architecture of my AVD checked.

In my case this was x86_64 (which, by the way, does not have a particularly discovereable method of installation — took me days).

answered Nov 12, 2016 at 13:51

Peter's user avatar

PeterPeter

1,2924 gold badges15 silver badges33 bronze badges

First of all, we can find the error in «Details» when we click «Start» button on «AVD Manager» for «Android_Accelerated_x86«. If the error is as follows :

Please ensure Intel HAXM is properly installed and usable. CPU
acceleration status: HAXM is not installed on this machine

So, in this case we need to install «Intel® Hardware Accelerated Execution Manager«. It can be downloaded from following link :

haxm-windows_v6_0_6.zip (6.0.6)

Note: After installing Xamarin for the first time in visual studio 2015 i had the same error to run «Android_Accelerated_x86«. After installing this accelerated emulator is now up and running.

RBT's user avatar

RBT

24.2k21 gold badges159 silver badges240 bronze badges

answered Jan 8, 2017 at 2:11

Shantu's user avatar

ShantuShantu

14511 bronze badges

1

If the emulator does not even lauch, maybe deploy is skipped.
You cas see this in the output console.
If so, you may have to activate the deploy by checking it in the solution’s (not project) parameters.

If the emulator launches but the deploy won’t end after minutes, with no error, try the steps described here : https://stackoverflow.com/a/32564067/7505268
That solved it for me.

Community's user avatar

answered Feb 2, 2017 at 16:06

Colin Calvat's user avatar

1

I had Xamarin Android Player opened while trying to deploy the Android project. This steps worked for me:

  1. Closed Xamarin Android Player
  2. Ran Android project again

answered Mar 6, 2017 at 22:10

ndarriulat's user avatar

ndarriulatndarriulat

7491 gold badge9 silver badges11 bronze badges

in my case I had this problem because «Solution Configuration» was set to Release. I change it back to Debug and I solve the problem

answered Jul 11, 2017 at 23:34

Ardenne's user avatar

ArdenneArdenne

8972 gold badges13 silver badges23 bronze badges

Try one of the following and see if you can get the app to deploy to your device.

  • Clean and build project/solution
  • Make sure you have updated all the NuGet packages (Right click on solution and click on Manage NuGet Packages…. Then check in Updates section whether there are any updates)
  • Make sure you have installed all the necessary SDKs from the Android SDK Manager
  • Check whether you have selected the correct project as the startup
  • Check if you have set the correct path for Android SDK and NDK locations
  • Make sure you have checked Deploy for your selected project from Build -> Configuration Manager

answered Sep 6, 2017 at 9:18

Curiosity's user avatar

CuriosityCuriosity

1,7633 gold badges25 silver badges47 bronze badges

Well there can be many reasons,one of them could be that from the Build section in your toolbar,if you check the configuration manager there will be project names that are available in your current solution all you have to check is if the deploy checkbox is checked or not.If not kindly check it and things will work just fine

answered Sep 7, 2017 at 9:49

FreakyAli's user avatar

FreakyAliFreakyAli

13.4k3 gold badges24 silver badges64 bronze badges

This worked for me:

  • Making sure that Define DEBUG constant is checked.

enter image description here

  • Using Log.Info("yourTag-AnyString", "Error before/after ");

            protected override void OnCreate(Bundle bundle)
            {
                base.OnCreate(bundle);
    
                // Set our view from the "main" layout resource
                Log.Info(tag, "Error before Layout");
                SetContentView(Resource.Layout.Main);
    
                // Get our button from the layout resource,
                // and attach an event to it
                //Button button = FindViewById<Button>(Resource.Id.MyButton);
    
                //button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
                Log.Info(tag, "Error before variables");
                userName = FindViewById<EditText>(Resource.Id.editTextUsername);
                password = FindViewById<EditText>(Resource.Id.editTextPassword);
                btnInsert = FindViewById<Button>(Resource.Id.btnInsert);
                Log.Info(tag, "Error after variables");
                btnInsert.Click += BtnInsert_Click;
            }
    
  • changing emulators or exporting the signed .apk instead

  • For android apps, using android device logging

answered Oct 21, 2017 at 23:20

Jamezuh's user avatar

JamezuhJamezuh

1211 silver badge6 bronze badges

There is actually a connection between running Visual Studio as administrator and setting the registry path.

I followed the instructions here but it only worked after running VS as admin because my Android SDK path is in «C:\Program Files (x86)». So in order to add or change files there you need admin rights. Alternatively you can change the permissions of the «Android» folder so that the group «Users» as full access. This worked for me as well.

Or you make sure you don’t even install the Android SDK in «C:\Program Files (x86)».

By the way I found that restarting VS, or even the Emulator again wasn’t necessary after I added the registry key. It picks it up when it needs to.

answered Jan 7, 2018 at 0:30

penCsharpener's user avatar

Студворк — интернет-сервис помощи студентам

Делаю простое приложение на Xamarin.Forms. С реализацией под каждую платформу не балуюсь (всё в общем проекте). Если запускать UWP — всё нормально, если запускать android через Live PLayer — всё тоже нормально (android 7.0), но если запустить через эмулятор(android 7.1) то будет ошибка при развертывании. Я хотел это просто проигнорировать и собрать release но при упаковке архива мне выдало абсолютно ту же ошибку. (настройки проекта вроде бы нормальные). Подскажите в чём дело, видел на англоязычных форумах, что это нужно переустановить android sdk, переустановил — не помогло.

Сама ошибка:

Кликните здесь для просмотра всего текста

Ошибка непредвиденная ошибка при выполнении задачи Aapt».
System.AggregateException: Произошла одна или несколько ошибок. —> System.FormatException: Входная строка имела неверный формат.
в System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
в System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
в Xamarin.Android.Tasks.ManifestDocument.CalculateVersionCode(String currentAbi, String versionCodePattern, String versionCodeProperties)
в Xamarin.Android.Tasks.Aapt.GenerateCommandLineCommands(String ManifestFile, String currentAbi, String currentResourceOutputFile)
в Xamarin.Android.Tasks.Aapt.DoExecute(ITaskItem manifestFile, ParallelLoopState state, Int32 loop)
в System.Threading.Tasks.Parallel.<>c__DisplayClass30_0`2.<ForEachWorker>b__3(Int3 2 i, ParallelLoopState state, TLocal local)
в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
в System.Threading.Tasks.Task.InnerInvoke()
в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0( Object )
— Конец трассировки внутреннего стека исключений —
в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
в System.Threading.Tasks.Task.Wait()
в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
в System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](TSource[] array, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
в System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
в System.Threading.Tasks.Parallel.ForEach[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Func`1 localInit, Func`4 body, Action`1 localFinally)
в Xamarin.Android.Tasks.Aapt.Execute()
в Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecution Host.Execute()
в Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
—> (Внутреннее исключение #0) System.FormatException: Входная строка имела неверный формат.
в System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
в System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
в Xamarin.Android.Tasks.ManifestDocument.CalculateVersionCode(String currentAbi, String versionCodePattern, String versionCodeProperties)
в Xamarin.Android.Tasks.Aapt.GenerateCommandLineCommands(String ManifestFile, String currentAbi, String currentResourceOutputFile)
в Xamarin.Android.Tasks.Aapt.DoExecute(ITaskItem manifestFile, ParallelLoopState state, Int32 loop)
в System.Threading.Tasks.Parallel.<>c__DisplayClass30_0`2.<ForEachWorker>b__3(Int3 2 i, ParallelLoopState state, TLocal local)
в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
в System.Threading.Tasks.Task.InnerInvoke()
в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0( Object )<— CrossApp.Android

При запуске приложение в андроид эмуляторе появляется сообщение «В ходе развёртывания произошли ошибки». Как это исправить?


  • Вопрос задан

  • 881 просмотр

Пригласить эксперта

AlexHolms Ошибку скринами… Ох.. pastebin и прочие есть для такого. В целом — у вас там куча ошибок, в том числе File Not found exception. Берете их, иидете в гугл, с указанием что это ксамарин.


  • Показать ещё
    Загружается…

22 сент. 2023, в 19:00

1000 руб./за проект

22 сент. 2023, в 18:59

30000 руб./за проект

22 сент. 2023, в 18:50

5000 руб./за проект

Минуточку внимания

Понравилась статья? Поделить с друзьями:

Интересное по теме:

  • Ошибка при прошивке через один
  • Ошибка при разборе файла sbisconnect ini
  • Ошибка при проверке подлинности код 0x80004005 удаленный компьютер
  • Ошибка при разборе конфигурации апкш континент
  • Ошибка при проверке свободных блоков на диске

  • Добавить комментарий

    ;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: