Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Didn't find class on path: dexpathlist

Seriously, i don't know what to do to solve this problem. My android project was working fine, until i needed to import a library with Maven. Since that, everything started to collapse.

What is happening: When i start my application, the following error appears on LogCat and android tells that my app stopped working. I've searched for this similar error here AND on the rest of the internet, but everything people did haven't worked for me.

Error:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.buscaserra/com.buscaserra.main.ActivitySplash}: java.lang.ClassNotFoundException: Didn't find class "com.buscaserra.main.ActivitySplash" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.example.buscaserra-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.buscaserra-2, /vendor/lib, /system/lib]]

Manifest and packages: manifestpackages

Build Path: buildpath

like image 803
VulfCompressor Avatar asked Apr 15 '14 03:04

VulfCompressor


4 Answers

Same problem here. What worked for me was adding android-support-v4.jar as a lib and making sure it was checked on Project properties -> Build Path -> Order & export. It was mentioned here

like image 62
Federico Avatar answered Nov 15 '22 22:11

Federico


I had the same problem when I moved the project folder from a Linux machine to a Mac.

What I did was:

  1. Close the project
  2. Remove the .iml file
  3. Import the project using the "Create new project using existing code"

I am using IntelliJ.

Cheers.

like image 26
Khanh Hua Avatar answered Nov 15 '22 23:11

Khanh Hua


I did the following steps to resolve the issue on Android Studio.

  • open file ./app/build.gradle
  • reduce compileSdkVersion (e.g. 22 -> 21)
  • click 'sync project with gradle file'
  • change back to the original compileSdkVersion (e.g. 22)
  • click 'sync project with gradle file'

recompile and it should work.

like image 2
Angel Koh Avatar answered Nov 15 '22 21:11

Angel Koh


I have spent way to many hours on this stupid issue but finally got it resolved:

When creating a new project -> package name is causing this stupid dex issue to appear, must not be able to find the main activity during run time with whatever deployment assemply setup. Android Studio doesn't like some of my commonly used package names, I'm completely baffled..I think this is a pretty big bug haha

Given the following new project parameters:

Name: NotificationApp, packageName: com.stores.business.notificationapp, saveLocation: /home/me/AndroidStudioProjects/NotificationApp

I would get the following error: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.stores.business.notificationapp/com.stores.business.notificationapp.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.stores.business.notificationapp.MainActivity" on path: DexPathList[[zip file "/data/app/com.stores.business.notificationapp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.cvs.stores.myapplication-2/lib/arm64, /vendor/lib64, /system/lib64]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)

My Solution I resolved it by changing the package name to:com.notificationapp, then File->invalidate caches/Restart..hope this helps someone else haha

like image 1
Derek Medina Avatar answered Nov 15 '22 21:11

Derek Medina