Error map

RuntimeException: Cannot create an instance of class ViewModel java.lang.RuntimeException: Cannot create an instance of class com.example.MainViewModel Caused by: java.lang.NoSuchMethodException: MainViewModel.<init> []

Android · layer 1, On your device

Open the full error page →

Centre: this error. First ring: errors it is linked with (12). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.

RuntimeException: Cannot create an instance of class ViewModel — java.lang.RuntimeException: Cannot create an instance of class com.example.MainViewModel Caused by: java.lang.NoSuchMethodException: MainViewModel.<init> [] (Android)RuntimeExce…Fragment not attached to a context — IllegalStateException: Fragment x not attached to a context / not attached to an activity (Android)Fragment not attach…App crashes after restore on a new phone — (behavior) crash on first launch after device transfer / Auto Backup (Android)App crashes after r…Dagger: ... scoped with different scope than component — error: [Dagger/IncompatiblyScopedBindings] SingletonComponent scoped with @ActivityScoped may not reference bindings with different scopes (Android)Dagger: ... scoped …EXC_BAD_ACCESS: message sent to deallocated instance — -[Foo bar]: message sent to deallocated instance 0x600000 (iOS)EXC_BAD_ACCESS: mes…ClassCastException: cannot be cast to android.widget — java.lang.ClassCastException: android.widget.Button cannot be cast to android.widget.TextView (Android)ClassCastException:…Hilt: Hilt Activity must be attached to an @AndroidEntryPoint Application — java.lang.IllegalStateException: Hilt Activity must be attached to an @AndroidEntryPoint Application (Android)Hilt: Hilt Activity…Dagger/MissingBinding: cannot be provided without an @Inject constructor — error: [Dagger/MissingBinding] com.example.Repository cannot be provided without an @Inject constructor or an @Provides-annotated method (Android)Dagger/MissingBindi…BadParcelableException: ClassNotFoundException when unmarshalling — android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.example.Model (Android)BadParcelableExcept…No ViewModelStoreOwner was provided via LocalViewModelStoreOwner — java.lang.IllegalStateException: No ViewModelStoreOwner was provided via LocalViewModelStoreOwner (Android)No ViewModelStoreOw…WorkManager: Could not create Worker — androidx.work.WorkerFactory: Could not instantiate com.example.SyncWorker / NoSuchMethodException: SyncWorker.<init> [Context, WorkerParameters] (Android)WorkManager: Could …ConcurrentModificationException while iterating — java.util.ConcurrentModificationException at java.util.ArrayList$Itr.next (Android)ConcurrentModificat…Core Data: NSManagedObjectContext was accessed from the wrong queue — CoreData: error: Serious application error. Exception was caught during Core Data change processing (iOS)Core Data: NSManage…adb unauthorized — adb: device unauthorized. This adb server's $ADB_VENDOR_KEYS is not set (Android)adb unauthorizedno devices/emulators found — adb: no devices/emulators found / error: device not found (Android)no devices/emulator…android:attr/lStar not found — AAPT: error: resource android:attr/lStar not found (Android)android:attr/lStar …Time Machine couldn't complete the backup — macOS: Time Machine couldn't complete the backup. / The backup disk image could not be mounted / Backup failed with error 18/19/21/22 (macOS)Time Machine couldn…NullPointerException: Attempt to invoke virtual method on a null object reference — java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference (Android)NullPointerExceptio…UninitializedPropertyAccessException: lateinit property has not been initialized — kotlin.UninitializedPropertyAccessException: lateinit property adapter has not been initialized (Android)UninitializedProper…DHCPDISCOVER: no free leases — Networking: dhcpd: DHCPDISCOVER from aa:bb:cc:dd:ee:ff via eth0: network 192.168.1.0/24: no free leases (Networking)DHCPDISCOVER: no fr…kapt: error type was incorrect / cannot find symbol — error: cannot find symbol class DaggerAppComponent / kaptDebugKotlin FAILED (Android)kapt: error type wa…Coroutine exception crashes the app (no handler) — FATAL EXCEPTION: DefaultDispatcher-worker-1 Process: com.example, PID: 1234 (Android)Coroutine exception…Gradle Java heap space — Gradle: Expiring Daemon because JVM heap space is exhausted / java.lang.OutOfMemoryError: Java heap space during build (Android)Gradle Java heap sp…EXC_BAD_ACCESS — Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) (iOS)EXC_BAD_ACCESSProcess completed with exit code 137 — GitHub Actions: Error: Process completed with exit code 137 (Killed — out of memory) (CI/CD)Process completed w…measured with an infinity maximum height — Jetpack Compose: Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed (Android)measured with an in…A RenderFlex overflowed — Flutter: A RenderFlex overflowed by x pixels on the right/bottom (Flutter / Dart)A RenderFlex overfl…RenderBox was not laid out — Flutter: RenderBox was not laid out: RenderFlex#a1b2c relayoutBoundary=up2 NEEDS-PAINT — Failed assertion: 'hasSize' (Flutter / Dart)RenderBox was not l…Android resource linking failed — AAPT: error: resource x (aka y) not found — Android resource linking failed (Android)Android resource li…Error building the app bundle — Execution failed for task ':app:bundleRelease'. Error while executing bundletool (Android)Error building the …Hilt: @HiltViewModel with assisted injection factory missing — Cannot create an instance of class: Hilt assisted ViewModel requires creationCallback (Android)Hilt: @HiltViewMode…TransactionTooLargeException — android.os.TransactionTooLargeException: data parcel size x bytes (Android)TransactionTooLarge…ClassNotFoundException only in release — java.lang.ClassNotFoundException: Didn't find class "com.example.Model" on path: DexPathList (Android)ClassNotFoundExcept…IndexOutOfBoundsException: Index 5 out of bounds for length 3 — java.lang.IndexOutOfBoundsException: Index: 5, Size: 3 (Android)IndexOutOfBoundsExc…Compose Compiler requires a different Kotlin version — This version (1.5.3) of the Compose Compiler requires Kotlin version 1.9.10 but you appear to be using Kotlin version 1.9.0 (Android)Compose Compiler re…Compose: Reading a state in the wrong scope / infinite recomposition — Compose Runtime: Detected infinite recomposition loop / state read during composition (Android)Compose: Reading a …LazyColumn: Key was already used — java.lang.IllegalArgumentException: Key "42" was already used. If you are using LazyColumn/Row please make sure you provide a unique key for each item. (Android)LazyColumn: Key was…startForeground not called — Context.startForegroundService() did not then call Service.startForeground() / ForegroundServiceStartNotAllowedException (Android)startForeground not…IllegalStateException: Not allowed to start service Intent (app is in background) — java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.example/.SyncService }: app is in background uid UidRecord{...} (Android)IllegalStateExcepti…WorkManager work never runs (constraints not met) — WM-WorkerWrapper: Work [ id=… ] was cancelled / state ENQUEUED (Android)WorkManager work ne…ConcurrentModificationException — java.util.ConcurrentModificationException (Java)ConcurrentModificat…UnsupportedOperationException — java.lang.UnsupportedOperationException (List.of / Arrays.asList is immutable) (Java)UnsupportedOperatio…InterruptedException — java.lang.InterruptedException (sleep interrupted) (Java)InterruptedExceptionNetworkOnMainThreadException — android.os.NetworkOnMainThreadException (Android)NetworkOnMainThread…CalledFromWrongThreadException — CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views (Android)CalledFromWrongThre…ANR — ANR: Application Not Responding (Input dispatching timed out) (Android)ANR

Directly related (12)

Fragment not attached to a contextAndroid

IllegalStateException: Fragment x not attached to a context / not attached to an activity

Code called requireContext()/requireActivity()/getString() after the Fragment was detached — usually in an async callback.

App crashes after restore on a new phoneAndroid

(behavior) crash on first launch after device transfer / Auto Backup

Restored app data is incompatible with the new device.

Dagger: ... scoped with different scope than componentAndroid

error: [Dagger/IncompatiblyScopedBindings] SingletonComponent scoped with @ActivityScoped may not reference bindings with different scopes

A binding's scope doesn't match the component that uses it.

EXC_BAD_ACCESS: message sent to deallocated instanceiOS

-[Foo bar]: message sent to deallocated instance 0x600000

An object was used after being freed.

ClassCastException: cannot be cast to android.widgetAndroid

java.lang.ClassCastException: android.widget.Button cannot be cast to android.widget.TextView

A view id in the layout is a different widget type than the one the code expects.

Hilt: Hilt Activity must be attached to an @AndroidEntryPoint ApplicationAndroid

java.lang.IllegalStateException: Hilt Activity must be attached to an @AndroidEntryPoint Application

Hilt isn't initialized because the Application class isn't annotated or registered.

Dagger/MissingBinding: cannot be provided without an @Inject constructorAndroid

error: [Dagger/MissingBinding] com.example.Repository cannot be provided without an @Inject constructor or an @Provides-annotated method

Dagger or Hilt has no way to create a requested type.

BadParcelableException: ClassNotFoundException when unmarshallingAndroid

android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.example.Model

A Parcelable in a Bundle or Intent couldn't be restored because its class was not found.

No ViewModelStoreOwner was provided via LocalViewModelStoreOwnerAndroid

java.lang.IllegalStateException: No ViewModelStoreOwner was provided via LocalViewModelStoreOwner

`viewModel()` was called from a composable that has no ViewModel store, such as a Preview or ComposeView without an owner.

WorkManager: Could not create WorkerAndroid

androidx.work.WorkerFactory: Could not instantiate com.example.SyncWorker / NoSuchMethodException: SyncWorker.<init> [Context, WorkerParameters]

WorkManager can't construct your Worker with its default factory.

ConcurrentModificationException while iteratingAndroid

java.util.ConcurrentModificationException at java.util.ArrayList$Itr.next

A collection was changed while it was being iterated.

Core Data: NSManagedObjectContext was accessed from the wrong queueiOS

CoreData: error: Serious application error. Exception was caught during Core Data change processing

A managed object or context was used on a different thread than it belongs to.

Two steps away (33)

adb unauthorizedAndroid

adb: device unauthorized. This adb server's $ADB_VENDOR_KEYS is not set

The phone hasn’t accepted your computer’s RSA key for USB debugging yet.

no devices/emulators foundAndroid

adb: no devices/emulators found / error: device not found

adb can’t see any connected device or running emulator.

android:attr/lStar not foundAndroid

AAPT: error: resource android:attr/lStar not found

A dependency (androidx.core 1.7+) uses an attribute from Android 12 (API 31), but your module compiles against an older compileSd…

Time Machine couldn't complete the backupmacOS

macOS: Time Machine couldn't complete the backup. / The backup disk image could not be mounted / Backup failed with error 18/19/21/22

A Time Machine backup stopped because the destination is unavailable, full, or the backup set is damaged.

NullPointerException: Attempt to invoke virtual method on a null object referenceAndroid

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

Code called a method on a view or object that was null, most often a findViewById that returned null.

UninitializedPropertyAccessException: lateinit property has not been initializedAndroid

kotlin.UninitializedPropertyAccessException: lateinit property adapter has not been initialized

A `lateinit var` was read before anything assigned it.

DHCPDISCOVER: no free leasesNetworking

Networking: dhcpd: DHCPDISCOVER from aa:bb:cc:dd:ee:ff via eth0: network 192.168.1.0/24: no free leases

The DHCP server has no unused addresses left in the scope.

kapt: error type was incorrect / cannot find symbolAndroid

error: cannot find symbol class DaggerAppComponent / kaptDebugKotlin FAILED

Annotation processing with kapt failed, so generated classes such as Dagger or Room code are missing.

Coroutine exception crashes the app (no handler)Android

FATAL EXCEPTION: DefaultDispatcher-worker-1 Process: com.example, PID: 1234

An uncaught exception in a `launch` coroutine kills the process.

Gradle Java heap spaceAndroid

Gradle: Expiring Daemon because JVM heap space is exhausted / java.lang.OutOfMemoryError: Java heap space during build

The Gradle daemon (or Kotlin daemon) ran out of memory compiling or dexing the project.

EXC_BAD_ACCESSiOS

Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

The app accessed memory it shouldn’t — a dangling pointer, released object, unsafe pointer misuse, a data race, or infinite recur…

Process completed with exit code 137CI/CD

GitHub Actions: Error: Process completed with exit code 137 (Killed — out of memory)

The command was killed by the system with SIGKILL (128 + 9), almost always because the runner ran out of memory.

measured with an infinity maximum heightAndroid

Jetpack Compose: Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed

A LazyColumn (or verticalScroll) is placed inside another vertically scrolling container, so it gets infinite height.

A RenderFlex overflowedFlutter / Dart

Flutter: A RenderFlex overflowed by x pixels on the right/bottom

A Row or Column’s children need more space than available, so Flutter draws the yellow-black overflow stripes.

RenderBox was not laid outFlutter / Dart

Flutter: RenderBox was not laid out: RenderFlex#a1b2c relayoutBoundary=up2 NEEDS-PAINT — Failed assertion: 'hasSize'

A widget was asked for its size or painted before layout finished, usually because a parent gave it unbounded or conflicting cons…

Android resource linking failedAndroid

AAPT: error: resource x (aka y) not found — Android resource linking failed

A layout, manifest or style references a resource (drawable, string, style, attribute) that doesn’t exist in the module or its de…

Error building the app bundleAndroid

Execution failed for task ':app:bundleRelease'. Error while executing bundletool

Building the Android App Bundle (.aab) failed in the bundle step.

Hilt: @HiltViewModel with assisted injection factory missingAndroid

Cannot create an instance of class: Hilt assisted ViewModel requires creationCallback

A ViewModel with assisted parameters needs a factory callback.

TransactionTooLargeExceptionAndroid

android.os.TransactionTooLargeException: data parcel size x bytes

Too much data was put into a Bundle/Intent/saved state, exceeding the ~1 MB Binder transaction buffer.

ClassNotFoundException only in releaseAndroid

java.lang.ClassNotFoundException: Didn't find class "com.example.Model" on path: DexPathList

A class is stripped or renamed by R8 in the release build but still used by reflection.

IndexOutOfBoundsException: Index 5 out of bounds for length 3Android

java.lang.IndexOutOfBoundsException: Index: 5, Size: 3

The code read a list or array position that doesn't exist.

Compose Compiler requires a different Kotlin versionAndroid

This version (1.5.3) of the Compose Compiler requires Kotlin version 1.9.10 but you appear to be using Kotlin version 1.9.0

The Compose compiler plugin is tied to one exact Kotlin release and yours differs.

Compose: Reading a state in the wrong scope / infinite recompositionAndroid

Compose Runtime: Detected infinite recomposition loop / state read during composition

A Compose state is written during composition, so the UI keeps recomposing.

LazyColumn: Key was already usedAndroid

java.lang.IllegalArgumentException: Key "42" was already used. If you are using LazyColumn/Row please make sure you provide a unique key for each item.

Two items in a lazy list share the same key.

startForeground not calledAndroid

Context.startForegroundService() did not then call Service.startForeground() / ForegroundServiceStartNotAllowedException

A foreground service didn’t call startForeground() within a few seconds, or the app tried to start one from the background where…

IllegalStateException: Not allowed to start service Intent (app is in background)Android

java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.example/.SyncService }: app is in background uid UidRecord{...}

Since Android 8 background apps can't freely start services.

WorkManager work never runs (constraints not met)Android

WM-WorkerWrapper: Work [ id=… ] was cancelled / state ENQUEUED

A scheduled task stays enqueued and doesn't execute.

ConcurrentModificationExceptionJava

java.util.ConcurrentModificationException

A collection was modified while being iterated (even in a single thread).

UnsupportedOperationExceptionJava

java.lang.UnsupportedOperationException (List.of / Arrays.asList is immutable)

Code tried to modify an immutable or fixed-size collection.

InterruptedExceptionJava

java.lang.InterruptedException (sleep interrupted)

A blocked thread (sleep, wait, join, queue take) was interrupted by another thread.

NetworkOnMainThreadExceptionAndroid

android.os.NetworkOnMainThreadException

The app made a network call on the main (UI) thread, which Android forbids.

CalledFromWrongThreadExceptionAndroid

CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views

Background code updated a View directly; UI changes must happen on the main thread.

ANRAndroid

ANR: Application Not Responding (Input dispatching timed out)

The main thread was blocked for about 5 seconds (input) or a broadcast/service took too long, so Android showed “App isn’t respon…