镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Improve JavaProxyThrowable integration #1198

Closed

Description

@jonpryor

Note: This should be done in the Java.Interop repo, and then we should ditch Android.Runtime.JavaProxyThrowable in favor of Java.Interop.JavaProxyThrowable.

Related: Issue #1188.

It appears that JavaProxyThrowable doesn't integrate well with Java: if Java code calls Throwable.printStackTrace(), it might not also print -- or might truncate -- the output of Throwable.getMessage(), and Throwable.getMessage() is where JavaProxyThrowable squirrels away the "originating" System.Exception stack trace.

We should update JavaProxyThrowable so that it uses Throwable.setStackTrace() to merge or replace the System.Exception stack frames in with the Throwable stack frames.

I believe that this will in turn improve integration with e.g. HockeyApp and other apps which utilize Throwable.printStackTrace().

Activity

  1. added this to the d15-8 milestone on Jan 17, 2018
  2. modified the milestones: d15-8, d15-9 on Apr 30, 2018
  3. modified the milestones: d15-9, d16-1 on Dec 15, 2018
  4. knocte commented on Feb 20, 2022

    @knocte
    Contributor

    No plans to get this worked on? :( I get from time to time crashes that are only seen in GooglePlayConsole which cannot be captured by AppDomain.CurrentDomain.UnhandledException event. Here's an example:

    android.runtime.JavaProxyThrowable
    android.runtime.JavaProxyThrowable: at Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0006e] in <52f10d87dbbb4d09a29042ac70363317>:0
    at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <52f10d87dbbb4d09a29042ac70363317>:0
    at AndroidX.AppCompat.App.AlertDialog+Builder.Create () [0x0000a] in <6d3c6b73981a41788429b90c0b0983c0>:0
    at Xamarin.Forms.Platform.Android.PopupManager+PopupRequestHelper+DialogBuilder.Create () [0x00008] in <04c545f414d24a37af95d995791bb9a9>:0
    at Xamarin.Forms.Platform.Android.PopupManager+PopupRequestHelper.OnAlertRequested (Xamarin.Forms.Page sender, Xamarin.Forms.Internals.AlertArguments arguments) [0x00028] in <04c545f414d24a37af95d995791bb9a9>:0
    at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
    at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <5229225a94454bc59c40710c26e93043>:0
    at Microsoft.FSharp.Control.AsyncPrimitives+Start@907-1.Invoke (System.Runtime.ExceptionServices.ExceptionDispatchInfo edi) [0x00000] in <f1f01bf047f43136b90da0590c91572c>
    at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x0009c] in <f1f01bf047f43136b90da0590c91572c>:0
    at Microsoft.FSharp.Control.TrampolineHolder.ExecuteWithTrampoline (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00031] in <f1f01bf047f43136b90da0590c91572c>:0
    at <StartupCode$FSharp-Core>.$Async+-ctor@163-1.Invoke (System.Object o) [0x00017] in <f1f01bf047f43136b90da0590c91572c>:0
    at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00007] in <5229225a94454bc59c40710c26e93043>:0
    at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <5229225a94454bc59c40710c26e93043>:0
    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <5229225a94454bc59c40710c26e93043>:0
    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <5229225a94454bc59c40710c26e93043>:0
    at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <5229225a94454bc59c40710c26e93043>:0
    at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <5229225a94454bc59c40710c26e93043>:0
      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:938)
      at android.os.Handler.dispatchMessage (Handler.java:99)
      at android.os.Looper.loopOnce (Looper.java:201)
      at android.os.Looper.loop (Looper.java:288)
      at android.app.ActivityThread.main (ActivityThread.java:7839)
      at java.lang.reflect.Method.invoke (Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
      at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003)
    
  5. self-assigned this
    on Jul 12, 2023
  6. added
    Area: Mono.AndroidIssues with the Android API binding (Mono.Android.dll).
    and removed on Jul 12, 2023
  7. locked and limited conversation to collaborators on Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: Mono.AndroidIssues with the Android API binding (Mono.Android.dll).

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions