【问题标题】:Kinvey Xamarin iOSKinvey Xamarin iOS
【发布时间】:2015-09-02 08:33:30
【问题描述】:

我正在为 Xamarin android 和 iOS 使用 Kinvey db。 它适用于 Android。在 iOS 模拟器中它工作正常,但在设备中它不工作。它给了我错误 Unable to find a constructor to use for type KinveyXamarin.KinveyAuthResponse. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'username', line 1, position 12.

我正在尝试下面的代码

private Client myClient;
myClient = new Client.Builder ("kid_PeYFqjBcBJ","3fee066a01784e2ab32a255151ff761b").build ();
        await myClient.User ().LoginAsync ();

【问题讨论】:

  • 嘿,我是 Kinvey 的一名工程师,负责 Xamarin 库。我无法重现此问题,您使用的是哪个版本的 iOS?另外,您使用的是最新 (1.5.3) 版本的 xamarin 库吗?
  • 感谢您的回复。我在 IOS 设备中有最新版本 1.5.3 kinvey 包使用和 8.4 OS 版本。它在模拟器中运行良好。

标签: ios xamarin kinvey


【解决方案1】:

这可能是由链接器问题引起的。

你能不能在Solution窗口中右击你的项目,-> '选项' -> 在Build下,点击iOS Build

你应该看到Linker Behavior,你能把这个设置成Don't Link吗?

【讨论】:

  • 感谢您的回复。在我的问题解决后,我已设置Linker Behavior 选项Don't Link 。它工作正常。
  • 太棒了。链接器将在构建期间从您的项目中删除所有未使用的代码,并且不会直接调用 KinveyAuthResponse(和少数其他类)——它们由 JSON 反序列化器使用,不会被静态分析拾取。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多