Android errors

Android, Gradle and ADB build/install errors.

CodeErrorWhat it means
Could not resolve Gradle: Could not resolve all files for configuration / Could not resolve dependency Gradle couldn’t download a dependency — wrong coordinates/version, missing repository, offline mode, or netwo…
Unsupported class file major version Gradle: Unsupported class file major version / Android Gradle plugin requires Java 17 to run The JDK running Gradle doesn’t match what the Gradle version or Android Gradle Plugin (AGP) supports.
INSTALL_PARSE_FAILED_NO_CERTIFICATES INSTALL_PARSE_FAILED_NO_CERTIFICATES / App not installed as package appears to be invalid The APK isn’t signed (or the signature is invalid for this Android version), so it can’t be installed.
Duplicate class Duplicate class X found in modules A and B Two dependencies ship the same class — typically old Android Support libraries mixed with AndroidX, or Kotlin…
incompatible version of Kotlin Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.0.0, expected version is 1.8.0 A dependency was compiled with a newer Kotlin version than your project’s Kotlin Gradle plugin can read.
INSTALL_FAILED_NO_MATCHING_ABIS INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries The APK contains native (.so) libraries only for CPU architectures the device doesn’t support — e.g. x86 emul…
ActivityNotFoundException ActivityNotFoundException: Unable to find explicit activity class; have you declared this activity in your AndroidManifest.xml? An Intent targets an Activity that isn’t declared in the manifest, or an implicit intent has no app to handle…
startForeground not called 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 t…
INSTALL_FAILED_OLDER_SDK INSTALL_FAILED_OLDER_SDK / INSTALL_FAILED_DEPRECATED_SDK_VERSION The device’s Android version is lower than the app’s minSdk (OLDER_SDK), or the app’s targetSdk is too old fo…
INSTALL_FAILED_USER_RESTRICTED INSTALL_FAILED_USER_RESTRICTED: Install canceled by user (Xiaomi/MIUI, Oppo, Vivo) The phone’s manufacturer layer blocked installs over USB — Xiaomi/MIUI, Oppo/ColorOS and Vivo require extra d…
BadTokenException WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running? A dialog or popup was shown with a context whose Activity is finishing/destroyed, or with the Application con…
NetworkOnMainThreadException android.os.NetworkOnMainThreadException The app made a network call on the main (UI) thread, which Android forbids.
Dependency requires compileSdk Dependency 'androidx.x:1.y' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs A library needs a higher compileSdk than your module uses (checkAarMetadata task).
R8: Missing class ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules (missing_rules.txt) R8 (minification) found references to classes that aren’t on the classpath, typically optional dependencies o…
CalledFromWrongThreadException 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.
Manifest merger failed Manifest merger failed: android:exported needs to be explicitly specified Targeting Android 12 (API 31)+ requires `android:exported` on every activity, service or receiver that has an…
signed in debug mode Play Console: You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode The bundle was signed with the debug keystore; Play only accepts release-signed uploads.
must target at least API level Play Console: Your app currently targets API level 33 and must target at least API level 34 Google Play requires new apps and updates to target a recent Android API level (raised every year).
adb unauthorized 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.
Cannot fit requested classes in a single dex file Cannot fit requested classes in a single dex file (# methods: 65536 > 65536) — mergeDex failed The app exceeds the 64K method reference limit of a single DEX file and multidex isn’t enabled (minSdk below…
Duplicate resources Execution failed for task ':app:mergeDebugResources'. > Duplicate resources Two resource files define the same name and type in the same configuration (e.g. ic_logo.png and ic_logo.xml).
ApiException: 10 Google Sign-In: com.google.android.gms.common.api.ApiException: 10 (DEVELOPER_ERROR) Google Sign-In is misconfigured — the app’s package name or SHA-1/SHA-256 signing fingerprint isn’t registere…
Fragment not attached to a context 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 as…
INSTALL_FAILED_TEST_ONLY INSTALL_FAILED_TEST_ONLY: installPackageLI The APK is marked testOnly (built by Android Studio’s Run button), so normal installs refuse it.
SecurityException: Permission Denial java.lang.SecurityException: Permission Denial ... requires android.permission.X The app called an API that needs a permission it hasn’t declared or the user hasn’t granted at runtime.
Minimum supported Gradle version Minimum supported Gradle version is 8.7. Current version is 8.2 The Android Gradle Plugin (AGP) version in your build needs a newer Gradle wrapper version.
Version code has already been used Play Console: Version code 1 has already been used. Try another version code Every upload to a Play app needs a higher versionCode than any previous upload (in any track).
SDK location not found SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in local.properties Gradle doesn’t know where the Android SDK is installed.
android:attr/lStar not found 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 agains…
Android resource linking failed 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…
adb server version doesn't match adb server version (41) doesn't match this client (39); killing... Two different adb binaries are running — e.g. Android Studio’s SDK adb and another one on PATH (Homebrew, Gen…
Resources$NotFoundException android.content.res.Resources$NotFoundException: Resource ID #0x7f... Code asked for a resource ID that doesn’t exist for the current configuration — often passing an int to setTe…
TransactionTooLargeException 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.
ANR 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 show…
Failed to find target with hash string Failed to find target with hash string 'android-34' / Failed to install the following Android SDK packages as some licences have not been accepted Gradle needs an SDK platform/build-tools that isn’t installed, or the licences haven’t been accepted on this…
Can not perform this action after onSaveInstanceState IllegalStateException: Can not perform this action after onSaveInstanceState (fragment transaction) A FragmentTransaction (or DialogFragment.show/navigation) ran after the Activity saved its state, typically f…
Default FirebaseApp is not initialized IllegalStateException: Default FirebaseApp is not initialized in this process Firebase couldn’t initialise because google-services.json or the Google Services Gradle plugin is missing/mis…
Inconsistent JVM-target compatibility Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'compileDebugKotlin' (1.8) Java and Kotlin compile tasks target different JVM bytecode versions in the same module.
INSTALL_FAILED_INSUFFICIENT_STORAGE INSTALL_FAILED_INSUFFICIENT_STORAGE: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE] The device or emulator doesn’t have enough free internal storage to install the APK.
Gradle Java heap space 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.
measured with an infinity maximum height 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…
Namespace not specified Namespace not specified. Specify a namespace in the module's build file (AGP 8) AGP 8 requires android { namespace = "…" } in each module’s build file; the package attribute in AndroidManif…
no devices/emulators found adb: no devices/emulators found / error: device not found adb can’t see any connected device or running emulator.
CLEARTEXT CLEARTEXT communication to host not permitted by network security policy Android 9+ blocks plain `http://` requests by default; the app tried to call a non-HTTPS URL.
Cannot access database on the main thread Room: Cannot access database on the main thread since it may potentially lock the UI for a long period of time A Room DAO query ran on the main thread; Room forbids it by default.
RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts Apps targeting Android 14 must say whether a runtime-registered BroadcastReceiver is exported.
FLAG_IMMUTABLE or FLAG_MUTABLE Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent Apps targeting Android 12+ must declare PendingIntent mutability; missing flags crash.
The emulator process for AVD was killed Android Emulator: The emulator process for AVD x has terminated / was killed (hypervisor not available) The Android Emulator crashed or couldn’t start — usually missing hardware acceleration, low disk/RAM, or GPU…
INSTALL_FAILED_UPDATE_INCOMPATIBLE Android: INSTALL_FAILED_UPDATE_INCOMPATIBLE An app with the same package name but a different signing key is already installed on the device.
Room cannot verify the data integrity Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number The Room entity definitions changed, but the database version wasn’t increased or no migration was provided.