Меню

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

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-toolsadb.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_MACHINESOFTWAREWow6432NodeAndroid 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.

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-toolsadb.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_MACHINESOFTWAREWow6432NodeAndroid 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.

Делаю простое приложение на 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.CalculateVe rsionCode(String currentAbi, String versionCodePattern, String versionCodeProperties)
в Xamarin.Android.Tasks.Aapt.GenerateCommandLineComm ands(String ManifestFile, String currentAbi, String currentResourceOutputFile)
в Xamarin.Android.Tasks.Aapt.DoExecute(ITaskItem manifestFile, ParallelLoopState state, Int32 loop)
в System.Threading.Tasks.Parallel.<>c__DisplayClass3 0_0`2.<ForEachWorker>b__3(Int32 i, ParallelLoopState state, TLocal local)
в System.Threading.Tasks.Parallel.<>c__DisplayClass1 7_0`1.<ForWorker>b__1()
в System.Threading.Tasks.Task.InnerInvoke()
в System.Threading.Tasks.Task.InnerInvokeWithArg(Tas k childTask)
в System.Threading.Tasks.Task.<>c__DisplayClass176_0 .<ExecuteSelfReplicating>b__0(Object )
— Конец трассировки внутреннего стека исключений —
в System.Threading.Tasks.Task.ThrowIfExceptional(Boo lean 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.Microsof t.Build.BackEnd.ITaskExecutionHost.Execute()
в Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstan tiatedTask>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.CalculateVe rsionCode(String currentAbi, String versionCodePattern, String versionCodeProperties)
в Xamarin.Android.Tasks.Aapt.GenerateCommandLineComm ands(String ManifestFile, String currentAbi, String currentResourceOutputFile)
в Xamarin.Android.Tasks.Aapt.DoExecute(ITaskItem manifestFile, ParallelLoopState state, Int32 loop)
в System.Threading.Tasks.Parallel.<>c__DisplayClass3 0_0`2.<ForEachWorker>b__3(Int32 i, ParallelLoopState state, TLocal local)
в System.Threading.Tasks.Parallel.<>c__DisplayClass1 7_0`1.<ForWorker>b__1()
в System.Threading.Tasks.Task.InnerInvoke()
в System.Threading.Tasks.Task.InnerInvokeWithArg(Tas k childTask)
в System.Threading.Tasks.Task.<>c__DisplayClass176_0 .<ExecuteSelfReplicating>b__0(Object )<— CrossApp.Android

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

Я пытаюсь создать пустое приложение Android с платформой Xamarin в Visual Studio 2015. Для этого я установил VS2015 с Xamarin и попытался создать приложение для Android. Однако, когда я пытаюсь запустить его, он выдает ошибку при развертывании, не показывая никаких сообщений об ошибке, даже если сборка прошла успешно. Я использую эмулятор (AVD) с 512 ОЗУ.

Я попытался очистить решение, перестроить и запустить его от имени администратора, но не смог отследить никаких ошибок. Я также искал подсказки на SO, но не нашел их.

Here is error message

3 ответа

Лучший ответ

Прежде всего: вы хотите развернуть его на реальном устройстве или в эмуляторе? Во-вторых: открыли ли вы журнал устройств Android (Logcat)?

В-третьих: я предполагаю, что вы хотите развернуть его на реальном устройстве и без ошибок в журналах.

Visual Studio 2015 демонстрирует очень «интересное» поведение при развертывании на моем тестовом устройстве nexus.

Развертывание работает только в том случае, если я сначала «очищаю» решение, а затем запускаю его. Если я сделаю чистую и / или перестроенную, а затем запустил ее, развертывание завершится неудачно :(.

Поэтому, пожалуйста, попробуйте очистить и запустить его после этого и посмотрите, успешно ли выполнено развертывание. Вот моя конфигурация AVD


3

c0dr
22 Фев 2016 в 10:11

Вам нужно открыть ADB и попытаться подключиться к вашему эмулятору с помощью ADB Connect (IP-адрес вашего эмулятора)


-1

buczek
9 Авг 2016 в 20:28

Попробуйте перезапустить эмулятор. У меня раньше была эта проблема с эмуляторами, и каждый раз перезапуск работал.


0

Jeroen Corteville
22 Фев 2016 в 10:02

I have recently installed Xamarin into my pre existing Visual Studio 2015 Community edition. I had installed my VS 2015 on Win 10 Home edition and after I upgraded to the Pro edition I installed Xamarin. The installation went without incident.

So I created a new Cross device solution in VS, it compiles [skips the IOS one bcos I’m on Windows] but it always fails to deploy.

In the logs I see the following errors:

  1. During VS IDE initialization

Metadata lookup failed
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly, ReferenceType refType)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at

  1. Whenever I try to deploy the solution

System.InvalidOperationException
at Xamarin.VisualStudio.Android.AndroidVirtualDeviceProvider.StartEmulator(IAndroidVirtualDevice virtualDevice, IProgressReport progress, CancellationToken cancellationToken) in C:Usersbuilderdatalanes342034a92cd0sourcexamarinvssrcCoreVisualStudio.AndroidDevicesAndroidVirtualDeviceProvider.cs:line 137
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.StartUp(IMonoAndroidDevice device, IProgressReport progress, IAndroidVirtualDeviceProvider virtualDeviceProvider, CancellationToken cancellationToken) in C:Usersbuilderdatalanes342034a92cd0sourcexamarinvssrcCoreVisualStudio.AndroidCommandHandlersStartupVirtualDeviceCommandHandler.cs:line 0
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.Execute(StartupVirtualDeviceCommand command, IProgressReport progress, CancellationToken cancellationToken) in C:Usersbuilderdatalanes342034a92cd0sourcexamarinvssrcCoreVisualStudio.AndroidCommandHandlersStartupVirtualDeviceCommandHandler.cs:line 45
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.Execute(TCommand command, CancellationToken cancellationToken) in C:Usersbuilderdatalanes342034a92cd0sourcexamarinvssrcCoreVisualStudioCommandsCommandHandlerBase.cs:line 125

Any and all help much appreciated.

I have recently installed Xamarin into my pre existing Visual Studio 2015 Community edition. I had installed my VS 2015 on Win 10 Home edition and after I upgraded to the Pro edition I installed Xamarin. The installation went without incident.

So I created a new Cross device solution in VS, it compiles [skips the IOS one bcos I’m on Windows] but it always fails to deploy.

In the logs I see the following errors:

  1. During VS IDE initialization

Metadata lookup failed
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly, ReferenceType refType)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at

  1. Whenever I try to deploy the solution

System.InvalidOperationException
at Xamarin.VisualStudio.Android.AndroidVirtualDeviceProvider.StartEmulator(IAndroidVirtualDevice virtualDevice, IProgressReport progress, CancellationToken cancellationToken) in C:Usersbuilderdatalanes342034a92cd0sourcexamarinvssrcCoreVisualStudio.AndroidDevicesAndroidVirtualDeviceProvider.cs:line 137
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.StartUp(IMonoAndroidDevice device, IProgressReport progress, IAndroidVirtualDeviceProvider virtualDeviceProvider, CancellationToken cancellationToken) in C:Usersbuilderdatalanes342034a92cd0sourcexamarinvssrcCoreVisualStudio.AndroidCommandHandlersStartupVirtualDeviceCommandHandler.cs:line 0
at Xamarin.VisualStudio.Android.CommandHandlers.StartupVirtualDeviceCommandHandler.Execute(StartupVirtualDeviceCommand command, IProgressReport progress, CancellationToken cancellationToken) in C:Usersbuilderdatalanes342034a92cd0sourcexamarinvssrcCoreVisualStudio.AndroidCommandHandlersStartupVirtualDeviceCommandHandler.cs:line 45
at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.Execute(TCommand command, CancellationToken cancellationToken) in C:Usersbuilderdatalanes342034a92cd0sourcexamarinvssrcCoreVisualStudioCommandsCommandHandlerBase.cs:line 125

Any and all help much appreciated.

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка при распаковке криптографического сообщения нарушено постановление правительства no 815
  • Ошибка при распаковке зип файла