question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NullPointerException

See original GitHub issue
java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2981)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3042)
  at android.app.ActivityThread.-wrap14 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1639)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6780)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1496)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1386)
Caused by: java.lang.NullPointerException: 
  at com.franmontiel.localechanger.LocaleChanger.configureBaseContext (LocaleChanger.java:119)
  at com.eakteam.networkmanager.paneli_kryesor.attachBaseContext (paneli_kryesor.java:201)
  at android.app.Activity.attach (Activity.java:6884)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2894)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3042)
  at android.app.ActivityThread.-wrap14 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1639)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6780)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1496)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1386)

MAIN APP

public class MainApplication extends Application {

    public static final List<Locale> SUPPORTED_LOCALES =
            Arrays.asList(
                    new Locale("en", "US"),
                    new Locale("sq", "AL")
            );

    @Override
    public void onCreate() {
        super.onCreate();
        LocaleChanger.initialize(getApplicationContext(), SUPPORTED_LOCALES);
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        LocaleChanger.onConfigurationChanged();
    }
}

MAIN ACTIVITY


@Override
    protected void attachBaseContext(Context newBase) {
        newBase = LocaleChanger.configureBaseContext(newBase);
        super.attachBaseContext(newBase);
    }

I’m using Crashlytics from Fabric too if this is needed to know …

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rishabh-smartlinkscommented, Oct 18, 2019

same issue with me.

0reactions
franmontielcommented, Dec 28, 2020

It has been impossible for me to reproduce this issue. Maybe it is related with this report? https://github.com/franmontiel/LocaleChanger/issues/3 Closing it until more information is available

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - What is a NullPointerException, and how do I fix it?
A null pointer is one that points to nowhere. When you dereference a pointer p , you say "give me the data at...
Read more >
NullPointerException (Java Platform SE 8 ) - Oracle Help Center
Thrown when an application attempts to use null in a case where an object is required. These include: ... Applications should throw instances...
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
The java.lang.NullPointerException is a runtime exception in Java that occurs when a variable is accessed which is not pointing to any ...
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
This is one of the most common occurrences of java.lang.NullPointerException because it's the caller who is passing the null argument. The below ...
Read more >
How to resolve the java.lang.NullPointerException - Educative.io
In Java, the java.lang.NullPointerException is thrown when a reference variable is accessed (or de-referenced) and is not pointing to any object.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found