错误:任务':app:compileAlphaDebugJavaWithJavac'的执行失败。 >显示java.lang.NullPointerException

时间:2015-12-29 01:31:28

标签: java android

My Gradle Build Log:

Information:Gradle tasks [:app:assembleAlphaDebug]
Information:0 errors
Information:0 warnings
Information:See complete output in console
:app:preBuild UP-TO-DATE
:app:preAlphaDebugBuild UP-TO-DATE
:app:checkAlphaDebugManifest
:app:preAlphaReleaseBuild UP-TO-DATE
:app:preAlpha_revisionDebugBuild UP-TO-DATE
:app:preAlpha_revisionReleaseBuild UP-TO-DATE
:app:prepareComAfollestadMaterialDialogs0741Library UP-TO-DATE
:app:prepareComAndreabaccegaAndroidFormEdittext110Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72103Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2220Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72221Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidAnswers112Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidBeta112Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlytics223Library UP-TO-DATE
:app:prepareComDaimajiaAndroidanimationsLibrary112Library UP-TO-DATE
:app:prepareComDaimajiaEasingLibrary100Library UP-TO-DATE
:app:prepareComDaimajiaSwipelayoutLibrary119Library UP-TO-DATE
:app:prepareComGithubBmelnychukAtv127Library UP-TO-DATE
:app:prepareComGithubCastorflexSmoothprogressbarLibrary020Library UP-TO-DATE
:app:prepareComGithubGcacaceSignaturePad101Library UP-TO-DATE
:app:prepareComGithubMachinariusPreferencefragment011Library UP-TO-DATE
:app:prepareComGithubMarkushiCirclebutton11Library UP-TO-DATE
:app:prepareComGithubTraexRippleeffectLibrary13Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase780Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity780Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation780Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps780Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus780Library UP-TO-DATE
:app:prepareComJpardogoMaterialtabstripLibrary109Library UP-TO-DATE
:app:prepareComMapboxMapboxsdkMapboxAndroidSdk074Library UP-TO-DATE
:app:prepareComRomainpielShimmerLibrary130Library UP-TO-DATE
:app:prepareComRoomoramaCaldroid118Library UP-TO-DATE
:app:prepareComShehabicDroppyDroppy0251Library UP-TO-DATE
:app:prepareComSothreeSlidinguppanelLibrary320Library UP-TO-DATE
:app:prepareComSquareupLeakcanaryLeakcanaryAndroid131Library UP-TO-DATE
:app:prepareComWdullaerMaterialdatetimepicker142Library UP-TO-DATE
:app:prepareComWrappFloatlabelededittextLibrary006Library UP-TO-DATE
:app:prepareDeHdodenhofCircleimageview200Library UP-TO-DATE
:app:prepareDeKeyboardsurferAndroidWidgetCrouton185Library UP-TO-DATE
:app:prepareInfoHoang8fFbutton105Library UP-TO-DATE
:app:prepareIoFabricSdkAndroidFabric130Library UP-TO-DATE
:app:prepareAlphaDebugDependencies
:app:compileAlphaDebugAidl UP-TO-DATE
:app:compileAlphaDebugRenderscript UP-TO-DATE
:app:generateAlphaDebugBuildConfig UP-TO-DATE
:app:generateAlphaDebugAssets UP-TO-DATE
:app:mergeAlphaDebugAssets UP-TO-DATE
:app:processAlphaDebugManifest UP-TO-DATE
:app:fabricGenerateResourcesAlphaDebug
:app:generateAlphaDebugResValues UP-TO-DATE
:app:generateAlphaDebugResources
:app:mergeAlphaDebugResources
:app:processAlphaDebugResources
:app:generateAlphaDebugSources
:app:processAlphaDebugJavaRes UP-TO-DATE
:app:compileAlphaDebugJavaWithJavac FAILED
Error:Execution failed for task ':app:compileAlphaDebugJavaWithJavac'.
> java.lang.NullPointerException
Information:BUILD FAILED
Information:Total time: 1 mins 3.633 secs

我根本不明白这个问题,这似乎是我在运行应用程序时遇到的第一个问题。 我目前正在使用android studio 2.0预览版2 我的依赖项目前是:

    compile 'com.github.traex.rippleeffect:library:1.3'
    provided 'com.squareup.dagger:dagger-compiler:1.2.+'
    compile('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {
        // exclusion is not neccessary, but generally a good idea.
        exclude group: 'com.google.android', module: 'support-v4'
    }
    // Google Activity Recognition

    // Google Maps

    // Google+'

    // Google Account Login
    dependencies {
        compile('com.mapbox.mapboxsdk:mapbox-android-sdk:0.7.4@aar') {
            transitive = true
        }
    }
    testCompile 'org.mockito:mockito-core:1.9.5'
    testCompile files('libs/dexmaker-mockito-1.0.jar')
    testCompile files('libs/dexmaker-1.0.jar')
    testCompile 'junit:junit:4.12'
    testCompile('org.robolectric:robolectric:3.0-rc2') {
        exclude group: 'commons-logging', module: 'commons-logging'
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    testCompile 'com.squareup:fest-android:1.0.+'
    compile('com.crashlytics.sdk.android:crashlytics:2.2.3@aar') {
        transitive = true;
    }
    compile 'com.wdullaer:materialdatetimepicker:1.4.2'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
    compile 'com.andreabaccega:android-form-edittext:1.1.0@aar'
    compile 'com.shehabic.droppy:Droppy:0.2.5.1@aar'
    compile 'com.andreabaccega:android-form-edittext:1.1.0@aar'
    compile 'com.github.gcacace:signature-pad:1.0.1'
    compile 'com.android.support:appcompat-v7:21.0.1'
    compile 'com.android.support:cardview-v7:21.0.3'
    compile 'com.android.support:recyclerview-v7:21.0.3'
    compile 'com.android.support:support-v4:21.0.1'
    compile 'com.github.anrwatchdog:anrwatchdog:1.1.1'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.squareup.picasso:picasso:2.5.0'
    compile 'com.jakewharton:butterknife:6.0.0'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.github.bumptech.glide:glide:3.5.2'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'com.squareup.dagger:dagger:1.2.+'
    compile 'com.romainpiel.shimmer:library:1.3.0@aar'
    compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
    compile 'info.hoang8f:fbutton:1.0.5'
    compile 'com.wrapp.floatlabelededittext:library:0.0.6'
    compile 'com.jpardogo.materialtabstrip:library:1.0.9'
    compile 'com.github.markushi:circlebutton:1.1'
    compile 'com.google.android.gms:play-services-location:7.8.0'
    compile 'com.google.android.gms:play-services-maps:7.8.0'
    compile 'com.google.android.gms:play-services-plus:7.8.0'
    compile 'com.google.android.gms:play-services-identity:7.8.0'
    compile 'com.sothree.slidinguppanel:library:3.2.0'
    compile 'com.daimajia.swipelayout:library:1.1.9@aar'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.easing:library:1.0.0@aar'
    compile 'com.daimajia.androidanimations:library:1.1.2@aar'
    compile 'com.roomorama:caldroid:1.1.8'
    compile 'joda-time:joda-time:2.3'
    compile 'com.github.bmelnychuk:atv:1.2.+'
    compile 'org.apache.commons:commons-lang3:3.0'
    compile 'com.afollestad:material-dialogs:0.7.4.1'
    compile 'com.github.PhilJay:MPAndroidChart:v2.1.0'
    compile 'com.android.support:design:22.2.0'
    compile 'com.github.machinarius:preferencefragment:0.1.1'
    compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.amazonaws:aws-android-sdk-core:2.+'
    compile 'com.amazonaws:aws-android-sdk-s3:2.+'

我以前从未遇到过这个问题,然后一周后我运行我的应用程序时突然发生这种情况。 我做错了什么?

1 个答案:

答案 0 :(得分:2)

我不知道发生了什么,但万一其他人有同样的问题,这是我的build.gradle现在,我只是替换了那些

  

+

用匕首之类的数字。在build.gradle中

dependencies {


    compile 'com.github.traex.rippleeffect:library:1.3'
    provided 'com.squareup.dagger:dagger-compiler:1.2.2'
    compile('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {
        // exclusion is not neccessary, but generally a good idea.
        exclude group: 'com.google.android', module: 'support-v4'
    }
    // Google Activity Recognition

    // Google Maps

    // Google+'

    // Google Account Login
    dependencies {
        compile('com.mapbox.mapboxsdk:mapbox-android-sdk:0.7.4@aar') {
            transitive = true
        }
    }
    testCompile 'org.mockito:mockito-core:1.9.5'
    testCompile files('libs/dexmaker-mockito-1.0.jar')
    testCompile files('libs/dexmaker-1.0.jar')
    testCompile 'junit:junit:4.12'
    testCompile('org.robolectric:robolectric:3.0-rc2') {
        exclude group: 'commons-logging', module: 'commons-logging'
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    testCompile 'com.squareup:fest-android:1.0.+'
    compile('com.crashlytics.sdk.android:crashlytics:2.2.3@aar') {
        transitive = true;
    }
    compile 'com.wdullaer:materialdatetimepicker:1.4.2'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
    compile 'com.andreabaccega:android-form-edittext:1.1.0@aar'
    compile 'com.shehabic.droppy:Droppy:0.2.5.1@aar'
    compile 'com.andreabaccega:android-form-edittext:1.1.0@aar'
    compile 'com.github.gcacace:signature-pad:1.0.1'
    compile 'com.android.support:appcompat-v7:21.0.1'
    compile 'com.android.support:cardview-v7:21.0.3'
    compile 'com.android.support:recyclerview-v7:21.0.3'
    compile 'com.android.support:support-v4:21.0.1'
    compile 'com.github.anrwatchdog:anrwatchdog:1.1.1'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.squareup.picasso:picasso:2.5.0'
    compile 'com.jakewharton:butterknife:6.0.0'
    compile 'com.google.code.gson:gson:2.5'
    compile 'com.github.bumptech.glide:glide:3.5.2'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'com.squareup.dagger:dagger:1.2.2'
    compile 'com.romainpiel.shimmer:library:1.3.0@aar'
    compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
    compile 'info.hoang8f:fbutton:1.0.5'
    compile 'com.wrapp.floatlabelededittext:library:0.0.6'
    compile 'com.jpardogo.materialtabstrip:library:1.0.9'
    compile 'com.github.markushi:circlebutton:1.1'
    compile 'com.google.android.gms:play-services-location:7.8.0'
    compile 'com.google.android.gms:play-services-maps:7.8.0'
    compile 'com.google.android.gms:play-services-plus:7.8.0'
    compile 'com.google.android.gms:play-services-identity:7.8.0'
    compile 'com.sothree.slidinguppanel:library:3.2.0'
    compile 'com.daimajia.swipelayout:library:1.1.9@aar'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.easing:library:1.0.0@aar'
    compile 'com.daimajia.androidanimations:library:1.1.2@aar'
    compile 'com.roomorama:caldroid:1.1.8'
    compile 'joda-time:joda-time:2.3'
    compile 'com.github.bmelnychuk:atv:1.2.+'
    compile 'org.apache.commons:commons-lang3:3.0'
    compile 'com.afollestad:material-dialogs:0.7.4.1'
    compile 'com.github.PhilJay:MPAndroidChart:v2.1.0'
    compile 'com.android.support:design:22.2.0'
    compile 'com.github.machinarius:preferencefragment:0.1.1'
    compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.amazonaws:aws-android-sdk-core:2.+'
    compile 'com.amazonaws:aws-android-sdk-s3:2.+'
}

之后与gradle同步