- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
Android 上的 Xamarin 有随机 System.ArgumentException
。它是完全随机的——它可以随时随地在任何平台上发生。我们在 5.1、5.0、4.4.4 上注册了它。
它没有足够的堆栈跟踪,它没有抛出的地方,我无法用任何东西捕捉到它。我认为它可能与 async void
有某种关系,我们在项目中使用 MVVMCross 并且有许多 async void Init
和 async void DoMvxCommand
方法.但它们都包含在 try-catch block 中。
我非常需要有关如何修复或至少找到崩溃原因的任何建议。这是最新的崩溃日志
undefined INFO: ActivityManager : Displayed com.website.app/md599d9a15f782f9118e8e70c354562b227.SuccessPaymentView: +220ms
undefined WARN: ContextImpl : Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1629 com.android.server.InputMethodManagerService$6.run:2728 java.lang.Thread.run:818 <bottom of call stack> <bottom of call stack>
undefined WARN: ActivityManager : mDVFSHelper.release()
undefined INFO: Timeline : Timeline: Activity_windows_visible id: ActivityRecord{1aca0d50 u0 com.website.app/md599d9a15f782f9118e8e70c354562b227.SuccessPaymentView t5672} time:169720248
undefined INFO: MonoDroid : UNHANDLED EXCEPTION:
undefined INFO: MonoDroid : System.ArgumentException: 'jobject' must not be IntPtr.Zero.
undefined INFO: MonoDroid : Parameter name: jobject
undefined INFO: MonoDroid : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
undefined INFO: MonoDroid : at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
undefined INFO: MonoDroid : at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
undefined INFO: MonoDroid : at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
undefined INFO: MonoDroid : at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>
undefined INFO: MonoDroid : at (wrapper dynamic-method) object.81971695-c4eb-4dd7-9e27-0dec45822877 (intptr,intptr) <0x0003b>
undefined DEBUG: LockPatternUtilsCache : getCarrierLockPlusMode()
undefined DEBUG: LockPatternUtilsCache : value : false
undefined WARN: Xamarin.Insights : Warning: Unhandled exception: System.ArgumentException: 'jobject' must not be IntPtr.Zero.
undefined WARN: Xamarin.Insights : Parameter name: jobject
undefined WARN: Xamarin.Insights : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
undefined WARN: Xamarin.Insights : at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
undefined WARN: Xamarin.Insights : at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
undefined WARN: Xamarin.Insights : at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
undefined WARN: Xamarin.Insights : at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>
undefined WARN: Xamarin.Insights : at (wrapper dynamic-method) object.81971695-c4eb-4dd7-9e27-0dec45822877 (intptr,intptr) <0x0003b>
undefined WARN: art : JNI RegisterNativeMethods: attempt to register 0 native methods for md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable
undefined DEBUG: AndroidRuntime : Shutting down VM
undefined WARN: System.err : java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
undefined WARN: System.err : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
undefined WARN: System.err : Caused by: java.lang.reflect.InvocationTargetException
undefined WARN: System.err : at java.lang.reflect.Method.invoke(Native Method)
undefined WARN: System.err : at java.lang.reflect.Method.invoke(Method.java:372)
undefined WARN: System.err : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
undefined WARN: System.err : ... 1 more
undefined WARN: System.err : Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.ArgumentException: 'jobject' must not be IntPtr.Zero.
undefined WARN: System.err : Parameter name: jobject
undefined WARN: System.err : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
undefined WARN: System.err : at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
undefined WARN: System.err : at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
undefined WARN: System.err : at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
undefined WARN: System.err : at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>
undefined WARN: System.err : at (wrapper dynamic-method) object.81971695-c4eb-4dd7-9e27-0dec45822877 (intptr,intptr) <0x0003b>
undefined WARN: System.err : at mono.java.lang.RunnableImplementor.n_run(Native Method)
undefined WARN: System.err : at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
undefined WARN: System.err : at android.os.Handler.handleCallback(Handler.java:739)
undefined WARN: System.err : at android.os.Handler.dispatchMessage(Handler.java:95)
undefined WARN: System.err : at android.os.Looper.loop(Looper.java:145)
undefined WARN: System.err : at android.app.ActivityThread.main(ActivityThread.java:5832)
undefined WARN: System.err : ... 4 more
undefined WARN: FlurryAgent : Error logged: uncaught
undefined WARN: FlurryAgent : Flurry session ended
undefined ERROR: AndroidRuntime : FATAL EXCEPTION: main
undefined ERROR: AndroidRuntime : Process: com.website.app, PID: 27622
undefined ERROR: AndroidRuntime : java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
undefined ERROR: AndroidRuntime : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
undefined ERROR: AndroidRuntime : Caused by: java.lang.reflect.InvocationTargetException
undefined ERROR: AndroidRuntime : at java.lang.reflect.Method.invoke(Native Method)
undefined ERROR: AndroidRuntime : at java.lang.reflect.Method.invoke(Method.java:372)
undefined ERROR: AndroidRuntime : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
undefined ERROR: AndroidRuntime : ... 1 more
undefined ERROR: AndroidRuntime : Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.ArgumentException: 'jobject' must not be IntPtr.Zero.
undefined ERROR: AndroidRuntime : Parameter name: jobject
undefined ERROR: AndroidRuntime : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
undefined ERROR: AndroidRuntime : at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
undefined ERROR: AndroidRuntime : at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
undefined ERROR: AndroidRuntime : at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
undefined ERROR: AndroidRuntime : at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>
undefined ERROR: AndroidRuntime : at (wrapper dynamic-method) object.81971695-c4eb-4dd7-9e27-0dec45822877 (intptr,intptr) <0x0003b>
undefined ERROR: AndroidRuntime : at mono.java.lang.RunnableImplementor.n_run(Native Method)
undefined ERROR: AndroidRuntime : at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
undefined ERROR: AndroidRuntime : at android.os.Handler.handleCallback(Handler.java:739)
undefined ERROR: AndroidRuntime : at android.os.Handler.dispatchMessage(Handler.java:95)
undefined ERROR: AndroidRuntime : at android.os.Looper.loop(Looper.java:145)
undefined ERROR: AndroidRuntime : at android.app.ActivityThread.main(ActivityThread.java:5832)
undefined ERROR: AndroidRuntime : ... 4 more
undefined WARN: ActivityManager : Force finishing activity com.website.app/md599d9a15f782f9118e8e70c354562b227.SuccessPaymentView
undefined DEBUG: PowerManagerService : [input device light] setInputDeviceLightOn is called : 1
undefined WARN: ActivityManager : Force finishing activity com.website.app/md599d9a15f782f9118e8e70c354562b227.PaymentFormView
undefined INFO: SQLiteSecureOpenHelper : getWritableDatabase(pwd)
undefined INFO: SQLiteSecureOpenHelper : getDatabaseLocked(b,b,pwd)...
undefined INFO: dumpstate : begin
undefined DEBUG: StatusBarManagerService : manageDisableList userId=0 what=0x0 pkg=WindowManager.LayoutParams
undefined INFO: SurfaceFlinger : id=3018 createSurf (49x49),1 flag=4, Application Error: com.website.app
undefined DEBUG: CrashAnrDetector : processName: com.website.app
undefined DEBUG: CrashAnrDetector : broadcastEvent : com.website.app data_app_crash
undefined INFO: SQLiteSecureOpenHelper : getWritableDatabase(pwd)
undefined INFO: SQLiteSecureOpenHelper : getDatabaseLocked(b,b,pwd)...
undefined WARN: ContextImpl : Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1643 com.android.server.analytics.data.collection.application.CrashAnrDetector.broadcastEvent:296 com.android.server.analytics.data.collection.application.CrashAnrDetector.processDropBoxEntry:254 com.android.server.analytics.data.collection.application.CrashAnrDetector.access$100:60 com.android.server.analytics.data.collection.application.CrashAnrDetector$1.onReceive:102
undefined INFO: WifiStateMachine : CMD_RSSI_POLL : calculateWifiScore in!
undefined INFO: WifiStateMachine : CMD_RSSI_POLL : calculateWifiScore out!
undefined INFO: WifiStateMachine : CMD_RSSI_POLL : out!
undefined ERROR: android.os.Debug : !@Dumpstate > sdumpstate -k -t -z -d -o /data/log/dumpstate_app_error
最佳答案
Android 抛出 NullRefenceException
时我遇到了非常相似的问题它看起来是随机的(这实际上是因为事情是异步/并发运行的)并且它们永远不会在正确的位置中断并且 StackTrace 完全没有值(value)。查看线程和解决方案 here .
无论如何,让我弄清楚问题的解决方案的两个部分是:
Ctrl
+ Alt
+ E
)然后,要查找该异常,请展开“公共(public)语言运行时异常”->“系统”-> 然后选中“System.ArgumentException”旁边的“抛出”框。现在,它有望在异常实际发生的那条线上中断。此外,一旦问题得到解决,您肯定会希望将其关闭,这样您就不会开始遇到您并不真正需要处理的异常。
UnhandledExceptionRaiser
,然后在事件中设置断点,以帮助您在应用程序崩溃之前捕获其中的一些异常。 Activity 信息可在 this post 中找到(我最后只是将该事件放入 MainActivity.cs
中。这是我的异常事件代码:
AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) => {
args.Handled = false;
};
我只是在 args.Handled
上设置了一个断点并查看详细信息,但您也可以打印出异常或其他内容。
captured_traces
来找到更有用的异常源信息。 .要找到它,您需要不断扩展异常实例的 base
属性,在异常详细信息窗口中,直到您进入 System.Exception
.然后执行以下步骤(尽管有时您必须在执行以下步骤之前进入内部异常):
System.Exception
-> Non-public members
-> captured_traces
-> 那么你通常需要 [0]
但有时还有其他人需要查看 -> Non-public members
-> frames
-> 现在你通常要么想要 [0]
或者你想要列表中的最后一个 -> Non-public members
-> 最后您将能够在 fileName
中看到该文件属性和“lineNumber”属性中的行号(想象一下)。
现在我确定有一种奇特的方法可以通过反射或其他方式提取此信息,而无需深入了解异常细节。如果有人知道怎么做,我很想听听!
关于android - 随机 System.ArgumentException : 'jobject' must not be IntPtr. 零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32654645/
我有一个存储过程,我正在尝试使用 Dapper 执行该过程,该过程引发了一个错误,该错误似乎与我正在尝试做的事情无关,尽管我似乎无法弄清楚我在做什么错误的。 这是我试图调用的存储过程的签名: ALTE
我想匹配浏览器游戏中的坐标。我的正则表达式是: try { Regex r = new Regex("Mond ([1-9]) \x5B([1-
任何人都可以向我解释为什么我从这段代码中收到 ArgumentException 吗?它告诉我 Task.WhenAll 函数中的 tasks 参数包含空值。但是,它只是在我运行它时偶尔发生一次。 s
我正在尝试为 Eddystone 信标做广告,但我的代码在 advertisementData.Data 处失败并出现 ArgumentException: Value does not fall w
我已经编写了一些代码来从我的 Blogger 博客中导入内容。下载完所有 HTML 内容后,我将浏览图像标签并下载相应的图像。在大量情况下,System.Drawing.Bitmap.FromStre
我正在尝试更加熟悉表达式树。 我创建了一个简单的 switch 表达式,如下所示: var paramExp = Expression.Parameter(typeof(int)); Expressi
我正在尝试使用任务并行库逐个单元地构建矩阵。 我有以下代码可以执行此操作: List campaigns = GetHomeCampaigns(); Dictionary sellers = GetH
我试图通过添加三个参数来调用存储过程,但在添加第二个参数时出现以下 ArgumentException The SqlParameter is already contained by another
因为 CultureInfo 没有从一个线程复制到另一个线程,所以我使用了以下方法来为我做这件事。 public static StartCustomTask(Action action, TaskC
在我的代码中,我怎样才能显示弹出的警告框?我试图重播抛出新的参数异常并添加 Response.Write("alert('NOT Successful');");但它表明我在附近有语法错误”)”。如果
我有一个通过串行端口连接到设备的实用程序。为了测试这个应用程序,我正在为该设备编写一个模拟器。 这两个应用程序旨在在同一台 Windows 7 机器上运行。 我正在用 C# 编写模拟器。我使用 com
据我所知,ArgumentExceptions 通常是这样使用的: public void UpdateUser(User user) { if (user == null) throw ne
我有一个采用三个参数(3D 点)的方法。如果这些点是共线的,我想抛出一个异常。对我来说明显的异常(exception)是 ArgumentException,但最好的做法是在构造函数中包含参数名称。在
我正在使用 Path.Combine , 并且其中一个字符串包含 Unicode 字符。我收到 {System.ArgumentException} exception; illegal charac
当我尝试合并两个字典时,我不知道如何将键和值保留在字典中。由于 key 重复,我不断收到 ArgumentException。当键匹配时,我只想通过 =+ kvp.value; 添加值 我有一个字典列
当构造一个 ArgumentException 时,一些重载采用一个字符串作为无效参数的参数名称。我认为每当我更改方法的参数名称时不必记住更新此 ctor 参数会很好。有没有一种简单的方法可以使用反射
当我尝试合并两个字典时,我不知道如何将键和值保留在字典中。由于 key 重复,我不断收到 ArgumentException。当键匹配时,我只想通过 =+ kvp.value; 添加值 我有一个字典列
我想使用XamarinUITest在Xamarin上测试IOS应用程序。 不幸的是,我无法在本地设备上启动任何东西。 我已成功在Android上进行测试,但IOS似乎是一个全新的谜。 其实我有一个错误
我们的 SonarQube 经常在我们的代码中提出以下问题(代码异味):“用于 ArgumentException 的参数名称应与现有参数名称匹配”。 Here是触发此问题的规则。 触发此问题的示例如
在安装 WebActivatorEx nuget 包后尝试访问页面时,我不断收到以下 ArgumentException。 Server Error in '/PharmaDotnet/ux' App
我是一名优秀的程序员,十分优秀!