Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
179 views
in Technique[技术] by (71.8m points)

android - java.lang.ClassNotFoundException in dalvik.system.BaseDexClassLoader.findClass

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.me.hexavoidaa/com.me.hexavoidaa.PTPlayer}: java.lang.ClassNotFoundException: Didn't find class "com.me.hexavoidaa.PTPlayer" on path: DexPathList[[zip file "/data/app/com.me.hexavoidaa-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.me.hexavoidaa-1, /vendor/lib, /system/lib]]
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2208)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2340)
    at android.app.ActivityThread.access$800(ActivityThread.java:157)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:157)
    at android.app.ActivityThread.main(ActivityThread.java:5293)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.me.hexavoidaa.PTPlayer" on path: DexPathList[[zip file "/data/app/com.me.hexavoidaa-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.me.hexavoidaa-1, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
    at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
    ... 11 more
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

add this to gradle.build:

defaultConfig {
...
minSdkVersion 14
targetSdkVersion // your version 
...

// Enabling multidex support.
multiDexEnabled true
}

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...