简体   繁体   English

azure 移动服务无法在 xamarin.android 上运行

[英]azure mobile service not working on xamarin.android

I'm trying to implement Azure Mobile Services in my Xamarin.Forms app.我正在尝试在我的 Xamarin.Forms 应用程序中实现 Azure 移动服务。

I'm following this link and it works on iOS but not on Android.我正在关注链接,它适用于 iOS,但不适用于 Android。 It throws this exception:它抛出这个异常:

MobileServiceInvalidOperationException - "The server did not provide a response with the expected content." MobileServiceInvalidOperationException - “服务器未提供包含预期内容的响应。”

I have tried switching between HTTP and HTTPS but could not get it working.我尝试在 HTTP 和 HTTPS 之间切换,但无法正常工作。 It works on Android (native) as well, just not on Xamarin.Android它也适用于 Android(本机),但不适用于 Xamarin.Android

Any help?有什么帮助吗?

Your issue is tracked here , and seems to be because of the following:您的问题在此处被跟踪,似乎是由于以下原因:

we don't support.Net Core 2.1 in the SDK today.我们今天不支持 SDK 中的 .Net Core 2.1。 Unfortunately, we don't have a workaround today and like Ela said, the we don't have an ETA for a new release or other SDK to use for.Net Core 2.1 compatibility yet, so your only workaround is to stick with.Net Core 2.0 for now.不幸的是,我们今天没有解决方法,就像 Ela 说的那样,我们没有新版本的 ETA 或其他 SDK 用于.Net Core 2.1 兼容性,所以你唯一的解决方法是坚持使用.Net现在是核心 2.0。

There seems to be a temporary work around here , by brendanzagaeski to in the call to new MobileServiceClient(): 这里似乎有一个临时工作,由 brendanzagaeski 在对 new MobileServiceClient() 的调用中进行:

  • Either pass in an HttpClientHandler instance传入一个 HttpClientHandler 实例
  • Or pass in an instance of AndroidClientHandler或者传入一个 AndroidClientHandler 的实例

It seems like AndroidClientHandler is the one that works the most often.似乎 AndroidClientHandler 是最常用的一个。

Check if "microsoft.azure.mobile.client" is referenced on your project.检查您的项目中是否引用了“microsoft.azure.mobile.client”。 If not, try installing a lower version of the "microsoft.azure.mobile.client" through nuget package on your project add the using directive and then update the "microsoft.azure.mobile.client" through nuget package. If not, try installing a lower version of the "microsoft.azure.mobile.client" through nuget package on your project add the using directive and then update the "microsoft.azure.mobile.client" through nuget package. And update any pending package.并更新任何未决的 package。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM