我正在开发 Xamarin Android 中的 Sitecore Mobile SDK。我从https://components.xamarin.com/view/sitecore.mobile.sdk下载了示例项目。我根据我的要求修改了我的代码,更改了 instanceUrl 和凭据并执行了未显示输出的代码。我的应用程序输出显示:
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Sitecore.MobileSDK.API.Exceptions.RsaHandshakeException: [Sitecore Mobile SDK] Public key not received properly ---> System.Xml.XmlException: Document Type Declaration (DTD) is prohibited in this XML. Line 4, position 10.
[MonoDroid] at Mono.Xml2.XmlTextReader.ReadDoctypeDecl () [0x00000] in <filename unknown>:0
[MonoDroid] at Mono.Xml2.XmlTextReader.ReadDeclaration () [0x00000] in <filename unknown>:0
[MonoDroid] at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in <filename unknown>:0
[MonoDroid] at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0
[MonoDroid] at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0
[MonoDroid] at Sitecore.MobileSDK.PublicKey.PublicKeyXmlParser.Parse (System.IO.Stream xmlStream, CancellationToken cancelToken) [0x00000] in <filename unknown>:0
[MonoDroid] at Sitecore.MobileSDK.PublicKey.GetPublicKeyTasks+<>c__DisplayClass11.<ParseResponseDataAsync>b__d () [0x00000] in <filename unknown>:0
[MonoDroid] at System.Threading.Tasks.TaskActionInvoker+FuncInvoke`1[Sitecore.MobileSDK.PublicKeyX509Certificate].Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0
[MonoDroid] at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0
[MonoDroid] at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0
[MonoDroid] --- End of inner exception stack trace ---
[MonoDroid] at Sitecore.MobileSDK.ScApiSession+<GetPublicKeyAsync>d__0.MoveNext () [0x00000] in <filename unknown>:0
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
[MonoDroid] at System.Runtime.CompilerServices.TaskAwaiter`1[Sitecore.MobileSDK.API.Items.ScItemsResponse].GetResult () [0x00000] in <filename unknown>:0
[MonoDroid] at AndroidMobileSdkDemo.MainActivity+<OnCreate>d__2.MoveNext () [0x000d0] in c:\Users\Ashok v\Downloads\Sitecore.Mobile.SDK-1.0\samples\AndroidMobileSdkDemo\AndroidMobileSdkDemo\MainActivity.cs:44
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable