Xamarin在启动后在Android上形成应用程序崩溃(适用于首次安装)

时间:2017-07-22 19:36:22

标签: c# android multithreading xamarin httpwebrequest

Xamarin在启动后在Android上形成应用程序崩溃(适用于首次安装)。

我第一次启动时请求登录并保存凭据。在第二次启动时,我使用这些凭据,自动登录,然后启动主表单。如果我每次都更改我的代码以请求登录(App.cs创建一个表单而不是崩溃时我触发登录对象,当它返回时,我在应用程序的回调中在UI线程上创建下一个表单。 CS)

它在我的代码之外崩溃了。我不知道如何查看导致崩溃的原因(它不会将异常抛回我的C#代码)。

当我进行网络请求时,通常在我将cookie添加到标题

时失败

通常在第三行,有时在第四行失败

var cc = new CookieContainer();
Cookie myCookie = new Cookie("MyCookie", sessionToken);                  
cc.Add(webRequest.RequestUri, myCookie);
webRequest.CookieContainer = cc;

此代码对我的主表单进行回调,如果重要,则会在事件中触发。

我确实查看了Android日志,并没有看到任何明显的信息。我将在下面复制。

有什么想法吗?我不知道如何调试它。

失败时的日志代码

Android application is debugging.
This debug engine does not support exception conditions. The condition(s) will be ignored.

Android application is debugging.
This debug engine does not support exception conditions. The condition(s) will be ignored.
07-22 12:59:20.912 I/art     ( 3369): Not late-enabling -Xcheck:jni (already on)
07-22 12:59:20.913 W/art     ( 3369): Unexpected CPU variant for X86 using defaults: x86
07-22 12:59:21.015 W/monodroid( 3369): Creating public update directory: `/data/user/0/com.noregon.tripVision/files/.__override__`
07-22 12:59:21.015 W/monodroid( 3369): Using override path: /data/user/0/com.noregon.tripVision/files/.__override__
07-22 12:59:21.016 W/monodroid( 3369): Trying to load sgen from: /data/user/0/com.noregon.tripVision/files/.__override__/libmonosgen-2.0.so
07-22 12:59:21.016 W/monodroid( 3369): Trying to load sgen from: /storage/emulated/0/Android/data/com.noregon.tripVision/files/.__override__/libmonosgen-2.0.so
07-22 12:59:21.016 W/monodroid( 3369): Trying to load sgen from: /data/app/com.noregon.tripVision-1/lib/x86/libmonosgen-2.0.so
07-22 12:59:21.017 W/monodroid-debug( 3369): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8873,server=y,embedding=1
07-22 12:59:21.049 W/monodroid-debug( 3369): Accepted stdout connection: 34
07-22 12:59:21.868 D/Mono    ( 3369): Image addref mscorlib[0x9abdc000] -> mscorlib.dll[0xa620c300]: 2
07-22 12:59:21.868 D/Mono    ( 3369): Prepared to set up assembly 'mscorlib' (mscorlib.dll)
07-22 12:59:21.868 D/Mono    ( 3369): AOT: image 'mscorlib.dll.so' not found: dlopen failed: library "/data/app/com.noregon.tripVision-1/lib/x86/libaot-mscorlib.dll.so" not found
07-22 12:59:21.869 D/Mono    ( 3369): AOT: image '/usr/local/lib/mono/aot-cache/x86/mscorlib.dll.so' not found: dlopen failed: library "/data/app/com.noregon.tripVision-1/lib/x86/libaot-mscorlib.dll.so" not found
07-22 12:59:21.870 D/Mono    ( 3369): Config attempting to parse: 'mscorlib.dll.config'.

.........................................
07-22 12:59:46.085 D/Mono    ( 3369): Assembly Ref addref Xamarin.Forms.Platform[0x9abdd620] -> Xamarin.Forms.Core[0x9abdd560]: 5
07-22 12:59:48.683 D/Mono    ( 3369): Assembly Ref addref System.Collections[0x9abddec0] -> System.Core[0x9abde280]: 9
07-22 12:59:57.196 D/Mono    ( 3369): DllImport attempting to load: '__Internal'.
07-22 12:59:57.196 D/Mono    ( 3369): DllImport loaded library '(null)'.
07-22 12:59:57.196 D/Mono    ( 3369): DllImport searching in: '__Internal' ('(null)').
07-22 12:59:57.196 D/Mono    ( 3369): Searching for 'monodroid_get_system_property'.
07-22 12:59:57.196 D/Mono    ( 3369): Probing 'monodroid_get_system_property'.
07-22 12:59:57.196 D/Mono    ( 3369): Found as 'monodroid_get_system_property'.
07-22 12:59:57.197 D/Mono    ( 3369): DllImport searching in: '__Internal' ('(null)').
07-22 12:59:57.197 D/Mono    ( 3369): Searching for 'monodroid_free'.
07-22 12:59:57.197 D/Mono    ( 3369): Probing 'monodroid_free'.
07-22 12:59:57.197 D/Mono    ( 3369): Found as 'monodroid_free'.
07-22 12:59:57.204 W/gralloc_ranchu( 3369): Gralloc pipe failed
07-22 12:59:57.205 D/        ( 3369): HostConnection::get() New Host Connection established 0x885dbc80, tid 3369
07-22 12:59:57.224 D/Mono    ( 3369): DllImport searching in: '__Internal' ('(null)').
07-22 12:59:57.224 D/Mono    ( 3369): Searching for 'java_interop_jnienv_call_static_int_method_a'.
07-22 12:59:57.224 D/Mono    ( 3369): Probing 'java_interop_jnienv_call_static_int_method_a'.
07-22 12:59:57.224 D/Mono    ( 3369): Found as 'java_interop_jnienv_call_static_int_method_a'.
07-22 12:59:57.244 D/        ( 3369): HostConnection::get() New Host Connection established 0x885dbf40, tid 3402
07-22 12:59:57.260 I/OpenGLRenderer( 3369): Initialized EGL, version 1.4
07-22 12:59:57.260 D/OpenGLRenderer( 3369): Swap behavior 1
Thread finished: <Thread Pool> #7
07-22 13:00:16.843 D/Mono    ( 3369): [0x8627f920] worker finishing
The thread 'Unknown' (0x7) has exited with code 0 (0x0).
Thread finished: <Thread Pool> #6
07-22 13:00:20.503 D/Mono    ( 3369): [0x8647d920] worker finishing
The thread 'Unknown' (0x6) has exited with code 0 (0x0).

0 个答案:

没有答案