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

java.lang.ClassNotFoundException
Javadoc
Thrown when an application tries to load in a class through its string name using:
  • The forName method in class Class.
  • The findSystemClass method in class ClassLoader .
  • The loadClass method in class ClassLoader.

but no definition for the class with the specified name could be found.

As of release 1.4, this exception has been retrofitted to conform to the general purpose exception-chaining mechanism. The "optional exception that was raised while loading the class" that may be provided at construction time and accessed via the {@link #getException()} method is now known as the cause, and may be accessed via the {@link Throwable#getCause()} method, as well as the aforementioned "legacy method." @author unascribed @see java.lang.Class#forName(java.lang.String) @see java.lang.ClassLoader#findSystemClass(java.lang.String) @see java.lang.ClassLoader#loadClass(java.lang.String, boolean) @since JDK1.0

at dalvik.system.BaseDexClassLoader.findClass
(source)

Typical Exception Messages

  1. com.google.android.gms.maps.MapFragment
  2. com.google.android.gms.maps.SupportMapFragment
  3. Didn't find class "com.android.packageinstaller.InstallFlowAnalytics" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
  4. Didn't find class "com.qualcomm.qti.tetherstatsextension.TetherStatsReporting" on path: DexPathList[[],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
  5. Didn't find class "com.facebook.login.LoginClient$Request" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
  6. Didn't find class "com.google.android.gms.games.multiplayer.realtime.RoomEntity" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
  7. com.google.ads.AdView
  8. Didn't find class "com.google.android.finsky.billing.lightpurchase.PurchaseParams" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
  9. android.support.v4.widget.DrawerLayout
  10. com.google.zxing.client.android.CaptureActivity

Specific cases

Solution

Larten, 2 months ago

You should check:

  • The dependencies of the project
  • Correct multidex configuration
  • Try to disable Instant Run

External results for this pattern (2147)

  1. sido420via GitHub3 days ago
    Didn't find class "com.example.NotificationExtenderExample" on path: DexPathList[[zip file "/data/app/com.example-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example-2/lib/arm, /vendor/lib, /system/lib]]
    Show stack trace
  2. kiddowarevia GitHub3 days ago
    Didn't find class "com.onesignal.UpgradeReceiver" on path: DexPathList[[zip file "/data/app/com.kiddoware.kidsplace-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.kiddoware.kidsplace-2, /vendor/lib, /system/lib]]
    Show stack trace
  3. djeregvia GitHub3 days ago
    Didn't find class "com.google.android.gms.internal.zzbgl" on path: DexPathList[[zip file "/data/app/my-app-2/base.apk"],nativeLibraryDirectories=[/data/app/my-app-2/lib/x86, /data/app/my-app-2/base.apk!/lib/x86, /system/lib, /vendor/lib]]
    Show stack trace
  4. jonpryorvia GitHub4 days ago
    Didn't find class "mono.android.MultiDexLoader" on path: DexPathList[[zip file "/data/app/Xamarin.Android.Locale_Tests-1/base.apk", zip file "/data/app/Xamarin.Android.Locale_Tests-1/base.apk"],nativeLibraryDirectories=[/data/app/Xamarin.Android.Locale_Tests-1/lib/x86, /data/app/Xamarin.Android.Locale_Tests-1/lib/x86, /vendor/lib, /system/lib]]
    Show stack trace
  5. GeetsKrishvia GitHub1 week ago
    Didn't find class "org.nativescript.plugins.firebase.MyFirebaseMessagingService" on path: DexPathList[[zip file "/data/app/org.nativescript.FirebaseApp1-1/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.FirebaseApp1-1/lib/x86, /vendor/lib, /system/lib]]
    Show stack trace
  6. GeetsKrishvia GitHub1 week ago
    Didn't find class "org.nativescript.plugins.firebase.MyFirebaseMessagingService" on path: DexPathList[[zip file "/data/app/org.nativescript.FirebaseApp1-1/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.FirebaseApp1-1/lib/x86, /vendor/lib, /system/lib]]
    Show stack trace
  7. samk17cmutpmvia GitHub1 week ago
    Didn't find class "com.google.devtools.build.android.desugar.runtime.ThrowableExtension" on path: DexPathList[[zip file "/data/app/jp.co.neolab.calling-1/base.apk"],nativeLibraryDirectories=[/data/app/jp.co.neolab.calling-1/lib/arm, /data/app/jp.co.neolab.calling-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
    Show stack trace
  8. CtrlAltCutenessvia GitHub1 week ago
    Didn't find class "com.example.termuxam.Am" on path: DexPathList[[zip file "/data/data/com.termux/files/usr/libexec/termux-am/am.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    Show stack trace
  9. yuv4ikvia GitHub2 weeks ago
    Didn't find class "com.airbnb.lottie.R$styleable" on path: DexPathList[[zip file "/data/app/com.zzz.yyy-ORTNOMSPCK8rFQTnNTpx9A==/base.apk"],nativeLibraryDirectories=[/data/app/com.zzz.yyy-ORTNOMSPCK8rFQTnNTpx9A==/lib/x86, /data/app/com.zzz.yyy-ORTNOMSPCK8rFQTnNTpx9A==/base.apk!/lib/x86, /system/lib, /vendor/lib]]
    Show stack trace
  10. sunbyyvia GitHub3 weeks ago
    Didn't find class "com.google.android.finsky.utils.SelfUpdateScheduler" on path: DexPathList[[zip file "/system/priv-app/Phonesky/Phonesky.apk"],nativeLibraryDirectories=[/system/priv-app/Phonesky/lib/arm, /vendor/lib, /system/lib]]
    Show stack trace