1. Explore
  2. »
  3. Android

Android errors

The mobile operating system of Google

https://developer.android.com/
Solution coverage:
Summary coverage:

Top patterns

  1. Unhandled exception during activity initialization

    Check the body of your activity's onCreate(), onResume methods and the initializations of variables

  2. Trying to use a class which isn't in the dependencies

    You should check:

    • The dependencies of the project
    • Correct multidex configuration
    • Try to disable Instant Run
  3. Tried to access to a resource without permission

    Request the required permission, before you start to use the resource:

    https://developer.android.com/training/permissions/requesting

Error patternsPackagesClassesMethodsExceptions
DescriptionException TypeEntry MethodWeb pages

Unhandled exception during activity initialization

java.lang.RuntimeException
android.app.ActivityThread.performLaunchActivity
4414Web pages
1Solution
RuntimeExceptionActivityThread.performLaunchActivity()4414

Trying to use a class which isn't in the dependencies

java.lang.ClassNotFoundException
dalvik.system.BaseDexClassLoader.findClass
2168Web pages
1Solution
ClassNotFoundExceptionBaseDexClassLoader.findClass()2168

Tried to access to a resource without permission

java.lang.SecurityException
android.os.Parcel.readException
1349Web pages
1Solution
SecurityExceptionParcel.readException()1349

There is no Activity to handle Intent

android.content.ActivityNotFoundException
android.app.Instrumentation.checkStartActivityResult
1187Web pages
1Solution
ActivityNotFoundExceptionInstrumentation.checkStartActivityResult()1187

Executed network call on the main thread

android.os.NetworkOnMainThreadException
android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork
1070Web pages
1Solution
NetworkOnMainThreadExceptionStrictMode$AndroidBlockGuardPolicy.onNetwork()1070

Exception during SQL statement execution

android.database.sqlite.SQLiteException
android.database.sqlite.SQLiteConnection.nativePrepareStatement
989Web pages
1Solution
SQLiteExceptionSQLiteConnection.nativePrepareStatement()989

Used bad or invalid Context to display the view

android.view.WindowManager$BadTokenException
android.view.ViewRootImpl.setView
595Web pages
WindowManager$BadTokenExceptionViewRootImpl.setView()595

Resource used doesn't exist

android.content.res.Resources$NotFoundException
android.content.res.Resources.getValue
556Web pages
Resources$NotFoundExceptionResources.getValue()556

Instrumentation.newActivity() has thrown a ClassNotFoundException

java.lang.ClassNotFoundException
3 frames hidden
android.app.Instrumentation.newActivity
548Web pages
ClassNotFoundExceptionInstrumentation.newActivity()548

You try to start an activity which isn't in your Manifest.xml

java.lang.ClassNotFoundException
4 frames hidden
android.app.ActivityThread.performLaunchActivity
541Web pages
ClassNotFoundExceptionActivityThread.performLaunchActivity()541

Used image is too large

java.lang.OutOfMemoryError
android.graphics.BitmapFactory.nativeDecodeAsset
505Web pages
OutOfMemoryErrorBitmapFactory.nativeDecodeAsset()505

WindowManagerGlobal.addView() has thrown a WindowLeaked

android.view.WindowLeaked
1 frames hidden
android.view.WindowManagerGlobal.addView
485Web pages
WindowLeakedWindowManagerGlobal.addView()485

WindowManagerGlobal.addView() has thrown a WindowManager$BadTokenException

android.view.WindowManager$BadTokenException
1 frames hidden
android.view.WindowManagerGlobal.addView
483Web pages
WindowManager$BadTokenExceptionWindowManagerGlobal.addView()483

WindowManagerImpl.addView() has thrown a WindowLeaked

android.view.WindowLeaked
2 frames hidden
android.view.WindowManagerImpl.addView
483Web pages
WindowLeakedWindowManagerImpl.addView()483

Dialog.show() has thrown a WindowLeaked

android.view.WindowLeaked
3 frames hidden
android.app.Dialog.show
441Web pages
WindowLeakedDialog.show()441

Tried to modify the UI from a background thread

android.view.ViewRootImpl$CalledFromWrongThreadException
android.view.ViewRootImpl.checkThread
413Web pages
ViewRootImpl$CalledFromWrongThreadExceptionViewRootImpl.checkThread()413

Communication between threads is handled incorrectly

java.lang.RuntimeException
android.os.Handler.<init>
387Web pages
RuntimeExceptionHandler.<init>()387

Can't put a view with parent inside an another view

java.lang.IllegalStateException
android.view.ViewGroup.addViewInner
378Web pages
IllegalStateExceptionViewGroup.addViewInner()378

ViewGroup.addView() has thrown an IllegalStateException

java.lang.IllegalStateException
1 frames hidden
android.view.ViewGroup.addView
375Web pages
IllegalStateExceptionViewGroup.addView()375

Posix.open() has thrown an ErrnoException

android.system.ErrnoException
libcore.io.Posix.open
342Web pages
ErrnoExceptionPosix.open()342

BlockGuardOs.open() has thrown an ErrnoException

android.system.ErrnoException
1 frames hidden
libcore.io.BlockGuardOs.open
341Web pages
ErrnoExceptionBlockGuardOs.open()341

The application's memory is leaking

java.lang.OutOfMemoryError
android.graphics.Bitmap.nativeCreate
329Web pages
OutOfMemoryErrorBitmap.nativeCreate()329

ViewGroup.addView() has thrown an IllegalStateException

java.lang.IllegalStateException
2 frames hidden
android.view.ViewGroup.addView
319Web pages
IllegalStateExceptionViewGroup.addView()319

Tried to read from an uninitialized cursor

android.database.CursorIndexOutOfBoundsException
android.database.AbstractCursor.checkPosition
317Web pages
1Solution
CursorIndexOutOfBoundsExceptionAbstractCursor.checkPosition()317

AbstractWindowedCursor.checkPosition() has thrown a CursorIndexOutOfBoundsException

android.database.CursorIndexOutOfBoundsException
1 frames hidden
android.database.AbstractWindowedCursor.checkPosition
315Web pages
CursorIndexOutOfBoundsExceptionAbstractWindowedCursor.checkPosition()315

Service lifecycle handled incorrectly

android.app.ServiceConnectionLeaked
android.app.LoadedApk$ServiceDispatcher.<init>
315Web pages
ServiceConnectionLeakedLoadedApk$ServiceDispatcher.<init>()315

LoadedApk.getServiceDispatcher() has thrown a ServiceConnectionLeaked

android.app.ServiceConnectionLeaked
1 frames hidden
android.app.LoadedApk.getServiceDispatcher
311Web pages
ServiceConnectionLeakedLoadedApk.getServiceDispatcher()311

IoBridge.open() has thrown an ErrnoException

android.system.ErrnoException
2 frames hidden
libcore.io.IoBridge.open
310Web pages
ErrnoExceptionIoBridge.open()310

Check the lifecycle state of view, before you try to do something with it

java.lang.IllegalArgumentException
android.view.WindowManagerGlobal.findViewLocked
306Web pages
IllegalArgumentExceptionWindowManagerGlobal.findViewLocked()306

BlockGuardOs.open() has thrown an ErrnoException

libcore.io.ErrnoException
1 frames hidden
libcore.io.BlockGuardOs.open
304Web pages
ErrnoExceptionBlockGuardOs.open()304

IoBridge.open() has thrown a FileNotFoundException

android.system.ErrnoException
3 frames hidden
libcore.io.IoBridge.open
300Web pages
FileNotFoundExceptionIoBridge.open()300

You must to update your adapter after data modification

java.lang.IndexOutOfBoundsException
android.support.v7.widget.RecyclerView$Recycler.getViewForPosition
287Web pages
IndexOutOfBoundsExceptionRecyclerView$Recycler.getViewForPosition()287

RecyclerView$Recycler.getViewForPosition() has thrown an IndexOutOfBoundsException

java.lang.IndexOutOfBoundsException
1 frames hidden
android.support.v7.widget.RecyclerView$Recycler.getViewForPosition
283Web pages
IndexOutOfBoundsExceptionRecyclerView$Recycler.getViewForPosition()283

LayoutInflater.createView() has thrown a ClassNotFoundException

java.lang.ClassNotFoundException
3 frames hidden
android.view.LayoutInflater.createView
282Web pages
ClassNotFoundExceptionLayoutInflater.createView()282

You must to handle correctly the lifecycle of your View

java.lang.IllegalArgumentException
1 frames hidden
android.view.WindowManagerGlobal.removeView
280Web pages
IllegalArgumentExceptionWindowManagerGlobal.removeView()280

IoBridge.open() has thrown an ErrnoException

libcore.io.ErrnoException
2 frames hidden
libcore.io.IoBridge.open
274Web pages
ErrnoExceptionIoBridge.open()274

ActivityThread.handleLaunchActivity() has thrown a RuntimeException

java.lang.ClassNotFoundException
6 frames hidden
android.app.ActivityThread.handleLaunchActivity
274Web pages
RuntimeExceptionActivityThread.handleLaunchActivity()274

You have a problem with the initialization of your Fragment class

android.view.InflateException
android.view.LayoutInflater.createViewFromTag
273Web pages
InflateExceptionLayoutInflater.createViewFromTag()273

LinearLayoutManager$LayoutState.next() has thrown an IndexOutOfBoundsException

java.lang.IndexOutOfBoundsException
2 frames hidden
android.support.v7.widget.LinearLayoutManager$LayoutState.next
271Web pages
IndexOutOfBoundsExceptionLinearLayoutManager$LayoutState.next()271

You got an unhandled exception during activity restore

java.lang.RuntimeException
android.app.ActivityThread.performResumeActivity
271Web pages
RuntimeExceptionActivityThread.performResumeActivity()271

LinearLayoutManager.fill() has thrown an IndexOutOfBoundsException

java.lang.IndexOutOfBoundsException
4 frames hidden
android.support.v7.widget.LinearLayoutManager.fill
267Web pages
IndexOutOfBoundsExceptionLinearLayoutManager.fill()267

ActivityThread.handleResumeActivity() has thrown a RuntimeException

java.lang.RuntimeException
1 frames hidden
android.app.ActivityThread.handleResumeActivity
265Web pages
RuntimeExceptionActivityThread.handleResumeActivity()265

Handler.<init>() has thrown a RuntimeException

java.lang.RuntimeException
1 frames hidden
android.os.Handler.<init>
260Web pages
RuntimeExceptionHandler.<init>()260

Tried to log a null reference

java.lang.NullPointerException
android.util.Log.println_native
259Web pages
1Solution
NullPointerExceptionLog.println_native()259

ZygoteInit.main() has thrown a RuntimeException

java.lang.ClassNotFoundException
15 frames hidden
com.android.internal.os.ZygoteInit.main
259Web pages
RuntimeExceptionZygoteInit.main()259

IoBridge.open() has thrown a FileNotFoundException

libcore.io.ErrnoException
3 frames hidden
libcore.io.IoBridge.open
258Web pages
FileNotFoundExceptionIoBridge.open()258

Array resource used is missing

java.lang.NullPointerException
android.widget.ArrayAdapter.createViewFromResource
257Web pages
NullPointerExceptionArrayAdapter.createViewFromResource()257

BitmapFactory.decodeStream() has thrown an OutOfMemoryError

java.lang.OutOfMemoryError
1 frames hidden
android.graphics.BitmapFactory.decodeStream
253Web pages
OutOfMemoryErrorBitmapFactory.decodeStream()253

LinearLayoutManager.scrollBy() has thrown an IndexOutOfBoundsException

java.lang.IndexOutOfBoundsException
5 frames hidden
android.support.v7.widget.LinearLayoutManager.scrollBy
249Web pages
IndexOutOfBoundsExceptionLinearLayoutManager.scrollBy()249

LayoutInflater.createViewFromTag() has thrown an InflateException

android.view.InflateException
1 frames hidden
android.view.LayoutInflater.createViewFromTag
247Web pages
InflateExceptionLayoutInflater.createViewFromTag()247
Nothing to list here.
Nothing to list here.
Nothing to list here.
Nothing to list here.