- java.lang.ClassNotFoundException: Didn’t find class on path: dexpathlist — Troubleshooting
- Solution for java.lang.ClassNotFoundException: Didn’t find class on path: dexpathlist
- Prerequisites
- Our solution to the dexpathlist problem
- ClassNotFoundException on path DexPathList #387
- Comments
- lognaturel commented Feb 6, 2017 •
- lognaturel commented Feb 6, 2017
- shobhitagarwal1612 commented Feb 6, 2017
- lognaturel commented Feb 6, 2017
- shobhitagarwal1612 commented Feb 6, 2017
- shobhitagarwal1612 commented Feb 6, 2017
- lognaturel commented Feb 7, 2017 •
- lognaturel commented Feb 7, 2017
- srsudar commented Feb 7, 2017 •
- srsudar commented Feb 7, 2017
- lognaturel commented Feb 7, 2017
- shobhitagarwal1612 commented Feb 7, 2017
- lognaturel commented Feb 7, 2017
- shobhitagarwal1612 commented Feb 7, 2017
- shobhitagarwal1612 commented Feb 7, 2017
- shobhitagarwal1612 commented Feb 7, 2017
- mfaragallah commented Jun 8, 2017
- lognaturel commented Jun 8, 2017
- BhavaniBaskaran commented Jan 18, 2018
- sweta01 commented Feb 17, 2018
- kkvarma commented Feb 23, 2018 •
- lognaturel commented Feb 23, 2018
- saurabhtanu commented Feb 24, 2018
- BhagavanReddyByreddy commented Mar 19, 2018
- ma-fouani commented Jul 1, 2018
- wcluigi commented Nov 6, 2019 •
- ClassNotFoundException: не нашел класс по пути: DexPathList
- 11 ответов
- обновление
- Полное Описание:
java.lang.ClassNotFoundException: Didn’t find class on path: dexpathlist — Troubleshooting
In your android studio IDE you find the java.lang.ClassNotFoundException error: Didn’t find class on path: dexpathlist after running your project. The solution in this troubleshooting.
A few hours ago we imported several files from another project android. After long minutes of renaming the package and fixing errors, we finally start to compile and run our new project. When the interface of our application is displayed, an error occurs. In the logcat we find a message similar to the following message:
After hours of research on the website and brainstorming we ended up finding a solution that might have solved our problem. The latter, at the time of writing is not yet on the Web or was not visible among the results of the search. For the rest, here is the solution
Solution for java.lang.ClassNotFoundException: Didn’t find class on path: dexpathlist
Prerequisites
Before applying the solution that we offer you in this mini tutorial, first make sure you have tried to apply the following actions:
- Delete the cache via the interface of your Android studio by following the path: File -> Invalidate Caches / Restart -> Invalidate and Restart
- If the previous one didn’t work, try the following: Build -> Clean Project followed by Build -> Rebuild Project
If despite the previous steps, the same error continues to appear, then you can apply our solution:
Our solution to the dexpathlist problem
To resolve the error java.lang.ClassNotFoundException: Didn’t find class on path: dexpathlist we made the following remark:
- The packages in our file mobile.navigation.xml were wrong. We then corrected the names of the packages to resolve the compilation problem.
- The solution is to check among your xml files (in the folder layout priority) if there is no error writing the package name.
This kind of error is not automatically detected by android studio until the Programs crash in your phone or emulator. Worse, the search for the package via android studio did not allow us to find the cause.
If you want to know how we found it, I will say it was instinctively. The kind of thing that makes you open a file for no reason and Pouf, you find the cause of your problem.
Источник
ClassNotFoundException on path DexPathList #387
Comments
lognaturel commented Feb 6, 2017 •
Seen from builds 1061, 1063 and 1065 in the Google Play Developer console. It has happened three times each on Android 4.2, 4.4 and 5.1 (so not very frequently). There is a recent user message that says «legal help page» but I don’t know what that means.
This StackOverflow post has some ideas to explore.
The text was updated successfully, but these errors were encountered:
lognaturel commented Feb 6, 2017
@shobhitagarwal1612, this looks like it could be related to the issue you’re running into. Have you been using the emulator or a real phone? Can you try the other to see if it still happens?
shobhitagarwal1612 commented Feb 6, 2017
I am using my Xolo Q700s Plus, (Android 4.4)
I have also tested on RedMi Note 3, Android 6.0)
lognaturel commented Feb 6, 2017
@shobhitagarwal1612 Can you give the emulator a try, too? I’m still not totally sure this is the same issue since it’s not exactly the same stack trace than you’re getting but it would be interesting to know if the emulator works.
shobhitagarwal1612 commented Feb 6, 2017
I’ll try once again using a clean build
shobhitagarwal1612 commented Feb 6, 2017
@lognaturel I used a clean build and reinstalled the apk. Now, the app is running on RedMi Note 3 (Android 6) but throwing the same error on Xolo Q700s plus(Kitkat, Android 4.4). Thanks for the suggestion
lognaturel commented Feb 7, 2017 •
I tried to run on an API 9 emulator which worked a few days ago and now I get INSTALL_FAILED_DEXOPT even after a clean build. No idea if this is related or not. I’ve tried several suggestions from SO with no luck. No problems running on an API 19 (Android 4.4) emulator.
The big recent change related to all this is that MultiDex support was added just a few days ago. This particular issue has been ongoing since build 1061 but not very frequent.
I’ve added a few more pieces of information from the dev console to the original issue.
lognaturel commented Feb 7, 2017
This is @shobhitagarwal1612’s stack trace reported on Slack:
srsudar commented Feb 7, 2017 •
This sounds a lot like a MultiDex issue I saw with a Collect port I was working on. I solved it by adding a call to attachBaseContext in the Application class. See the line here.
Apologies if this discussion is happening against a branch where this is already added. I don’t see it on master. The main fix is this:
edit: Added some much needed context.
srsudar commented Feb 7, 2017
If it does turn out to be this, I should add that this was one of the most annoying bugs I’ve encountered. It was crashing in the field, I had no idea why, and the importance of MultiDex.install is completely under-emphasized in the docs.
The repo I linked to there is a MultiDex version of Collect that I got working on at least as low as 4.4, so if it isn’t this issue there might be something else in the config files or something that is helpful.
lognaturel commented Feb 7, 2017
Thanks for jumping in and sharing your wisdom @srsudar! That all seems like a super promising first direction to explore and it’s certainly completely new to me.
shobhitagarwal1612 commented Feb 7, 2017
lognaturel commented Feb 7, 2017
@shobhitagarwal1612 Do you want to take a first stab at trying those changes and either report back on what you discover or if it fixes your problem, issue a PR? You’re the only one who is able to reproduce this reliably so it would be super helpful!
shobhitagarwal1612 commented Feb 7, 2017
in Collect.java and it worked for me. Thanks @srsudar
shobhitagarwal1612 commented Feb 7, 2017
@lognaturel I will issue a PR making those changes.
shobhitagarwal1612 commented Feb 7, 2017
@lognaturel I have issued the PR #391. Please review
mfaragallah commented Jun 8, 2017
I still have the same issue here ! How can I fix it ?
lognaturel commented Jun 8, 2017
@mfaragallah Please file a new issue with all the information about device version, etc.
BhavaniBaskaran commented Jan 18, 2018
Hi,
Still i have same issue how can solve it ? Already i have used it.
@OverRide
protected void attachBaseContext(Context base) <
super.attachBaseContext(base);
MultiDex.install(this);
>
in this line but app is crash not supported for it. please give some idea.
sweta01 commented Feb 17, 2018
Caused by: java.lang.ClassNotFoundException: Didn’t find class «android.support.v4.math.MathUtils»
kkvarma commented Feb 23, 2018 •
Hi, I am getting below error while integrating reactnative android aar file in another project.
Please help me to solve this problem..
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/demos/helloworld/MyReactActivity;
at com.demos.helloworld.MainActivity.onCreate(MainActivity.java:19)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.ClassNotFoundException: com.demos.helloworld.MyReactActivity
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.demos.helloworld.MainActivity.onCreate(MainActivity.java:19)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/react/modules/core/DefaultHardwareBackBtnHandler;
at com.demos.helloworld.MainActivity.onCreate(MainActivity.java:19)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.ClassNotFoundException: Didn’t find class «com.facebook.react.modules.core.DefaultHardwareBackBtnHandler» on path: DexPathList[[zip file «/data/app/reacttest.prime.com.aarimplementation-1/base.apk»],nativeLibraryDirectories=[/data/app/reacttest.prime.com.aarimplementation-1/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.demos.helloworld.MainActivity.onCreate(MainActivity.java:19)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
lognaturel commented Feb 23, 2018
@kkvarma @sweta01 Those issues don’t seem related to ODK Collect. Please get in touch with the projects you are working with. Good luck!
saurabhtanu commented Feb 24, 2018
I still have the same issue, I an extending MultidexApplication in my app class and I see that the MultidexApplication already calls the Multidex.install() method. However I see this crash only in android versions 6.0 and below
BhagavanReddyByreddy commented Mar 19, 2018
@OverRide
protected void attachBaseContext(Context base) <
super.attachBaseContext(base);
MultiDex.install(this);
>
this worked for me in Application class thanks 🙂
ma-fouani commented Jul 1, 2018
I guess you might have found out what was wrong by now, I ran into the same problem. It turned out when I created my application class, it was not under any package (weird). I only had to move it under the main package: com.mycompany.example
wcluigi commented Nov 6, 2019 •
im also facing this issue
what is weird is its looking for a class that i renamed already and i refractored it the right way but for some reason the error is still pointing to a non-existing class
Edit
My bad lol its still written in the manifest lmao
Источник
ClassNotFoundException: не нашел класс по пути: DexPathList
У меня проблема, так как я обновил свое приложение на playstore. С момента этого обновления возникает исключение, но я не изменил ничего, связанного с этим исключением.
дело в том, что моя версия приложения до запуска без проблем, и я не изменил ничего, связанного с этой деятельностью. Я только что добавил новый информационный диалог, который не имеет ничего общего с этой деятельностью. Это приложение является бесплатной версией lite, Ive сделал те же самые изменения на pro версия и там ничего не выбрасывается. Это работает, как и ожидалось. Единственная разница между pro и lite заключается в том, что я интегрировал Admob (по-новому) в версии lite и лицензию Google Play в версии pro. Но это я интегрировал с самого начала и не внес изменений в это. Я также не внес никаких изменений в манифест, я прочитал много сообщений здесь, но ничего не помогает.
Кажется ,что это просто происходит на версиях Android с 5.0. Кто-нибудь знает, что это проблема может вызвать или у кого-то такой же опыт? Возможно ли, что proguard просто уничтожил что-либо, запутав (также здесь нет изменений)?
Я не опубликовал код, потому что это не важно для этой проблемы, как я уже сказал, Я не внес изменений, связанных с этим исключением.
этот вопрос отмечен как дубликат, но это не так. Комментарий со ссылкой не исправляет мою проблему, все библиотеки проверены и интегрированы правильно. Кроме того, я не использую НДК.
11 ответов
обновление
после долгого времени оказалось, что это должно иметь какое-то отношение к proguard. Я не могу сказать, что именно вызывает ошибка, но я попробовал немного, и это то, что я заметил (это в моем случае с Eclipse IDE):
- Я должен закрыть каждую вкладку из проекта, который я хочу подписать
- Я должен очистить проект и после очистки ничего не делать, кроме экспорта apk
- внесение небольшого изменения в манифест, сохраните его и отменить изменение (и сохранить)
- если в манифесте есть какой-либо класс с именем «YourClass» или «.YourClass», измените его на » com.вашпакет.в yourclass»
это четыре пункта, которые я сделал, а затем это сработало. Это выглядит подозрительно, но я думаю, что есть проблема с запутыванием. Потому что без этих точек я могу просто скомпилировать свой apk и установить его из eclipse. Для меня нет очевидной причины для такого поведения. Также имя пакета работает без изменений, если я только установлю его из eclipse. Надеюсь, эти моменты могут кому-то помочь.
Если вы манифестируете имя пакета в порядке, Если вы заключенных проект, и в file explorer переименовал ваш проект но после импорта вы снова сталкиваетесь с этой проблемой единственный способ здесь —
УДАЛИТЬ ЭТУ ПАПКУ .Gradle в.
Это можно найти в папке проекта с помощью проводника файлов. В нем есть файлы артефактов, содержащие имя этого старого проекта. После повторного открытия проекта в Android Studio папка будет воссоздана автоматически.
Я только что сменил gradle с com.андроид.инструменты.сборка: gradle: 2.2.2 to com.андроид.инструменты.сборка: gradle: 2.2.0,и проблема в порядке!
для меня это произошло, когда имя пакета (имя каталога) изменен.
Я понял, что папка «build» волшебным образом поддерживает промежуточные файлы для сборки проекта. Я удалил папку» build «в папке» app». Теперь gradle пришлось переделать все файлы с новым именем пакета. Теперь он работает правильно.
Я думаю, что это имеет какое-то отношение к multidex и нескольким именам пакетов, если у вас есть несколько модулей . Очистите проект и удалите все сборки/ папки.
tl; dr: это, по-видимому, вызвано сочетанием относительного и абсолютного объявления в AndroidManifest.xml . Я думаю, что лучшее решение-использовать относительную нотацию при объявлении , , и в своем AndroidManifest.xml .
Полное Описание:
у меня была эта проблема слишком долго, это было потому, что я использовал как абсолютный, так и относительный , , и заявления в мой AndroidManifest.xml . Вот что я сделал чтобы исправить это:
вы AndroidManifest.xml убедитесь, что есть package: свойство указано правильно, это должен быть точный абсолютный путь, например:
теперь, когда у вас есть правильный абсолютный путь, указанный в вашей раздел, вам нужно будет использовать относительный путь для всех , , и ‘s, определяемым в AndroidManifest.xml .
примеры:
конечно, также быть обязательно очистите проект.
иногда, когда мы генерируем подписанный файл apk, если у нас есть проблема с библиотекой зависимостей(дубликат библиотеки jar), эта ошибка может произойти. Проверьте путь сборки и удалите дубликат библиотеки и проверьте, не проверена ли какая-либо библиотека на вкладке заказ и экспорт.
причина в том, что android не может найти конкретную активность в dexpath.
поэтому мы должны предоставить весь путь действий в «файле манифеста».
например, ваше имя действия — «SplashActivity», и оно есть в » com.имя_пакета.пакет.» Поэтому мы должны предоставить полное имя пакета этой деятельности.
У меня была похожая проблема, вот мое решение:
- измените имя приложения в AndroidManifest на полный путь
- Очистить Проект
- Перестроить Проект
- построить APK
Я получил аналогичную ошибку после изменения имени каталога, просто переименовав имя каталога и импортировав. Не в состоянии установить больше. Ни повторно включить отладку USB, ни перестроить работу проекта.
Я решаю его, создав новый проект и вручную скопируйте весь соответствующий контент в новый проект.
Источник