2016-12-24 74 views
0

因此,我在Android应用程序上使用Xamarin的Parse SDK,当我尝试登录时,它在控制台中显示错误,并且没有任何反应。这是错误的样子:在登录时解析Xamarin错误

System.ArgumentNullException: Value cannot be null. 
Parameter name: uriString 
    at System.Uri..ctor (System.String uriString) [0x0000c] in /Users/builder/data/lanes/4009/0a4ab557/source/mono/mcs/class/referencesource/System/net/System/URI.cs:406 
    at Parse.Internal.ParseCommand..ctor (System.String relativeUri, System.String method, System.String sessionToken, System.Collections.Generic.IList`1[T] headers, System.IO.Stream stream, System.String contentType) [0x00014] in <5d1c0c2b96a7483d85e5c63b3e156125>:0 
    at Parse.Internal.ParseCommand..ctor (System.String relativeUri, System.String method, System.String sessionToken, System.Collections.Generic.IList`1[T] headers, System.Collections.Generic.IDictionary`2[TKey,TValue] data) [0x00000] in <5d1c0c2b96a7483d85e5c63b3e156125>:0 
    at Parse.Internal.ParseUserController.LogInAsync (System.String username, System.String password, System.Threading.CancellationToken cancellationToken) [0x00030] in <5d1c0c2b96a7483d85e5c63b3e156125>:0 
    at Parse.ParseUser.LogInAsync (System.String username, System.String password, System.Threading.CancellationToken cancellationToken) [0x00005] in <5d1c0c2b96a7483d85e5c63b3e156125>:0 
    at Parse.ParseUser.LogInAsync (System.String username, System.String password) [0x00007] in <5d1c0c2b96a7483d85e5c63b3e156125>:0 
    at ViroMusicApp.MainActivity+<logIn>c__async0.MoveNext() [0x00034] in /Users/ctabuyo/Desktop/Viro App/Android Project/ViroMusicApp/ViroMusicApp/Controller/MainActivity.cs:44 

这是我的登陆方法:

private async void logIn(string Username, string Password) 
     { 
      try 
      { 
       await ParseUser.LogInAsync(username: Username, password: Password); 
      } 
      catch (Exception e) 
      { 
       Console.WriteLine(e); 
      } 


     } 

我使用Visual Studio for Mac可以预览

谢谢!

+0

你必须现在推出你自己的分析服务器后端。官方服务器已关闭。 http://blog.parse.com/announcements/moving-on/ –

回答

2

它接缝,你没有正确设置服务器的URL。 确保在调用login()方法之前执行该操作。

var config = new ParseClient.Configuration 
{ 
    ApplicationId = "xxxx", 
    Server = "http://xxxxxx" 
}; 

ParseClient.Initialize(config);