这是我用 android studio 1.0.2 实现的错误日志
02-03 13:05:23.831 8385-8385/com.******.*******E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: android.support.v4.app.NavUtilsJB
at android.support.v4.app.NavUtils$NavUtilsImplJB.getParentActivityName(NavUtils .java:125)
at android.support.v4.app.NavUtils.getParentActivityName(NavUtils.java:302)
at android.support.v4.app.NavUtils.getParentActivityName(NavUtils.java:281)
at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(ActionBarActivityDelegateBase.java:142)
at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123)
at com..******.*******.****.ActivityWelcome.onCreate(ActivityWelcome.java:33)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
配置
buildToolsVersion "21.1.2"
android SDK TOOLS"24.0.2"
multidex enabled
predexLibraries =false
incremental = true
jumboMode = false
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.google.code.gson:gson:2.3'
compile 'com.android.support:support-v4:21.0.3@aar'
compile 'com.android.support:appcompat-v7:21.0.3@aar'
compile project(':ViewPagerIndicator')
compile('de.keyboardsurfer.android.widget:crouton:1.8.4@aar') {
exclude group: 'com.google.android', module: 'support-v4'
}
compile 'org.java-websocket:Java-WebSocket:1.3.0'
}
如何解决这个错误?gradlew clean 没有帮助。构建文件夹删除也不起作用。Android Studio 在编译时没有显示错误。