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.

getNetworkType() crashes with NPE

See original GitHub issue

On google dev console, I see this:

java.lang.NullPointerException: 
  at android.os.Parcel.readException (Parcel.java:1699)
  at android.os.Parcel.readException (Parcel.java:1646)
  at android.net.IConnectivityManager$Stub$Proxy.getActiveNetworkInfo (IConnectivityManager.java:1587)
  at android.net.ConnectivityManager.getActiveNetworkInfo (ConnectivityManager.java:874)
  at com.evernote.android.job.util.Device.getNetworkType (Device.java:102)
  at com.owncloud.android.utils.ConnectivityUtils.isInternetWalled (ConnectivityUtils.java:50)
  at com.owncloud.android.utils.FilesSyncHelper.lambda$restartJobsIfNeeded$0$FilesSyncHelper (FilesSyncHelper.java:234)
  at com.owncloud.android.utils.FilesSyncHelper$$Lambda$0.run (Unknown Source)
  at java.lang.Thread.run (Thread.java:762)

So we are calling Device.getNetworkType() and in this function an NPE happens.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
vRallevcommented, Mar 15, 2018

That’s my plan

0reactions
vRallevcommented, Mar 19, 2018

This issue has been fixed in version 1.2.5. Thanks for reporting it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

App crashes on start caused by NPE in android.content ...
We have a really weird crash, which points to the system classes. It appears on application start. Fatal Exception: java.lang.RuntimeException: ...
Read more >
telephony/java/android/telephony/TelephonyManager.java
public static TelephonyManager getDefault() { ... public int getNetworkType(long subId) { ... This could happen before phone restarts due to crashing.
Read more >
android.telephony.TelephonyManager.java Source code
READ_PHONE_STATE) public @NetworkType int getNetworkType() { return ... This could happen before phone restarts due to crashing return NETWORK_TYPE_UNKNOWN; ...
Read more >
App Crashes on Android 11 device only - Kodular Community
From last 2-3 weeks I am getting constant app crashes on Android 11 only. ... getNetworkType (TelephonyManager.java:3706)
Read more >
Building with Android 11 results in runtime crash - Unity Forum
getNetworkType (TelephonyManager.java:2945). at android.telephony.TelephonyManager ...
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