Android 仅使用buildToolsVersion';获取java.lang.NoClassDefFoundError问题;23.0.1';

Android 仅使用buildToolsVersion';获取java.lang.NoClassDefFoundError问题;23.0.1';,android,android-studio,android-gradle-plugin,android-build,android-build-type,Android,Android Studio,Android Gradle Plugin,Android Build,Android Build Type,在Android Studio(Windows版本)中使用buildToolsVersion'23.0.1'运行应用程序时,我遇到了一个非常奇怪的错误,如java.lang.NoClassDefFoundError:com.example.Fragments.SecondarySplashFragment。这个错误对我来说似乎是非常奇怪和新鲜的,因为我只在Android studio的Windows版本中遇到这个错误,而它在Ubuntu版本中没有任何缺陷。我真的不知道该怎么办,在过去的两天里我一

在Android Studio(Windows版本)中使用
buildToolsVersion'23.0.1'
运行应用程序时,我遇到了一个非常奇怪的错误,如
java.lang.NoClassDefFoundError:com.example.Fragments.SecondarySplashFragment
。这个错误对我来说似乎是非常奇怪和新鲜的,因为我只在Android studio的Windows版本中遇到这个错误,而它在Ubuntu版本中没有任何缺陷。我真的不知道该怎么办,在过去的两天里我一直忍受着这个错误。任何一种解决办法都会对我很有帮助。我也张贴我的完整日志如下,供您参考

java.lang.NoClassDefFoundError: com.example.Fragments.SecondarySplashFragment$1
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at com.example.Fragments.SecondarySplashFragment.findViews(SecondarySplashFragment.java:71)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at com.example.Fragments.SecondarySplashFragment.onCreateView(SecondarySplashFragment.java:59)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.support.v4.app.Fragment.performCreateView(Fragment.java:1965)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1078)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1259)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1624)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:330)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:547)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1177)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.app.Activity.performStart(Activity.java:5461)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2386)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.app.ActivityThread.access$900(ActivityThread.java:175)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:146)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5602)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
10-31 12:45:01.561 26135-26135/com.example E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method)
build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.example"
        minSdkVersion 11
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.android.support:design:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile files('libs/volley.jar')
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.android.support:recyclerview-v7:23.1.0'
}
注意:此问题仅在
buildToolsVersion 23.0.1
中出现,但是如果我将其更改为
buildToolsVersion 22.2.0
则一切正常,没有任何问题


提前感谢。

请尝试完全清理然后重建。请尝试使用buildToolsVersion“23.0.2”@abforce我清理并重建了我的项目,但问题仍然存在。@Chandru因此,请将生成工具更新到最新版本。在Secondary SplashFragment.findViewsTry中发布代码,然后进行完全清理然后重建。请尝试使用buildToolsVersion“23.0.2”@abforce我清理并重建了我的项目,但问题仍然存在。@所以,请将生成工具更新到最新版本。将代码发布到SecondarySplashFragment.findViews中