【问题标题】:App will not deploy to Android, but will compile应用程序不会部署到 Android,但会编译
【发布时间】:2019-10-08 18:15:45
【问题描述】:

我想在业余时间了解有关 Xamarin 的更多信息。我在每个步骤和子步骤中都遇到问题。在此过程中,我将所有时间都用于解决模拟器和 SDK 的问题。没有时间进行开发。

我当前的问题是 Android 模拟器挂在“模拟器启动成功”。阶段,即启动模拟器,但未部署应用程序。这太令人沮丧了。为什么没有部署应用程序。到目前为止(我花了很多时间):

1) Reinstall VS 2017.
2) Reinstall Visual Studio Emulators for Android.

我花了很多时间在这上面。还有什么我可以尝试的吗?

【问题讨论】:

  • 为了性能和节省时间,你可以在真机上测试应用,看看How do I debug on a real android device using Xamarin for Visual Studio?Set Up Device for Development
  • 对于你的问题,也许Xamarin.Forms Visual Studio 2017 project does not deploy这个问题的答案会对你有所帮助
  • @Anas Alweish,我已经回答了我自己的问题。谢谢。
  • 在 Visual Studio 2019 > 工具 > Android > Android SDK Manager - 选择右下角的(齿轮?)图标将存储库从“Microsoft(推荐)”更改为“Google(不支持)”并重新安装(卸载 - 然后安装),例如平台 API 级别组件(Android SDK 平台版本和系统映像)。这可能会解决一些低于 8 的旧 Android API 级别的问题。对于最新的 (8/9),可能应该使用 Microsoft 存储库。目前对于 10,应该使用 Google 存储库。

标签: xamarin xamarin.android


【解决方案1】:

VS 2017 年代久远,用户一直面临一些问题。卸载 VS 2017 并改为安装 VS 2019。完成此操作后,万一您仍然面临问题,请将您的日志详细程度更改为诊断并分享错误消息。

有时VS创建的Android模拟器可能无法正常工作,在这种情况下尝试使用实际设备,或使用Android Studio创建模拟器(您必须为此安装Android Studio)

【讨论】:

  • 您可以通过工具 > 选项 > 项目和解决方案 > 构建和运行来更改日志的详细程度
【解决方案2】:

我通过执行以下操作设法克服了这个错误(从这里复制:Xamarin "Waiting for runtime checks to complete" and VS Emulator):

1) Build and Run the application 
2) The build will stall with at "Waiting for Runtime Checks" 
3) In the emulator click the ">>" arrows in the tool-bar to the right 
4) Make a note of the IP address for the Windows Phone Emulator Internal Switch 5)
5) Back in VS. From the menu select Tools->Android->Android ADB Command Prompt 
6) Type "adb connect [IP_FROM_STEP_#4]" 

构建继续。

【讨论】:

  • 能否请您标记您的答案,以便其他人可以从中获得帮助?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-08-17
  • 2015-06-01
  • 2017-11-27
  • 1970-01-01
  • 1970-01-01
  • 2019-07-13
  • 1970-01-01
相关资源
最近更新 更多