我正在使用Xamarin处理Android应用程序并收到以下异常。
Xamarin caused by: android.runtime.JavaProxyThrowable: System.ArgumentException: Handle must be valid.
Parameter name: instance
at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0000d] in <1bc3ec2e392f4f1a8cde1c9a163d2a4a>:0
at Android.Runtime.JNIEnv.CallVoidMethod (System.IntPtr jobject, System.IntPtr jmethod, Android.Runtime.JValue* parms) [0x0000e] in <0ce7e7a03dfb4c4b87eaf38b0e480d65>:0
at Android.Support.V4.Widget.SwipeRefreshLayout.set_Refreshing (System.Boolean value) [0x00060] in <27c17fe440cf491ba8255bcefade6e02>:0
at Xamarin.Forms.Platform.Android.ListViewRenderer.<UpdateIsRefreshing>b__25_0 () [0x00000] in <a3e44144fef249b0888b761605dfca24>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in <0ce7e7a03dfb4c4b87eaf38b0e480d65>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <0ce7e7a03dfb4c4b87eaf38b0e480d65>:0
at (wrapper dynamic-method) System.Object:ffc21647-8320-4065-b329-c8e7939eb92d (intptr,intptr)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
我尝试使用该属性添加txt文件environment.txt,将GC设置为旧。但是那没用。 还有哪些其他问题可能导致此例外?