- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
在 Xamarin.Forms 解决方案的 Android 项目中的 MainActivity.cs 中出现以下错误:CurrentPlatform 由于其保护级别而无法访问
来自 OnCreate() 内部的以下代码行,仅 CurrentPlaftorm 部分加下划线:Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
直到我将 MonoAndroid 从 v6.0 升级到 v7.0 并进行了所有必要的更新(例如 JDK 1.8)后,我才收到此错误。想知道是否有人可以解释这个错误的含义以及为什么专门针对 CurrentPlatform 调用它。
我尝试在新项目中重新创建此错误,但一旦输入 Microsoft.WindowsAzure.MobileServices。
,它就可以毫无问题地使用 CurrentPlatform 选项。
现在,使用 MobileServiceClient
类型从 WindowsAzure 组件调用 LoginAsync() 的一行会在参数上引发两个错误,而这些错误曾经是:
等待 client.LoginAsync(context, "facebook");
但是我现在收到以下两个错误:参数 1:无法从“Android.Content.Context”转换为“Microsoft.WindowsAzure.MobileServices.MobileServiceAuthenticationProvider”
参数 2:无法从“string”转换为“Newtonsoft.Json.Linq.JObject”
不知道为什么当我更改 Android Target SDK 时这两个区域的代码会损坏,因为它们只是 Microsoft.WindowsAzure 组件的一部分。
最佳答案
Not sure why these two areas of code broke when I changed my Android Target SDK as they were just part of the Microsoft.WindowsAzure components.
根据您的描述,我推测是Azure Mobile Client SDK版本的问题。你引用了。
对于 Azure Mobile Client SDK 3.1.0 ,您的客户端将从以下路径引用该库:
Microsoft.Azure.Mobile.Client.3.1.0\lib\monoandroid\Microsoft.WindowsAzure.Mobile.Ext.dll
您可以利用ILSpy检查 LoginAsync
的扩展方法,如下所示:
而对于Azure Mobile Client SDK 4.0.0-alpha-001 ,如果您的 MonoAndroid >= 4.4,则该库将在以下位置引用:
Microsoft.Azure.Mobile.Client.4.0.0-alpha-001\lib\monoandroid44\Microsoft.Azure.Mobile.Client.dll
对于 Azure Mobile Client SDK 4.0.0 ,如果您的 MonoAndroid >= 7.1,则该库将在以下位置引用:
Microsoft.Azure.Mobile.Client\4.0.0\lib\monoandroid71\Microsoft.Azure.Mobile.Client.dll
我之前的项目目标是 Android 6.0,那么该库将仅引用 Microsoft.Azure.Mobile.Client.4.0.0\lib\netstandard1.4\Microsoft.Azure.Mobile.Client.dll
,并且没有通过服务器流身份验证的 LoginAsync
扩展方法。
总之,从您的代码 await client.LoginAsync(context, "facebook");
来看,您正在使用 Server-managed authentication ,我建议您可以使用 Azure 移动客户端 SDK 3.1.0 而不升级 Android SDK 版本,或者使用最新的 Azure 移动客户端 SDK 4.0.0 并将 Android SDK 版本升级到 7.1 或更高版本。
此外,代码 client.LoginAsync(MobileServiceAuthenticationProvider.Facebook,{JObject token})
使用 Client-managed authentication ,此时,您的应用程序可以独立联系身份提供商,然后在登录 Azure 移动后端时提供返回的 token 。
关于c# - 目标 sdk 更改后 Xamarin.Android 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44770437/
我创建了一个基于命令行可移植脚本的工业化不可知构建系统,可用于快速构建多个依赖项目,而不必依赖特定的 IDE 或构建工厂。它是不可知的,因为它不是基于单个构建引擎。我使用 cmake 创建了第一个版本
我最初使用 Java 目标开发了一个语法(用于 TestRig 支持),然后将其移植到 Python(从 git hub 语法存储库扩展了 Python3 语法,因此需要将操作移植到 Python
我有一个以 iPhone 和 watchOS 为目标的 Xcode 项目。 iPhone 目标使用加速度计,模拟器不支持。我可以只启动 iPhone 应用程序而不启动 watch 目标吗?我从: Ca
您好,我想创建一个批处理文件,用于在 .eml 文件(目标 A)中查找某些关键字,然后删除它们所在的行。之后,我需要批处理文件将"new"文件放入(目标 B)中的单独 .eml 文件中。文件也可以是
当尝试通过 IntelliJ 运行示例 CorDapp (GitHub CorDapp) 时,我收到以下错误: Cannot inline bytecode built with JVM target
我在尝试向我的 kotlin spring 项目添加一些依赖项时遇到问题。我使用 spring boot 初始化程序来运行一个基本项目。 我的问题:如果我取消对 jackson 或 Koin 依赖项的
这是有问题的网站: http://www.onepixelroom.com/londonrefurb 当我点击关于部分后面的多个圆圈时,我希望它更改上面文本中的引号。 到目前为止,我得到它来显示 文本
单击后,我将删除两个元素 $(this) 和 $("#foo")。 目前我的代码如下所示: $(this).remove(); $("#foo").remove(); 如何在不重复自己的情况下优化它?
我有一个小脚本,可将 Markdown 文件编译为 html,并将其与一些样式表和 javascript 一起插入到模板的主体中。我有一个 GNU makefile 来完成这个: output.htm
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
一些背景知识: 在android中我们开发了同样的应用,基本上我们先开发了Android应用,现在我们创建了它的IOS版本,所以这个应用有多个客户端。在 android 中,我们实际上是使用 Andr
我想知道是否可以使用 knockout 来更改html中的目标() 我的所有其他信息都在 JavaScript 中,所以这对我来说是一个大问题。这是我的 JavaScript: var library
这个问题在这里已经有了答案: Selecting and manipulating CSS pseudo-elements such as ::before and ::after using j
我在我的有向图中添加了一堆节点和顶点,使用设置 typedef boost::adjacency_list graph; 创建 Node有一个节点名称字符串,Edge它的分数有一个整数。我试图遍历所有
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 8 年前。 Improve
如何存储我在 NSUserDefaults 中创建的 Goal 类型的对象数组? ( swift ) 代码如下: func saveGoalList ( newGoalList : [Goal] ){
Array.prototype.indexOf 和 Date.now 已在 ES5 中引入。如果我编译存储在文件 test.ts 中的以下代码,为什么 Typescript 不能转译? Date.no
我正在阅读有关属性的内容,并了解到可以使用您的代码将它们应用于不同的目标实体 -(请参阅 Attribute Targets)。 因此,查看我项目中的 AssemblyInfo.cs 文件,我可以看到
给定一个 Makefile: all: build/a build/b build/c # need to change this to all: build/* build/a:
我有一个带有多框架目标的项目- netstandard2.0;net471 . 我想为 netframework 构建解决方案和 netstandard分别。 目前我使用这个 MSBuild 命令:
我是一名优秀的程序员,十分优秀!