Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio: Error Code: -1073741819 - Using ABS, ViewPagerIndicator,FacebookSDK and cannot build project

So here is the run down: I am importing an existing project from Eclipse into Android Studio by hand. I keep getting this error which prevents me from building my project and my R file is also not generated:

The error ( Full stacktrace is at the end of this post )

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

my gradle files and stuff: I have an android project with ActionBarSherlock and ViewPagerIndicator, along with the Facebook SDK. I am referencing the ViewPagerIndicator and Facebook libraries externally like so:

hierarchy

Then I am using this app/gradle.build file to install the Actionbarsherlock and compile the libraries:

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

This is my settings.gradle file:

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

This is my libraries' gradle files:

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']
        }
    }
}

Error after executing : 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).
like image 597
Georgi Angelov Avatar asked Nov 11 '22 13:11

Georgi Angelov


1 Answers

Had the same error (at least according to error code):

Error:Execution failed for task :app:processSandboxAllChecksOffDebugResources'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: ....... ....... ....... android\app\build\intermediates\symbols\sandboxAllChecksOff\debug Error Code: -1073741819

The problem was due to an extra file in my resource folder (res/drawable-xxhdpi). I occasionally put zip file there.

To fix the problem I had to:

  1. Remove invalid file (zip file in my case, can be something different in yours)
  2. Clean project
like image 194
GregoryK Avatar answered Nov 15 '22 11:11

GregoryK