1

我刚刚迁移到 Android Studio 1.5 并开始收到以下错误。在 mgration 之前,我可以构建项目,完全没有问题。现在我不能。

任何帮助将不胜感激。先感谢您。

错误

13:13:26.569 [ERROR] [org.gradle.BuildExceptionReporter] 
13:13:26.569 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
13:13:26.570 [ERROR] [org.gradle.BuildExceptionReporter] 
13:13:26.570 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
13:13:26.570 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':tess-two:processReleaseResources'.
13:13:26.570 [ERROR] [org.gradle.BuildExceptionReporter] > at index 4
13:13:26.570 [ERROR] [org.gradle.BuildExceptionReporter] 
13:13:26.571 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
13:13:26.571 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':tess-two:processReleaseResources'.
13:13:26.572 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
13:13:26.572 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
13:13:26.572 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
13:13:26.572 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
13:13:26.572 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
13:13:26.573 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
13:13:26.573 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
13:13:26.573 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
13:13:26.573 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
13:13:26.573 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
13:13:26.574 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
13:13:26.574 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:62)
13:13:26.574 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
13:13:26.574 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
13:13:26.574 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
13:13:26.574 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NullPointerException: at index 4
13:13:26.574 [ERROR] [org.gradle.BuildExceptionReporter]    at com.google.common.collect.ObjectArrays.checkElementNotNull(ObjectArrays.java:240)
13:13:26.575 [ERROR] [org.gradle.BuildExceptionReporter]    at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:231)
13:13:26.575 [ERROR] [org.gradle.BuildExceptionReporter]    at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:226)
13:13:26.575 [ERROR] [org.gradle.BuildExceptionReporter]    at com.google.common.collect.ImmutableList.construct(ImmutableList.java:303)
13:13:26.575 [ERROR] [org.gradle.BuildExceptionReporter]    at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:258)
13:13:26.575 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.ide.common.process.ProcessInfoBuilder.createProcess(ProcessInfoBuilder.java:55)
13:13:26.575 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.builder.core.AaptPackageProcessBuilder.build(AaptPackageProcessBuilder.java:444)
13:13:26.576 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:915)
13:13:26.576 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:138)
13:13:26.576 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:98)
13:13:26.576 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
13:13:26.576 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
13:13:26.577 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
13:13:26.577 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
13:13:26.577 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
13:13:26.577 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
13:13:26.587 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
13:13:26.587 [ERROR] [org.gradle.BuildExceptionReporter]    ... 14 more
13:13:26.587 [ERROR] [org.gradle.BuildExceptionReporter] 

我的应用程序的 Gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'

    }
}

allprojects {
    repositories {
        jcenter()
    }
}

应用 Gradle

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "br.com.cfb.doarnf"
        minSdkVersion 17
        targetSdkVersion 23
        versionCode 5
        versionName "2.0.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

}

dependencies {
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':tess-two')
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:support-v4:23.1.0'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'org.parceler:parceler:1.0.1'
    compile 'org.parceler:parceler-api:1.0.1'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
    compile 'com.squareup.okhttp:okhttp:2.2.0'
    compile 'com.github.orangegangsters:swipy:1.2.0@aar'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.google.android.gms:play-services-gcm:8.3.0'
    compile 'com.google.android.gms:play-services-ads:8.3.0'
    compile 'com.google.android.gms:play-services-identity:8.3.0'
    compile 'com.google.zxing:core:3.2.1'
}

苔丝二 gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
}

apply plugin: 'com.android.library'

android {

    compileSdkVersion 23
    buildToolsVersion "23.0.1"


    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 23
    }

    sourceSets.main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        res.srcDirs = ['res']
        jniLibs.srcDirs = ['libs']
    }
}
4

1 回答 1

1

您必须安装新版本的 Android SDK Build-Tools 23.0.2。

新版本

并记住在两个项目中将您的 buildToolsVersion "23.0.1" 更改为 "23.0.2"

于 2015-12-05T21:48:02.243 回答