Android工作室:错误代码:-1073741819 - 使用ABS,ViewPagerIndicator,FacebookSDK并且无法构建项目

时间:2014-02-12 22:02:48

标签: compiler-errors gradle android-studio android-gradle

所以这是向下运行:我正在手动将Eclipse中的现有项目导入Android Studio。我一直收到这个错误,导致我无法构建项目,也没有生成我的R文件:

错误(完整的堆栈跟踪位于此帖子的末尾)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
  

com.android.ide.common.internal.LoggedErrorException:无法运行命令:           C:\ android-sdk \ build-tools \ 19.0.1 \ aapt.exe包-f --no-crunch -IC:\ android-sdk \ platforms \ android-19 \ android.jar -MC:\ Users \ MyUserName \工作区   Eclipse \ CrazyApp \ app \ build \ manifests \ debug \ AndroidManifest.xml -S C:\ Users \ MyUserName \ workspaceEclipse \ CrazyApp \ app \ build \ res \ all \ debug -A C:\ Users \ MyUserName \ _contersE   clipse \ CrazyApp \ app \ build \ assets \ debug -m -J C:\ Users \ MyUserName \ workspaceEclipse \ CrazyApp \ app \ build \ source \ r \ _ debug -F C:\ Users \ MyUserName \ workspaceEclipse \ CrazyApp \ app \ bui   ld \ libs \ app-debug.ap_ --debug-mode --custom-package com.CrazyApp --output-text-symbols C:\ Users \ MyUserName \ workspaceEclipse \ CrazyApp \ app \ build \ symbols \ debug   错误代码:           -1073741819

我的gradle文件和内容: 我有一个带有ActionBarSherlock和ViewPagerIndicator的android项目,以及Facebook SDK。我在外部引用ViewPagerIndicator和Facebook库:

hierarchy

然后我使用 app / gradle.build 文件来安装Actionbarsherlock并编译库:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.0.1'

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 17
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.google.android.gms:play-services:4.0.30'
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile project(':libraries:facebook')
    compile project(':libraries:ViewPagerIndicator')
}

enter image description here

这是我的settings.gradle文件:

include ':app', ':libraries:facebook', ':libraries:ViewPagerIndicator'

这是我的图书馆的gradle文件:

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

apply plugin: 'android-library'

dependencies {
    compile 'com.android.support:support-v4:18+'
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.1"

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 17
    }

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

执行后出错:gradlew --stacktrace --info

.....more skipped tasks before that....
Skipping task ':app:processDebugManifest' as it is up-to-date (took 0.008 secs).
:app:processDebugManifest UP-TO-DATE  
:app:processDebugManifest (Thread[main,5,main]) completed. Took 0.024 secs.
:app:processDebugResources (Thread[main,5,main]) started.
:app:processDebugResources             
Executing task ':app:processDebugResources' (up-to-date check took 0.265 secs) due to:
  No history is available.             
All input files are considered out-of-date for incremental task ':app:processDebugResources'.
command: C:\android-sdk\build-tools\19.0.1\aapt.exe package -f --no-crunch -I C:\android-sdk\platforms\android-19\android.jar -M C:\Users\MyUserName\workspac
eEclipse\CrazyApp\app\build\manifests\debug\AndroidManifest.xml -S C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\res\all\debug -A C:\Users\MyUserName\workspace
Eclipse\CrazyApp\app\build\assets\debug -m -J C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\source\r\debug -F C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\bu
ild\libs\app-debug.ap_ --debug-mode --custom-package com.CrazyApp --output-text-symbols C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\symbols\debug
:app:processDebugResources FAILED      
:app:processDebugResources (Thread[main,5,main]) completed. Took 3.161 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
        C:\android-sdk\build-tools\19.0.1\aapt.exe package -f --no-crunch -I C:\android-sdk\platforms\android-19\android.jar -M C:\Users\MyUserName\workspace
Eclipse\CrazyApp\app\build\manifests\debug\AndroidManifest.xml -S C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\res\all\debug -A C:\Users\MyUserName\workspaceE
clipse\CrazyApp\app\build\assets\debug -m -J C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\source\r\debug -F C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\bui
ld\libs\app-debug.ap_ --debug-mode --custom-package com.CrazyApp --output-text-symbols C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\symbols\debug
Error Code:
        -1073741819


* Try:    
Run with --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:286)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$1.run(DefaultTaskPlanExecutor.java:33)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
        at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:266)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:135)
        at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.j
ava:93)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
        at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.Main.doAction(Main.java:46)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.Main.main(Main.java:37)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: org.gradle.internal.UncheckedException: com.android.ide.common.internal.LoggedErrorException: Failed to run command:
        C:\android-sdk\build-tools\19.0.1\aapt.exe package -f --no-crunch -I C:\android-sdk\platforms\android-19\android.jar -M C:\Users\MyUserName\workspace
Eclipse\CrazyApp\app\build\manifests\debug\AndroidManifest.xml -S C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\res\all\debug -A C:\Users\MyUserName\workspaceE
clipse\CrazyApp\app\build\assets\debug -m -J C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\source\r\debug -F C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\bui
ld\libs\app-debug.ap_ --debug-mode --custom-package com.CrazyApp --output-text-symbols C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\symbols\debug
Error Code:
        -1073741819

        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:70)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.
java:236)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:
212)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.ja
va:223)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:
201)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:530)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:513)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 52 more
Caused by: com.android.ide.common.internal.LoggedErrorException: Failed to run command:
        C:\android-sdk\build-tools\19.0.1\aapt.exe package -f --no-crunch -I C:\android-sdk\platforms\android-19\android.jar -M C:\Users\MyUserName\workspace
Eclipse\CrazyApp\app\build\manifests\debug\AndroidManifest.xml -S C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\res\all\debug -A C:\Users\MyUserName\workspaceE
clipse\CrazyApp\app\build\assets\debug -m -J C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\source\r\debug -F C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\bui
ld\libs\app-debug.ap_ --debug-mode --custom-package com.CrazyApp --output-text-symbols C:\Users\MyUserName\workspaceEclipse\CrazyApp\app\build\symbols\debug
Error Code:
        -1073741819

        at com.android.ide.common.internal.CommandLineRunner.runCmdLine(CommandLineRunner.java:98)
        at com.android.ide.common.internal.CommandLineRunner.runCmdLine(CommandLineRunner.java:69)
        at com.android.builder.AndroidBuilder.processResources(AndroidBuilder.java:728)
        at com.android.builder.AndroidBuilder$processResources.call(Unknown Source)
        at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.groovy:95)
        at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.groovy:64)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
        ... 60 more


BUILD FAILED

Total time: 18.285 secs
Stopped 0 Gradle compiler daemon(s).

1 个答案:

答案 0 :(得分:1)

有相同的错误(至少根据错误代码):

  

错误:任务执行失败   :应用程序:processSandboxAllChecksOffDebugResources&#39 ;.   com.android.ide.common.internal.LoggedErrorException:无法运行   命令:....... ....... .......   安卓\程序\编译\中间体\符号\ sandboxAllChecksOff \调试   错误代码:-1073741819

问题是由于资源文件夹中的额外文件(res / drawable-xxhdpi)。我偶尔会把zip文件放在那里。

要解决我必须解决的问题:

  1. 删除无效文件(在我的情况下为zip文件,可能与您的不同)
  2. 清理项目