简体   繁体   English

java.lang.ClassNotFoundException:在路径:DexPathList上找不到类…

[英]java.lang.ClassNotFoundException: Didn't find class … on path: DexPathList

I am making an android project game which I recently added some libraries to this project, and since I did I get the same error: 我正在制作一个android项目游戏,最近我向该项目添加了一些库,由于这样做,我得到了相同的错误:

dex2oat : Failed to create oat file: /data/dalvik-cache/arm/data@app@***.*******.*************-2@base.apk@classes.dex: Permission denied
    java.lang.ClassNotFoundException: Didn't find class "***.*******.*************.MainActivity" on path: DexPathList[[zip file "/data/app/***.*******.*************-1/base.apk"],nativeLibraryDirectories=[/data/app/***.*******.*************-1/lib/arm, /vendor/lib, /system/lib]]
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3132)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at android.app.ActivityThread.access$1100(ActivityThread.java:229)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7325)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
03-25 10:34:07.084 15904 15904 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.compgal.stealthsmiley.MainActivity" on path: DexPathList[[zip file "/data/app/com.compgal.stealthsmiley-1/base.apk"],nativeLibraryDirectories=[/data/app/com.compgal.stealthsmiley-1/lib/arm, /vendor/lib, /system/lib]]
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at android.app.Instrumentation.newActivity(Instrumentation.java:1096)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        ... 9 more
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.compgal.stealthsmiley-1/base.apk
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at dalvik.system.DexFile.openDexFileNative(Native Method)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at dalvik.system.DexFile.openDexFile(DexFile.java:295)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at dalvik.system.DexFile.<init>(DexFile.java:80)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at dalvik.system.DexFile.<init>(DexFile.java:59)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at dalvik.system.DexPathList.loadDexFile(DexPathList.java:279)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at dalvik.system.DexPathList.makePathElements(DexPathList.java:248)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at dalvik.system.DexPathList.<init>(DexPathList.java:120)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:65)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:86)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:47)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at android.app.LoadedApk.getClassLoader(LoadedApk.java:438)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at android.app.LoadedApk.makeApplication(LoadedApk.java:663)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6395)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at android.app.ActivityThread.access$1800(ActivityThread.java:229)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                ... 6 more
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        Suppressed: java.lang.ClassNotFoundException: ***.*******.*************.MainActivity
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at java.lang.Class.classForName(Native Method)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
03-25 10:34:07.084 15904 15904 E AndroidRuntime:                ... 12 more
03-25 10:34:07.084 15904 15904 E AndroidRuntime:        Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

I believe I should say that all the projects / library projects are using the same target "android-23". 我相信我应该说所有项目/库项目都使用相同的目标“ android-23”。 I have checked all the answers on StackOverflow and other websites and could'nt find any answer that solved my problem. 我已经检查了StackOverflow和其他网站上的所有答案,找不到解决我问题的答案。 Thanks for helping! 感谢您的帮助!

EDIT 编辑

The project is written on Netbeans IDE framework, not on android studio and the project isnt using gradle. 该项目是在Netbeans IDE框架上编写的,而不是在android studio上编写的,并且该项目不是使用gradle编写的。 here is the AndroidManifest.xml file: 这是AndroidManifest.xml文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="***.*******.*************"
          android:versionCode="7"
          android:versionName="1.5">
    <application android:label="@string/app_name" android:icon="@drawable/icon"
    >
        <meta-data android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
        <activity 
            android:screenOrientation="landscape"
            android:name="MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

EDIT #2 编辑#2

After a little bit of digging it seems like there is a problem with the dex2oat trying to create oat file: 经过一番挖掘后,dex2oat尝试创建燕麦文件似乎出现了问题:

dex2oat : Failed to create oat file: /data/dalvik-cache/arm/data@app@***.*******.*************-2@base.apk@classes.dex: Permission denied

I have no idea what to do now. 我不知道该怎么办。 Referenced libraries: Google Play Services and Android Support v13. 引用的库:Google Play服务和Android支持v13。 If I remove the libraries the project works fine... so what is the problem? 如果我删除这些库,则该项目可以正常运行……那是什么问题呢?

My such problem was solved by:- 1)Clean 2) Build --> Build Apk. 我的问题是通过以下方式解决的:-1)清理2)构建->构建Apk。 And this Apk was working fine earlier i was just coping from app->build->output->apk. 而且这个Apk之前工作得很好,我只是从app-> build-> output-> apk应对。

Alright, so after a long time of searching it turns out the problem was with the sdk manager of android - I downloaded all the build tools when I only had to download one. 好吧,经过长时间的搜索,结果发现问题出在android的sdk管理器-我只下载了一个构建工具,便下载了所有构建工具。 So I deleted all the unnecessary packages and the project is now working fine. 因此,我删除了所有不必要的软件包,该项目现在可以正常工作了。 Thanks for those who tried to help! 感谢那些试图提供帮助的人!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.ClassNotFoundException:在路径上找不到 class:dexpathlist - java.lang.ClassNotFoundException: Didn't find class on path: dexpathlist java.lang.ClassNotFoundException:在路径:DexPathList上找不到类“ .Application” - java.lang.ClassNotFoundException: Didn't find class .Application" on path: DexPathList java.lang.ClassNotFoundException:在路径上找不到 class “eduapp.arg.MainApplication”:DexPathList - java.lang.ClassNotFoundException: Didn't find class “eduapp.arg.MainApplication” on path: DexPathList java.lang.ClassNotFoundException:在路径上找不到类“com.google.android.gms.measurement.AppMeasurementJobService”:DexPathList - java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementJobService" on path: DexPathList java.lang.ClassNotFoundException:在路径:DexPathList上找不到类“ com.google.android.gms.dynamic.zzf” - java.lang.ClassNotFoundException: Didn't find class “com.google.android.gms.dynamic.zzf” on path: DexPathList 引起:java.lang.ClassNotFoundException:路径上没有找到类“android.support.v4.animation.AnimatorCompatHelper”:DexPathList [[zip文件] - Caused by: java.lang.ClassNotFoundException: Didn't find class “android.support.v4.animation.AnimatorCompatHelper” on path: DexPathList[[zip file 原因:java.lang.ClassNotFoundException:在路径上找不到类 - Caused by: java.lang.ClassNotFoundException: Didn't find class on path React Native java.lang.ClassNotFoundException:找不到类 - React Native java.lang.ClassNotFoundException: Didn't find class java.lang.ClassNotFoundException:找不到带有TeamCity构建的类 - java.lang.ClassNotFoundException: Didn't find class with TeamCity build java.lang.ClassNotFoundException:在路径上找不到 class“com.sun.mail.util.MailLogger”: - java.lang.ClassNotFoundException: Didn't find class "com.sun.mail.util.MailLogger" on path:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM