Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8175893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:56:20+00:00 2026-06-06T22:56:20+00:00

Some clients experience an app crash directly when they launch it. Here’s the code

  • 0

Some clients experience an app crash directly when they launch it.

Here’s the code of the onCreate() method in the main activity :

public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    String deviceId = Local.getUniqueID(this);

    Thread.setDefaultUncaughtExceptionHandler(new CustomExceptionHandler(deviceId));

    setContentView(R.layout.main);
}

and getUniqueId() does that :

public static String getUniqueID(Context context) {
     return Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
}

Is it possible that this call makes the app crash ? May I call this in onCreate() ?
Or is it Thread.setDefaultUncaughtExceptionHandler() that crashes ?

The users who experience this problem don’t even see the splashscreen of the app and I was unable to reproduce the problem on any device I own.

CustomExceptionHandler just get the stack trace of the exception/error and sends it to the server with the device id. I got a device id from a user who experienced the problem and it’s not in the database.

Any idea? I never had that problem along the development on any device. What could be the cause of this? Don’t hesitate to ask for more details.
Thanks

Edit:
I think I found what would be the stacktrace when the application crashes :

E/AndroidRuntime(10067): FATAL EXCEPTION: main
E/AndroidRuntime(10067): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
E/AndroidRuntime(10067):    at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
E/AndroidRuntime(10067):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3909)
E/AndroidRuntime(10067):    at android.app.ActivityThread.access$1300(ActivityThread.java:122)
E/AndroidRuntime(10067):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1184)
E/AndroidRuntime(10067):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(10067):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(10067):    at android.app.ActivityThread.main(ActivityThread.java:4340)
E/AndroidRuntime(10067):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(10067):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(10067):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime(10067):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime(10067):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(10067): Caused by: java.lang.NullPointerException
E/AndroidRuntime(10067):    at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
E/AndroidRuntime(10067):    at android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
E/AndroidRuntime(10067):    at android.app.LoadedApk.makeApplication(LoadedApk.java:474)
E/AndroidRuntime(10067):    ... 11 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:56:22+00:00Added an answer on June 6, 2026 at 10:56 pm

    I believe that

    Secure.getString(context.getContentResolver(), Secure.ANDROID_ID); 
    

    can return null on some devices.

    So you end up calling

    new CustomExceptionHandler(null);
    

    which causes your crash.

    This could be confirmed if you attached a crash log.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some clients who are not English speaking. They would like the JavaScript
I have some Lotus Notes clients that looses server connection. They suddenly get server
My clients wants to use some of the already available features in my app
We're exporting our analytics reports in various formats, among them CSV. For some clients
Because some email clients don't properly render external stylesheets (or even styles within the
Hi I am having some issues wrapping some ZMQ pull clients in Python classes.
I need to check some settings for all users on Windows clients in the
I'm working on a clients website and for some reason the jQuery colorbox plugin
we're considering exposing some C# types to C++ clients via COM. What problems can
I have some experience of developing in Flex/Actionscript using Cairngorm framework. At that time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.