Android的工作室java.lang.NoClassDefFoundError的:android.support.v4.app.NavUtilsJB [英] Android studio java.lang.NoClassDefFoundError: android.support.v4.app.NavUtilsJB

查看:561
本文介绍了Android的工作室java.lang.NoClassDefFoundError的:android.support.v4.app.NavUtilsJB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的错误日志来达到的采用Android 1.0.2工作室

This is my error log acheived with 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干净,不是帮助。建立文件夹删除也不能正常工作。 Android的工作室展示在编译时没有错误。

How to solve this error? gradlew clean not helps. Build folders deletion also not working. Android studio shows no errors while compiling.

推荐答案

我有这个问题,只是找到了解决办法 - 答案是RTFM!以下是说明:<一href="https://developer.android.com/tools/building/multidex.html">https://developer.android.com/tools/building/multidex.html

I had this problem and just found the solution - answer is RTFM! Here are the instructions: https://developer.android.com/tools/building/multidex.html

Multidexing是一项新功能,因此需要一个支持库是用pre-棒棒糖设备兼容。您需要将以下添加到您的摇篮文件相关性:

Multidexing is a new feature and so requires a support library to be compatible with pre-lollipop devices. You need to add the following to your gradle file dependencies:

编译com.android.support:multidex:1.0.0

compile 'com.android.support:multidex:1.0.0'

和再multidex支持应用程序添加到您的清单:

And then add the multidex support application to your manifest:

&LT; XML版本=1.0编码=UTF-8&GT?; &LT;舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android     包=com.example.android.multidex.myapplication&GT;     &lt;应用         ...         机器人:名称=android.support.multidex.MultiDexApplication&GT;         ...     &LT; /用途&gt; &LT; /舱单&GT;

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.multidex.myapplication"> <application ... android:name="android.support.multidex.MultiDexApplication"> ... </application> </manifest>

希望这有助于

这篇关于Android的工作室java.lang.NoClassDefFoundError的:android.support.v4.app.NavUtilsJB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆