Catch runtime error inside MAUI application on Android mobile (not emulator)

Wheelstring 150 Reputation points
2024-12-09T14:27:04.7566667+00:00

Hello all

I have a tested MAUI application and run perfect in Android emulator (all functions)

When I deploy application to the store (AAB) and download it to the mobile for internal testing, firstly run OK but when I tap on the screen app crash.

Do you have any idea how to catch en error, and how can I test application?

PS: I "gues" an error occure in MAUI component not webview's JavaScript (touch events /DOWN/UP/MOVE/ are bubble from JavaScript to MAUI)

Generate Javascript more than one down(touch) event for one tap?

thanks for direct me and any help

W

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,768 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 46,281 Reputation points Microsoft Vendor
    2024-12-10T02:45:47.2966667+00:00

    Hello,

    Do you have any idea how to catch en error, and how can I test application?

    When an Android application crashes on a device, it will leave a log file locally. For issues such as program crashes and flashbacks on physical devices, you can view local crash logs using the logcat command of the Adb tool provided by Google.

    Please refer to the following document:

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Wheelstring 150 Reputation points
    2024-12-27T09:28:18.8933333+00:00

    Hallo all

    I found problem and solution (problem with culture info)

    1. I made MAUI windows version of app (off Android app)
    2. MAUI windows app version revealed me conversion bug (culture problem) from Javascript string to MAUI double
    3. Bug: System.FormatException: 'The input string '0.2265625' was not in a correct format.'
    4. This
    double.Parse(data[0].Replace(",", "."))
    
    

    I replaced with this:

    double.Parse(data[0].Replace(",", "."), CultureInfo.InvariantCulture);
    
    
    1. Both versions Android and Windows are correct now

    Thanks you Alec, logcat util I didn't use, but it is interesting idea for next time

    best regards

    W

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.