Cannot build android project using Android Studio - Gradle 1.7 - android

I'm having lots of problems with Gradle and Android Studio.
Making changes in any resource in the project can randomly give an exception during compilation, this is what i see in Android Studio:
Gradle: Error while executing aapt command
Gradle: Execution failed for task ':App Code:processReleaseResources'.
And this is what i see executing Gradle manually:
"/Applications/Android Studio.app/sdk/tools/templates/gradle/wrapper/gradlew" asD
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:App Code:preBuild UP-TO-DATE
:App Code:preDebugBuild UP-TO-DATE
:App Code:preReleaseBuild UP-TO-DATE
:libraries:facebook:compileLint
:libraries:facebook:copyReleaseLint UP-TO-DATE
:libraries:facebook:mergeReleaseProguardFiles UP-TO-DATE
:libraries:facebook:packageReleaseAidl UP-TO-DATE
:libraries:facebook:preBuild UP-TO-DATE
:libraries:facebook:preReleaseBuild UP-TO-DATE
:libraries:facebook:prepareReleaseDependencies
:libraries:facebook:compileReleaseAidl UP-TO-DATE
:libraries:facebook:compileReleaseRenderscript UP-TO-DATE
:libraries:facebook:generateReleaseBuildConfig UP-TO-DATE
:libraries:facebook:mergeReleaseAssets UP-TO-DATE
:libraries:facebook:mergeReleaseResources UP-TO-DATE
:libraries:facebook:processReleaseManifest UP-TO-DATE
:libraries:facebook:processReleaseResources UP-TO-DATE
:libraries:facebook:generateReleaseSources UP-TO-DATE
:libraries:facebook:compileRelease UP-TO-DATE
:libraries:facebook:processReleaseJavaRes UP-TO-DATE
:libraries:facebook:packageReleaseJar UP-TO-DATE
:libraries:facebook:packageReleaseLocalJar UP-TO-DATE
:libraries:facebook:packageReleaseRenderscript UP-TO-DATE
:libraries:facebook:packageReleaseResources UP-TO-DATE
:libraries:facebook:bundleRelease UP-TO-DATE
:App Code:prepareComAndroidSupportAppcompatV71800Library UP-TO-DATE
:App Code:prepareComGoogleAndroidGmsPlayServices3136Library UP-TO-DATE
:App Code:prepareLatestUpdateLibrariesFacebookUnspecifiedLibrary UP-TO-DATE
:App Code:prepareDebugDependencies
:App Code:compileDebugAidl
:App Code:compileDebugRenderscript
:App Code:generateDebugBuildConfig
:App Code:mergeDebugAssets
:App Code:mergeDebugResources
:App Code:processDebugManifest
:App Code:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':App Code:processDebugResources'.
> Failed to run command:
/Applications/Android Studio.app/sdk/build-tools/android-4.2.2/aapt package -f --no-crunch -I /Applications/Android Studio.app/sdk/platforms/android-17/android.jar -M /Users/oslinux/Documents/workspace/Appme-android/latest-update/App Code/build/manifests/debug/AndroidManifest.xml -S /Users/oslinux/Documents/workspace/Appme-android/latest-update/App Code/build/res/all/debug -A /Users/oslinux/Documents/workspace/Appme-android/latest-update/App Code/build/assets/debug -m -J /Users/oslinux/Documents/workspace/Appme-android/latest-update/App Code/build/source/r/debug -F /Users/oslinux/Documents/workspace/Appme-android/latest-update/App Code/build/libs/App Code-debug.ap_ --debug-mode --custom-package com.floaty.App --output-text-symbols /Users/oslinux/Documents/workspace/Appme-android/latest-update/App Code/build/symbols/debug
Error Code:
139
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 20.268 secs
host-005:App Code oslinux$
Executing Gradle with --stacktrace this is the output exception:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':VMS Code: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.changedetection.state.CacheLockReleasingTaskExecuter$1.run(CacheLockReleasingTaskExecuter.java:35)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:179)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:232)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskExecuter.execute(CacheLockReleasingTaskExecuter.java:33)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.ContextualisingTaskExecuter.execute(ContextualisingTaskExecuter.java:34)
at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskExecuter$1.run(CacheLockAcquiringTaskExecuter.java:39)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskExecuter.execute(CacheLockAcquiringTaskExecuter.java:37)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:282)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.executeTask(DefaultTaskPlanExecutor.java:48)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.processTask(DefaultTaskPlanExecutor.java:34)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:27)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:89)
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.api.internal.changedetection.state.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.state.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.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:48)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
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:26)
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: com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Applications/Android Studio.app/sdk/build-tools/android-4.2.2/aapt package -f --no-crunch -I /Applications/Android Studio.app/sdk/platforms/android-17/android.jar -M /Users/oslinux/Documents/workspace/vmsme-android/latest-update/VMS Code/build/manifests/debug/AndroidManifest.xml -S /Users/oslinux/Documents/workspace/vmsme-android/latest-update/VMS Code/build/res/all/debug -A /Users/oslinux/Documents/workspace/vmsme-android/latest-update/VMS Code/build/assets/debug -m -J /Users/oslinux/Documents/workspace/vmsme-android/latest-update/VMS Code/build/source/r/debug -F /Users/oslinux/Documents/workspace/vmsme-android/latest-update/VMS Code/build/libs/VMS Code-debug.ap_ --debug-mode --custom-package com.floaty.vms --output-text-symbols /Users/oslinux/Documents/workspace/vmsme-android/latest-update/VMS Code/build/symbols/debug
Error Code:
139
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:617)
at com.android.builder.AndroidBuilder$processResources.call(Unknown Source)
at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.groovy:91)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.groovy:71)
at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:216)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:122)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
at com.android.build.gradle.tasks.ProcessAndroidResources_Decorated.invokeMethod(Unknown Source)
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:217)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:199)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:526)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:509)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 70 more
BUILD FAILED
Total time: 14.276 secs
host-005:VMS Code oslinux$
I'm using Android Studio 0.2.13
How can i solve those problems?
EDIT: this is my build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
classpath 'com.newrelic.agent.android:agent-gradle-plugin:2.397.0'
}
}
repositories {
mavenCentral()
maven {
url 'http://www.bugsense.com/gradle/'
}
}
apply plugin: 'android'
apply plugin: 'newrelic'
dependencies {
compile 'com.newrelic.agent.android:android-agent:2.397'
compile 'com.android.support:support-v4:18.0.+'
compile 'com.android.support:appcompat-v7:18.0.+'
compile 'com.intellij:annotations:12.+'
compile 'com.bugsense.trace:bugsense:3.5'
compile 'com.google.android.gms:play-services:3.1.+'
compile 'net.hockeyapp.android:HockeySDK:3.0.+'
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':libraries:facebook')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
}
signingConfigs {
release {
storeFile file("/Users/oslinux/Documents/Chiavi Android/Sv01")
storePassword "******"
keyAlias "sv01"
keyPassword "******"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
debuggable true
jniDebugBuild false
}
}
}
UPDATE
I tried manually executing aapt, getting the full command from the error message that gradle spits, it failed with:
Segmentation fault: 11
But once in a while it runs correctly and creates the package.
No errors other than "Segmentation fault: 11" are shown.
This is the command i'm trying to execute:
"/Applications/Android Studio.app/sdk/build-tools/android-4.2.2/aapt"
package -vv -f -a --no-crunch
-I "/Applications/Android Studio.app/sdk/platforms/android-17/android.jar"
-M "/Users/oslinux/Documents/workspace/app-android/latest-update/App Code/build/manifests/release/AndroidManifest.xml"
-S "/Users/oslinux/Documents/workspace/app-android/latest-update/App Code/build/res/all/release"
-A "/Users/oslinux/Documents/workspace/app-android/latest-update/App Code/build/assets/release"
-m -J "/Users/oslinux/Documents/workspace/app-android/latest-update/App Code/build/source/r/release"
-F "/Users/oslinux/Documents/workspace/app-android/latest-update/App Code/build/libs/App Code-release.ap_"
--debug-mode --custom-package com.appandroid.app
--output-text-symbols "/Users/oslinux/Documents/workspace/app-android/latest-update/App Code/build/symbols/release"
FINAL UPDATE
It finally seems like i solved this issue cleaning up my resources, removing some unused XML and an unused theme. This obviously does not answer this question that i guess is of common interest.
Navigating the web i found that AAPT is know to fail with SegFault11, and often it does not give any information about the real error which can be caused by:
+id in Styles
Duplicated resources / libraries
unknown, like mine
So it would be useful to:
1. Find a way to identify the real cause of this error
2. Wait for an update to AAPT that returns some error message
3. Write a list of possible common causes.

I'm copying here my final update as an answer.
It finally seems like i solved this issue cleaning up my resources, removing some unused XML and an unused theme. This obviously does not answer this question that i guess is of common interest.
Navigating the web i found that AAPT is know to fail with SegFault11, and often it does not give any information about the real error which can be caused by:
Malformed Resources (Missing attributes, wrong tags, etc...)
+id in Styles
Duplicated resources / libraries
Declare-Styleable missing name
Resource missmatch, try to use different AAPT versions.
unknown, like mine
So it would be useful to: 1. Find a way to identify the real cause of this error 2. Wait for an update to AAPT that returns some error message 3. Write a list of possible common causes.
As Dale Cooper suggested, you could also try to run Lint and see if it finds any warning about resources.
I'm trying to find links to users experiencing those other causes (It's been some time since the original question), i will update this answer when i'll find them back.

I just had sort of the same problem, but on the processDebugResources step. After a couple of hours I started to try running diffrent verisons of aapt (/build-tools/[version]/aapt) and it turns out that they give one hell of different error messages. The one I was originally using was 19.0.1 which only gave me Segmentation fault but when i tried out 18.1.1 I was suddenly pointed to a line in a menu.xml which had a resource missmatch. The problem turns out to be that I hade removed the default #string/action_settings because I thought I didn't use it.
Conclusion, trying different versions of aapt may help you find a resource missmatch.

Yeah, I was just struggling with similiar issue. It turned out that I've got some non-finished code in menu.xml file:
<item android:id="#+id/action_search"
android:title="#string/action_search"
android:icon="#drawable/"
app:showAsAction="ifRoom|collapseActionView"
/>
exactly this line was missing drawable reference:
android:icon="#drawable/"
I found it through running Lint (Analyze -> Inspect code) and it was in Android -> Android Resource Validation as Cannot resolve symbol '#drawable/'

I had the same issue and it was a very very hard to locate it.
I want to share the steps I made to locate and solve this problem.
My gradle ouput looks like this:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':libs:base:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/opt/android-sdk/build-tools/18.1.1/aapt package -f --no-crunch -I /opt/android-sdk/platforms/android-19/android.jar -M /home/m039/WorkProjects/libs/base/build/bundles/debug/AndroidManifest.xml -S /home/m039/WorkProjects/libs/base/build/res/all/debug -A /home/m039/WorkProjects/libs/base/build/bundles/debug/assets -m -J /home/m039/WorkProjects/libs/base/build/source/r/debug -F /home/m039/WorkProjects/libs/base/build/libs/base-debug.ap_ --debug-mode --non-constant-id --output-text-symbols /home/m039/WorkProjects/libs/base/build/bundles/debug
Error Code:
139
First of all I switched to 18.1.1 version, it didn't helped a lot. Then I tried to add -v flag and run this command:
/opt/android-sdk/build-tools/18.1.1/aapt package -f --no-crunch -I /opt/android-sdk/platforms/android-19/android.jar -M /home/m039/WorkProjects/libs/base/build/bundles/debug/AndroidManifest.xml -S /home/m039/WorkProjects/libs/base/build/res/all/debug -A /home/m039/WorkProjects/libs/base/build/bundles/debug/assets -m -J /home/m039/WorkProjects/libs/base/build/source/r/debug -F /home/m039/WorkProjects/libs/base/build/libs/base-debug.ap_ --debug-mode --non-constant-id --output-text-symbols /home/m039/WorkProjects/libs/base/build/bundles/debug -v
It helped a little, but didn't give a clue about the problem. Then I tried strace and it helped a lot:
strace -s 100 /opt/android-sdk/build-tools/18.1.1/aapt package -f --no-crunch -I /opt/android-sdk/platforms/android-19/android.jar -M /home/m039/WorkProjects/libs/base/build/bundles/debug/AndroidManifest.xml -S /home/m039/WorkProjects/libs/base/build/res/all/debug -A /home/m039/WorkProjects/libs/base/build/bundles/debug/assets -m -J /home/m039/WorkProjects/libs/base/build/source/r/debug -F /home/m039/WorkProjects/libs/base/build/libs/base-debug.ap_ --debug-mode --non-constant-id --output-text-symbols /home/m039/WorkProjects/libs/base/build/bundles/debug
In the output of previous command I've found this line:
open("/home/m039/WorkProjects/libs/base/build/res/all/debug/values/values.xml", O_RDONLY|O_LARGEFILE) = 5
In values.xml file I've found all resources, then I started remove tag by tag from the end of the file and execute aapt command above until I found the problem.
My problem was in id resource.

I had this issue after importing the eclipse project.
Issue was from my side. In eclipse, I put a png image in drawable which was actually a jpg image (I just renamed the extension from .jpg to .png).
It was working fine with eclipse but was failing when imported to Android Studio.
Execution failed for task ':app:mergeDebugResources'.
Crunching Cruncher d.png failed
I just deleted the d.png and added a original png file.
It worked!

If you've have imported your Project from Eclipse, then on the Android studio delete resource menu/main.xml and be sure you not have any invalid string resources.
For some reason the gradle cannot validate the menu/main.xml file.

I removed an accidentally added header in the menu xml:
Remove this:
<?xml version="1.0" encoding="utf-8"?>
Leave this:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

So since I had a similar issue I would like to post my solution:
After this error:
failed to capture snapshot of output files for task…
I cleaned my project and it worked again. Why I don't have a clue but it worked. :)

It has happened to me for an Activity declared in the manifest whose title was remove from the string file.
This bug can be Anything related to resources. The best way to find the error is:
Save your code.
Return to the last commit that worked.
Add your resources changes one by one until it fails again.

I have had a similiar issue. I guess it generally happens when there is some incomplete tag or something in the xml or some thing malformed..In my case there issue was with the theme. In design view in android studio in my xml file..i selected a new theme...that way it resolved the issues...hope this helps for all...

I ran into the same problem and issue was with my build directory, currently Android Studio supports directory path less than 100 characters.
Found solution for this:
In root build.gradle
allprojects {
buildDir = "/path/to/build/${rootProject.name}/${project.name}"
}
and docs https://gradle.org/docs/current/userguide/writing_build_scripts.html

run this command in your terminal in respective project.
./gradlew assembleDebug
this will give information about the error.(go line by line to verify)
In my case the error is related to JAR file that i have included in my gradle file.Finally removing the jar file solved the problem.

Related

w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

Performing ./gradlew assembleRelease and hit the issue of this. Below shows the entire error log...
> Task :app:mergeDexRelease FAILED
java.nio.file.NoSuchFileException: /Users/path/Desktop/project/android/app/build/intermediates/external_file_lib_dex_archives/release/out
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:412)
at java.base/java.nio.file.Files.newDirectoryStream(Files.java:472)
at java.base/java.nio.file.Files.list(Files.java:3699)
at com.android.build.gradle.internal.tasks.DexMergingParams.getAllDexFiles(DexMergingTask.kt:502)
at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:423)
at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:335)
at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:57)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:198)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:834)
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDexRelease'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> java.nio.file.NoSuchFileException: /Users/path/Desktop/project/android/app/build/intermediates/external_file_lib_dex_archives/release/out
Some story
During the debugging of this "multiple Koltin" issue, I found out that my NDK wasn't install. Hence I went to SDK Manager and install the NDK (Side by side). Then issue of toolchain occurred, shown as below.
No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi
Fixed was done by downloading older NDK version, android-ndk-r19c and pointed the NDK path in my local.properties.
Local.properties
sdk.dir=/Users/path/Library/Android/sdk
ndk.dir=/Users/path/Library/Android/android-ndk-r19c
TLDR
What I've tried
./gradlew clean && ./gradlew assembleRelease
Appending the following code + Step 1
# FILE 1: Gradle.properties
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# FILE 2: app/build.gradle ( under android{} )
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
My project env
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
My Project Structure
Any idea what causes this issue and how to fix this? 🆘
UNBELIEVABLE FIXED, seems to be a 63.x issue? As there's another person having this issue after upgrading from 62.2 to 63.3
The fixed was done as suggested here
Solved this issue by deleting the .gradle folder from /android and again run npm run android, and it solved this error.
I solve this issue with this solution.
In gradle.properties add following code
org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Additionally, insert these lines in app/build.gradle
android{
dexOptions {
javaMaxHeapSize "3g"
}
}
After making these changes run .\gradle clean and .\gradle assembleRelease
Just deleting the .gradle folder did not resolve this issue in my case.
But after executing ./gradlew clean in the android folder as suggested here I'm back on track 🚀
seems like running ./gradlew -stop inside android folder is working for me
What resolved this error for me, was killing all running Java processes in Task Manager.
I had an actual bug in my code, which caused dangling processes, so I was getting only this error and not the one related to the bug.
After killing all processes & running the usual gradle cleanup, I got the right error message I could work with further.
just reboot!
it worked for my case
Kotlin gradle compilation is kind of borken in 1.1.2
https://discuss.kotlinlang.org/t/kotlin-gradle-compilation-is-kind-of-borken-in-1-1-2/2527
Add :
kotlin.incremental=false
to your gradle.properties file to disable the incremental building.
i have faced same problem with rn 0.67.2 i tried all options mentioned here did not solved, finally i have deleted all java_pid[XXXX].hprof in android folder then all works fine
I use react native 0.67.4
I followed these codes:
cd android
./gradlew clean
cd ..
run this command multiple times:
react-native run-android
it's ridiculous but react-native-maps package can be the cause of this error. and when I ran react-native run-android for the second time it worked for me, but In another post I've read we should it 5-6 times
Simply delete the hidden folder .gradle from your home directory and after that clean your android project with ./gradlew clean and delete your node_modules and re-install your dependencies.
I've tried to answer this in more details here: Multiple Kotlin Daemon Session Error
I also get this error. and easier way to solve this follow the below steps:
Step-1: Terminate/close the running npm.
Step-2: Now go to the project and clean the project by running this command
-- For android --
cd android &&./gradlew clean && cd ../
-- For ios --
cd ios && xcodebuild clean && cd ../
Step-3: Go to the android folder and delete the .gradle folder
Step-4: Now run the command to run android using these command
npm run android
OR
npx react-native run-android
if you are want to build a release apk file then run this command
npx react-native run-android --variant=release
Or to get an aab file the run
cd android &&./gradlew bundleRelease && cd ../
If you are still getting the same error then close the terminal or restart the laptop and follow the same step again
Kill all java processes and try building again.

Why assembleDebug success but assembleRelease failed in react native?

I have tried to assemble my project as a release. But it always failed. Below are some of the script that I use to build my apk as release:-
BUILD SUCCESSFUL
.\gradlew assembleDebug --no-daemon
.\gradlew app:assembleDebug
BUILD FAILED
.\gradlew app:assembleRelease
.\gradlew assembleRelease -x bundleReleaseJsAndAssets
The result of the failed mention on every failed build:-
> Execution failed for task ':app:mergeReleaseResources'
> Task :app:mergeReleaseResources
> FAILED cvc-type.3.1.3: The value '' of element 'id' is not valid.
I also have try to create keystore using keytool and apply it to the signingConfigs in
./android/app/build.gradle
but no success on release. So, I'm reverting and use default debug.keystore value
Referring various answer from forum, SO question, tutorial I have try to apply. I'm totally stuck.
Does anyone face this issue and able to overcome the obstacles?
Edited: Error log when build
Using .\gradlew assembleRelease
D:\Project\Clients\android>.\gradlew assembleRelease
> Configure project :react-native-activity-result
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
> Task :react-native-activity-result:verifyReleaseResources FAILED
> Task :app:bundleReleaseJsAndAssets
Loading dependency graph, done.
info Writing bundle output to:, D:\Project\Clients\android\app\build\generated\assets\react\release\index.android.bundle
info Writing sourcemap output to:, D:\Project\Clients\android\app\build\intermediates\sourcemaps\release\index.android.bundle.packager.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 47 asset files
info Done copying assets
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-activity-result:verifyReleaseResources'.
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values-v26\values-v26.xml:7: error: resource android:attr/colorError not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values-v26\values-v26.xml:11: error: resource android:attr/colorError not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values-v26\values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2734: error: resource android:attr/fontStyle not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2735: error: resource android:attr/font not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2736: error: resource android:attr/fontWeight not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2737: error: resource android:attr/fontVariationSettings not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2738: error: resource android:attr/ttcIndex not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2902: error: resource android:attr/startX not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2905: error: resource android:attr/startY not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2908: error: resource android:attr/endX not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2911: error: resource android:attr/endY not found.
D:\Project\Clients\node_modules\react-native-activity-result\android\build\intermediates\res\merged\release\values\values.xml:2919: error: resource android:attr/offset not found.
error: failed linking references.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2m 54s
210 actionable tasks: 22 executed, 188 up-to-date
D:\Project\Clients\android>
Used to face this, it was an APPT2 issue (at least in my case). From the screenshot shared, it tells you Duplicate resources. This may happen after you performed a js bundling, and few folders with resources were created.
Below's how I take care APPT2 issue:
Try navigating to (android/app/build/intermediates/res/merged/release/
See if there's any drawable-* folder
Perform rm -rf android/app/build/intermediates/res/merged/release/drawable-*)
Try again ./gradlew assembleRelease (you probably still fail to build here)
Back to the same folder, remove .DS_Store
Build again
Hopefully succeed
In some react native version it is a bug. you can do the following:
in the node_modules/react-native folder, find the react.gradle file,
then after the doFirst add the following code:
doLast {
def moveFunc = { resSuffix ->
File originalDir =
file("$buildDir/generated/res/react/release/drawable-${resSuffix}");
if (originalDir.exists()) {
File destDir =
file("$buildDir/../src/main/res/drawable-${resSuffix}");
ant.move(file: originalDir, tofile: destDir);
}
}
moveFunc.curry("ldpi").call()
moveFunc.curry("mdpi").call()
moveFunc.curry("hdpi").call()
moveFunc.curry("xhdpi").call()
moveFunc.curry("xxhdpi").call()
moveFunc.curry("xxxhdpi").call()
}
then you can use the ./gradlew assembleRelease generate the apk.
At the same time, when you want to know what the errr is during the build process, you can use ./gradlew assembleRelease --info commod
I FINALLY CAN CREATE RELEASE APK
Create a keystore by running command keytool -genkey -v -keystore myappkeystore.keystore -alias myappalias-keyalg RSA -keysize 2048 -validity 10000 and place it on .\android\app. Details instruction can be follow from here
Open file named build.gradle and look for section name signingConfigs
Insert below script after debug keyname and replace with what key that you register:-
release {
storeFile file('mycreatedkeystore.keystore')
storePassword 'mypassword'
keyAlias 'mykeyalias'
keyPassword 'mypassword'
}
Open blank notepad and paste below script:-
#echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
if not defined in_subprocess (cmd /k set in_subprocess=y ^& %0 %*) & exit )
set driveName="%CD:~0,2%"
set currentFolder="%~dp0"
setlocal enableextensions enabledelayedexpansion
set /A count=1
set list=
CD %driveName%
echo ===========================================
for /d %%D in (*) do (
set "listName=%%~f"
set list=%listName%%1
rem echo !listName! !
echo !count!^. %%~D
set /a count+=1
)
echo ===========================================
:startAgain
set choice=
set /p choice=Type in target folder from listing to build release APK (e.g. targetfolder):
if not '%choice%'=='' (
if exist %choice% (
set choice=%choice%
CD %choice%
goto performbuild
)
)
echo Invalid directory name!
goto startAgain
:performbuild
echo Script will start build target APK to release on %choice%...
timeout /t 2 /nobreak>nul
call react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
rem start "" %currentFolder%%choice%^\android\app\src\main\res
timeout /t 2 /nobreak>nul
cd %currentFolder%%choice%^\android\app\src\main\res
echo Validating duplicating resources
if exist "drawable-hdpi" rmdir "drawable-hdpi" /q /s
if exist "drawable-mdpi" rmdir "drawable-mdpi" /q /s
if exist "drawable-xhdpi" rmdir "drawable-xhdpi" /q /s
if exist "drawable-xxhdpi" rmdir "drawable-xxhdpi" /q /s
if exist "drawable-xxxhdpi" rmdir "drawable-xxxhdpi" /q /s
if exist "raw" rmdir "raw" /q /s
cd %currentFolder%%choice%^\android
call gradlew assembleRelease -x bundleReleaseJsAndAssets
start "" %currentFolder%%choice%^\android\app\build\outputs\apk\release"
cd %currentFolder%%choice%
:choiceOpt
set /P answ=Build complete. Do you want to rebuild again[Y/N]?
if /I "%answ%" EQU "Y" goto :performbuild
if /I "%answ%" EQU "N" goto :justexit
goto :choiceOpt
:justexit
echo Exiting
timeout /t 2 /nobreak>nul
exit
Save the file with any name and set the extension to .BAT
Place the BAT file on one folder up of your root project e.g.
Your project folder:- C:\Project\Mobile\MyCurrentProject
Your batch file folder:- C:\Project\Mobile\releaseTool.bat
Run the releaseTool.bat and the batch file with build the release version
I search and found several script to accomplish certain oart and combine it to make this batch script for RELEASE APK version
Disclaimer: I'm not an expert to elaborate the process or argue regarding the way I'm doing it (if it is not practical) because I have failed to build what I wanted and pieces-by-pieces solution is combined and become what I provided.

GradleProcessResult.buildProcessException(GradleProcessResult.java:74)

I am in a class for mobile programming and working with Android Studio. For the final project I am making a text "chose your adventure" game. Everything was working until I added a second activity. Then MainActivity.java developed shows an R. cannot be resolved. Questions about this error have been covered several times in these forums and I have tried the solutions given to no avail. I then started going through the stack trace and trying solutions that were given. Also with no success. The last I looked up was this - "at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74)". It was recently asked, but with no answer. I was glad to see that is was a recent problem and that I was not the only one having it. The asker of the question was trying to accomplish something different than I was and was getting a different stack trace so I am hoping that someone will know what I am doing wrong. I do not wish any help in creating my app., just in figuring out why I can not get gradle to play nice with me. Any help would be greatly appreciated.ty
I have updated gradle, studio and android gradle plugin.
log
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:865)
... 86 more
Caused by: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\Admin\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\Admin\AppData\Local\Android\Sdk\platforms\android-25\android.jar -M \?\C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\intermediates\manifests\full\release\AndroidManifest.xml -S C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\intermediates\res\merged\release -m -J \?\C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\generated\source\r\release -F C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\intermediates\res\resources-release.ap_ --custom-package org.naturalattitude.gargoyle -0 apk --output-text-symbols \?\C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\intermediates\symbols\release --no-version-vectors}
at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:49)
at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:78)
at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:74)
at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
at com.android.build.gradle.internal.process.GradleProcessExecutor$1.run(GradleProcessExecutor.java:60)
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Admin\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe'' finished with non-zero exit value 1
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:369)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:47)
... 9 more
Message Gradle Build
Information:Gradle tasks [clean, :app:generateReleaseSources, :app:prepareReleaseUnitTestDependencies, :app:mockableAndroidJar, :app:compileReleaseSources, :app:compileReleaseUnitTestSources]
Error:String types not allowed (at 'fullBackupContent' with value 'Gargoyle').
Error:String types not allowed (at 'fullBackupContent' with value 'Gargoyle').
Error:Execution failed for task ':app:processReleaseResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED
Information:Total time: 13.485 secs
Information:3 errors
Information:0 warnings
Information:See complete output in console
Gradle Console
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:865)
... 86 more
Caused by: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\Admin\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\Admin\AppData\Local\Android\Sdk\platforms\android-25\android.jar -M \?\C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\intermediates\manifests\full\release\AndroidManifest.xml -S C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\intermediates\res\merged\release -m -J \?\C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\generated\source\r\release -F C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\intermediates\res\resources-release.ap_ --custom-package org.naturalattitude.gargoyle -0 apk --output-text-symbols \?\C:\Users\Admin\AndroidStudioProjects\Gargoyle\app\build\intermediates\symbols\release --no-version-vectors}
at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:49)
at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:78)
at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:74)
at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
at com.android.build.gradle.internal.process.GradleProcessExecutor$1.run(GradleProcessExecutor.java:60)
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Admin\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe'' finished with non-zero exit value 1
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:369)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:47)
... 9 more
Sorry for the reports in the question.
Everything was working until I added a second activity. Then MainActivity.java developed shows an R. cannot be resolved.
I think this is the important symptom and any complaints from gradle or other build components are just cascading errors.
The R. namespace contains the visual resources, and when it is not available it means that something failed during compilation of the resouces (like a syntax error or missing end tag in the axml files). You need to figure out why resource compilation fails.
So you said adding a second activity triggered this. The first step should then be to back up to the state before adding this and verify that things work fine. Then you gradually add what you had in small steps to see where it breaks (e.g. add the new activity but comment out all its content. Then uncomment part by part).
If you have committed changes in smaller steps like you should (you DO use a source control system, right?), this should be relatively easily and if you are using git you can use the git bisect command.

travis-ci build keeps failing with ShellCommandUnresponsiveException

I'm trying to get travis-ci to work with my android application. If I only execute assembleDebug it works fine. But I want to run tests too and generate code coverage. This is the config I have right now:
language: android
android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
- platform-tools
- tools
# The BuildTools version used by your project
- build-tools-23.0.1
# The SDK version used to compile your project
- android-23
# Additional components
# - extra-google-google_play_services
# - extra-google-m2repository
- extra-android-m2repository
# - addon-google_apis-google-19
# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-armeabi-v7a-android-23
env:
global:
# install timeout in minutes (2 minutes by default)
- ADB_INSTALL_TIMEOUT=8
before_install:
- chmod +x gradlew
- pip install --user codecov
# Emulator Management: Create, Start and Wait
before_script:
- echo no | android create avd --force --name test --target android-23 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window -no-boot-anim &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew build connectedCheck --stacktrace
# - ./gradlew assembleDebug
after_success:
- codecov
The build keeps failing with ShellCommandUnresponsiveException, even though I have set the ADB_INSTALL_TIMEOUT global variable to 8 (source). The build itself doesn't even run for 8 minutes, so it's weird why it fails.
I tried deleting all the asset files to make the app as small as possible. But that didn't help.
The failed builds can be found here: https://travis-ci.org/Longi94/bptf/branches under the travis branch where I was trying to get it work. There was one successful build. I have no idea how it passed.
Here's a part of a failed build log:
[0K$ echo no | android create avd --force --name test --target android-23 --abi armeabi-v7a
Android 6.0 is a basic Android platform.
Do you wish to create a custom hardware profile [no]Created AVD 'test' based on Android 6.0, ARM (armeabi-v7a) processor,
with the following hardware config:
hw.cpu.model=cortex-a8
hw.lcd.density=240
hw.ramSize=512
vm.heapSize=48
travis_time:end:1030008c:start=1446127538783461373,finish=1446127542625988764,duration=3842527391
[0Ktravis_fold:end:before_script.1
[0Ktravis_fold:start:before_script.2
[0Ktravis_time:start:16b2cef4
[0K$ emulator -avd test -no-skin -no-audio -no-window -no-boot-anim &
travis_time:end:16b2cef4:start=1446127542630405331,finish=1446127542635242867,duration=4837536
[0Ktravis_fold:end:before_script.2
[0Ktravis_fold:start:before_script.3
[0Ktravis_time:start:00e87790
[0K$ android-wait-for-emulator
emulator: WARNING: Increasing RAM size to 1GB
Waiting for emulator to start
Creating filesystem with parameters:
Size: 576716800
Block size: 4096
Blocks per group: 32768
Inodes per group: 7040
Inode size: 256
Journal blocks: 2200
Label:
Blocks: 140800
Block groups: 5
Reserved block group size: 39
Created filesystem with 11/35200 inodes and 4536/140800 blocks
resize2fs 1.42.13 (17-May-2015)
The filesystem is already 140800 (4k) blocks long. Nothing to do!
Creating filesystem with parameters:
Size: 69206016
Block size: 4096
Blocks per group: 32768
Inodes per group: 4224
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 16896
Block groups: 1
Reserved block group size: 7
Created filesystem with 11/4224 inodes and 1302/16896 blocks
emulator: UpdateCheck: current version '24.4.1', last version '24.4.1'
Waiting for emulator to start
... (pruned due to character limit)
Waiting for emulator to start
Emulator is ready
travis_time:end:00e87790:start=1446127542639319959,finish=1446127617455640922,duration=74816320963
[0Ktravis_fold:end:before_script.3
[0Ktravis_fold:start:before_script.4
[0Ktravis_time:start:0b2fd946
[0K$ adb shell input keyevent 82 &
travis_time:end:0b2fd946:start=1446127617473299362,finish=1446127617478276750,duration=4977388
[0Ktravis_fold:end:before_script.4
[0Ktravis_time:start:248749b0
[0K$ ./gradlew build connectedCheck --stacktrace
Downloading https://services.gradle.org/distributions/gradle-2.2.1-all.zip
................................................................................
Unzipping /home/travis/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1-all.zip to /home/travis/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn
Set executable permissions for: /home/travis/.gradle/wrapper/dists/gradle-2.2.1-all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1/bin/gradle
Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.0/gradle-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.0/gradle-core-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder/1.3.0/builder-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.0/lint-24.3.0.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-parent/5.2.1/proguard-parent-5.2.1.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder-model/1.3.0/builder-model-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/1.3.0/builder-test-api-1.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/sdklib/24.3.0/sdklib-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/sdk-common/24.3.0/sdk-common-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/common/24.3.0/common-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/24.3.0/manifest-merger-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/24.3.0/ddmlib-24.3.0.pom
Download https://jcenter.bintray.com/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
Download https://jcenter.bintray.com/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
Download https://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.pom
Download https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom
Download https://jcenter.bintray.com/org/ow2/ow2/1.3/ow2-1.3.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.pom
Download https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.pom
Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/24.3.0/lint-checks-24.3.0.pom
Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.pom
Download https://jcenter.bintray.com/com/android/tools/annotations/24.3.0/annotations-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/24.3.0/layoutlib-api-24.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/dvlib/24.3.0/dvlib-24.3.0.pom
Download https://jcenter.bintray.com/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-parent/33/commons-parent-33.pom
Download https://jcenter.bintray.com/org/apache/apache/13/apache-13.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-client/4.1.1/httpcomponents-client-4.1.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/project/4.1.1/project-4.1.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-client/4.1/httpcomponents-client-4.1.pom
Download https://jcenter.bintray.com/com/google/guava/guava/17.0/guava-17.0.pom
Download https://jcenter.bintray.com/com/google/guava/guava-parent/17.0/guava-parent-17.0.pom
Download https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.3.0/lint-api-24.3.0.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.pom
Download https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcomponents-core/4.1/httpcomponents-core-4.1.pom
Download https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-parent/5/commons-parent-5.pom
Download https://jcenter.bintray.com/org/apache/apache/4/apache-4.pom
Download https://jcenter.bintray.com/commons-codec/commons-codec/1.4/commons-codec-1.4.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-parent/11/commons-parent-11.pom
Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.pom
Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.0/gradle-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.0/gradle-core-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder/1.3.0/builder-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.0/lint-24.3.0.jar
Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder-model/1.3.0/builder-model-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/1.3.0/builder-test-api-1.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/sdklib/24.3.0/sdklib-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/sdk-common/24.3.0/sdk-common-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/common/24.3.0/common-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/24.3.0/manifest-merger-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/24.3.0/ddmlib-24.3.0.jar
Download https://jcenter.bintray.com/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar
Download https://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar
Download https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
Download https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.jar
Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/24.3.0/lint-checks-24.3.0.jar
Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar
Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.jar
Download https://jcenter.bintray.com/com/android/tools/annotations/24.3.0/annotations-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/24.3.0/layoutlib-api-24.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/dvlib/24.3.0/dvlib-24.3.0.jar
Download https://jcenter.bintray.com/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
Download https://jcenter.bintray.com/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.jar
Download https://jcenter.bintray.com/com/google/guava/guava/17.0/guava-17.0.jar
Download https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.3.0/lint-api-24.3.0.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar
Download https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.jar
Download https://jcenter.bintray.com/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar
Download https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
Download https://jcenter.bintray.com/commons-codec/commons-codec/1.4/commons-codec-1.4.jar
Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.jar
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.build/0.7.4.201502262128/org.jacoco.build-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128.jar
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72310Library
:app:prepareComAndroidSupportCardviewV72310Library
:app:prepareComAndroidSupportDesign2310Library
:app:prepareComAndroidSupportRecyclerviewV72310Library
:app:prepareComAndroidSupportSupportV42310Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:unzipJacocoAgent
:app:instrumentDebug
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.ant/0.7.4.201502262128/org.jacoco.ant-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.core/0.7.4.201502262128/org.jacoco.core-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.report/0.7.4.201502262128/org.jacoco.report-0.7.4.201502262128.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-debug-all/5.0.1/asm-debug-all-5.0.1.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-parent/5.0.1/asm-parent-5.0.1.pom
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.ant/0.7.4.201502262128/org.jacoco.ant-0.7.4.201502262128.jar
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.core/0.7.4.201502262128/org.jacoco.core-0.7.4.201502262128.jar
Download https://jcenter.bintray.com/org/jacoco/org.jacoco.report/0.7.4.201502262128/org.jacoco.report-0.7.4.201502262128.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-debug-all/5.0.1/asm-debug-all-5.0.1.jar
:app:preDexDebug
:app:dexDebug
:app:validateDebugSigning
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug
:app:checkReleaseManifest
:app:prepareReleaseDependencies
:app:compileReleaseAidl
:app:compileReleaseRenderscript
:app:generateReleaseBuildConfig
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets
:app:generateReleaseResValues
:app:generateReleaseResources
:app:mergeReleaseResources
:app:processReleaseManifest
:app:processReleaseResources
:app:generateReleaseSources
:app:processReleaseJavaRes UP-TO-DATE
:app:compileReleaseJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources
:app:preDexRelease
:app:dexRelease
:app:packageRelease
:app:assembleRelease
:app:assemble
:app:compileLint
:app:lint
Ran lint on variant release: 102 issues found
Ran lint on variant debug: 102 issues found
Wrote HTML report to file:/home/travis/build/Longi94/bptf/app/build/outputs/lint-results.html
Wrote XML report to /home/travis/build/Longi94/bptf/app/build/outputs/lint-results.xml
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:processDebugUnitTestJavaRes UP-TO-DATE
:app:compileDebugUnitTestJavaWithJavac UP-TO-DATE
:app:compileDebugUnitTestSources UP-TO-DATE
:app:mockableAndroidJar
:app:assembleDebugUnitTest
:app:testDebugUnitTest
:app:preReleaseUnitTestBuild UP-TO-DATE
:app:prepareReleaseUnitTestDependencies
:app:processReleaseUnitTestJavaRes UP-TO-DATE
:app:compileReleaseUnitTestJavaWithJavac UP-TO-DATE
:app:compileReleaseUnitTestSources UP-TO-DATE
:app:assembleReleaseUnitTest
:app:testReleaseUnitTest
:app:test
:app:check
:app:build
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:processDebugAndroidTestJavaRes UP-TO-DATE
:app:compileDebugAndroidTestJavaWithJavac
:app:compileDebugAndroidTestNdk UP-TO-DATE
:app:compileDebugAndroidTestSources
:app:preDexDebugAndroidTest
:app:dexDebugAndroidTest
:app:packageDebugAndroidTest
:app:assembleDebugAndroidTest
:app:connectedDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:connectedDebugAndroidTest'.
> com.android.builder.testing.api.TestException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:connectedDebugAndroidTest'.
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:305)
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.process(DefaultTaskPlanExecutor.java:23)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
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:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
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:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
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.builder.testing.api.TestException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:66)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 47 more
Caused by: com.android.builder.testing.api.TestException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.builder.testing.SimpleTestRunner.runTests(SimpleTestRunner.java:93)
at com.android.build.gradle.internal.tasks.DeviceProviderInstrumentTestTask.runTests(DeviceProviderInstrumentTestTask.java:112)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
... 54 more
Caused by: com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.builder.testing.ConnectedDevice.getDeviceConfig(ConnectedDevice.java:259)
at com.android.builder.testing.api.DeviceConfigProviderImpl.<init>(DeviceConfigProviderImpl.java:36)
at com.android.builder.testing.SimpleTestRunner.runTests(SimpleTestRunner.java:91)
... 56 more
Caused by: com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:511)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:388)
at com.android.ddmlib.Device.executeShellCommand(Device.java:577)
at com.android.builder.testing.ConnectedDevice.executeShellCommand(ConnectedDevice.java:136)
at com.android.builder.testing.ConnectedDevice.getDeviceConfig(ConnectedDevice.java:256)
... 58 more
BUILD FAILED
Total time: 3 mins 27.125 secs
travis_time:end:248749b0:start=1446127617481908384,finish=1446127825369726746,duration=207887818362
[0K
[31;1mThe command "./gradlew build connectedCheck --stacktrace" exited with 1.[0m
Done. Your build exited with 1.
Any help would be appreciated!
EDIT after ProbleSlover's suggestion:
After removing the platform-tools and tools lines. It seemed like the build didn't wait long enough for the emulator to start previously. Now there is a lot of waiting and the build timeouts with the following error:
Waiting for emulator to start
Timeout (360 seconds) reached; failed to start emulator
The command "android-wait-for-emulator" failed and exited with 1 during .
Your build has been stopped.
Short answer
Android Gradle Plugin had a hardcoded timeout value that was too low.
Google fixed it in version 2.0.0-beta3:
Will be in 2.0.0-beta3.
So what do we put in build.gradle to set this timeout value?
Currently it's all attached to android.adbOptions.timeOutInMs.
Sample: Google project Increasing ADB timeout and adding Travis-ci support. It works!
Previous response
You are disabling the boot anim and the android-wait-for-emulator script depends on it, so the default script exits from the loop before the emulator is ready. Read this great explanation.
I wrote about it when the script was bugged here
Now the script works and you only need to delete -no-boot-anim here:
- emulator -avd test -no-skin -no-audio -no-window &
Alternatively, you can disable the boot animation that speeds up it, but you need to modify the script adding the time you know is enough for your emulator to be ready.
Sometimes I do it, like here
# Wait for device ready
function wait-for-device-ready {
local bootanim=""
local failcounter=0
until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb hell getprop init.svc.bootanim 2>&1`
echo "$bootanim"
if [[ "$bootanim" =~ "not found" ]]; then
let "failcounter += 1"
if [[ ${failcounter} -gt 30 ]]; then
echo "Failed to start emulator"
exit 1
fi
fi
sleep 1
done
sleep 30
adb shell input keyevent 82 &
sleep 150
echo "Done"
}
Update: Now that I remember, my response is correct in general but other causes produce this issue, especially on android-23, and it is possible that you still see the same error after using my suggestion, see.
I'm not sure about the other issue regarding the android-23 case, I need to investigate it, but I'm not currently using Travis-ci, only a phew tests. I think android-23 is not preinstalled and you need update tools and platform-tools, sometimes I see some apps crash when my emulator api 23 starts at home, etc. It's hard to know the reason without seeing it, but you can add logs to try to see what is happening, inspect my script for that.
Update2:
Open stackoverflow question and android issue about this error on android-23.
Update3:
Cause: Hardcoded and too low timeout=5, line 256
try {
executeShellCommand("am get-config", receiver, 5, TimeUnit.SECONDS);
return DeviceConfig.Builder.parse(output);
} catch (Exception e) {
throw new DeviceException(e);
}
Error is reproducible locally:
08:22:53.761 [ERROR] [org.gradle.BuildExceptionReporter]
08:22:53.795 " Caused by: com.android.ddmlib.ShellCommandUnresponsiveException
08:22:53.795 " at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:511)
08:22:53.795 " at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:388)
08:22:53.795 " at com.android.ddmlib.Device.executeShellCommand(Device.java:577)
08:22:53.796 " at com.android.builder.testing.ConnectedDevice.executeShellCommand(ConnectedDevice.java:136)
08:22:53.796 " at com.android.builder.testing.ConnectedDevice.getDeviceConfig(ConnectedDevice.java:256) <--------
08:22:53.796 " ... 78 more
Please star this issue, and read the unity3d workaround
Update4:
You can use adb as a work around, I tested it works on Travis:
#!/bin/bash
############ ########### ########## ######### ######## ####### ###### ##### #### ### ## #
##
## ACIB SCRIPT
##
############ ########### ########## ######### ######## ####### ###### ##### #### ### ## #
# Run android tests
function android-test {
adb shell input keyevent 82 &
./gradlew assembleDebug -PdisablePreDex
./gradlew assembleDebugAndroidTest -PdisablePreDex
adb install app/build/outputs/apk/app-debug.apk
adb install app/build/outputs/apk/app-debug-androidTest-unaligned.apk
adb shell pm grant com.google.samples.apps.topeka android.permission.SET_ANIMATION_SCALE
adb shell am instrument -w -e numShards 6 -e shardIndex 0 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 1 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 2 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 3 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 4 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
adb shell am instrument -w -e numShards 6 -e shardIndex 5 -e package com.google.samples.apps.topeka com.google.samples.apps.topeka.test/android.support.test.runner.AndroidJUnitRunner
}
I need to fix it, but the installation is successful, no timeouts.

Build VLC for Android project failed on Ubuntu 12.04

I want to work on the VLC for Android project. So first I need to compile this project, I follow all the steps on https://wiki.videolan.org/AndroidCompile/ but when I do the sh compile.sh -a armeabi-v7a at the end I have this error:
contribs: make failed
Error:Execution failed for task ':libvlc:buildDebugARMv5'. > Process 'command './compile-libvlc.sh'' finished with non-zero exit value 1
I am working with Android Studio.
Update
So I have download a ubuntu 12.04 vm and I have build the VLC android project on it. The same error appear but it told me also that my gettext was to old and it should be at 0.19.1 version or later.
So I quit the VM and I checked my gettext version (0.18.4) on my real machine, I put the gettext update and it is know 0.19.4 version.
I build the project and contribs: make failed error is gone but this is know the new error :
FAILURE: Build failed with an exception.
* Where:
Build file '/home/edouard/3DSoundLabs/android/android/build.gradle' line: 16
* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'android-sdk-manager']
> Specified SDK directory './3DSoundLabs/android/android-sdk-linux/' in 'local.properties' is not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Here is my local.properties and it's seems to be good, I don't understand
local.properties :
sdk.dir=./3DSoundLabs/android/android-sdk-linux/
ndk.dir=./3DSoundLabs/android/android-ndk-r10e/
RESOLVED !!
Okay so for the second error it was just a problem of path, my bad.
Correction :
sdk.dir=../android-sdk-linux/
ndk.dir=../android-ndk-r10e/
So the principal error was my version of gettext that was to old, and I didn't found it at the begening because log did not tell this problem.
You have not mentioned which bit version of Ubuntu you are using and VLC AndroidComile wiki says
very up-to-date versions of those tools.
So I went ahead and tested on 64-bit Ubuntu 14.04.
Here is what I did
Installed minimum required packages:
sudo apt-get update
sudo apt-get install ant autoconf automake autopoint cmake gawk gcc g++ libtool m4 patch pkg-config libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler ragel subversion unzip
Navigated to VLC Android directory and run:
./compile.sh
*** No ANDROID_ABI defined architecture: using ARMv7
inflating: ...
...
:wrapper
BUILD SUCCESSFUL
Total time: 4.992 secs
Downloading https://services.gradle.org/distributions/gradle-2.2.1-bin.zip
...........................................................................
Unzipping /home/<user>/.gradle/wrapper/dists/gradle-2.2.1-bin/88n1whbyjvxg3s40jzz5ur27/gradle-2.2.1-bin.zip to /home/<user>/.gradle/wrapper/dists/gradle-2.2.1-bin/88n1whbyjvxg3s40jzz5ur27
Set executable permissions for: /home/<user>/.gradle/wrapper/dists/gradle-2.2.1-bin/88n1whbyjvxg3s40jzz5ur27/gradle-2.2.1/bin/gradle
------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------
Build time: 2014-11-24 09:45:35 UTC
Build number: none
Revision: 6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a
Groovy: 2.3.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.7.0_80 (Oracle Corporation 24.80-b11)
OS: Linux 3.13.0-53-generic amd64
VLC source not found, cloning
Cloning into 'vlc'...
VLC source found
Configuring
Lots of configuration and make logs
...
make[1]: Leaving directory `/<...>/vlc/android/vlc/extras/tools/cmake'
touch .cmake
You are ready to build VLC and its contribs
Bootstraping
NOTE: GNU gettext appears to be missing or out-of-date.
Please install or update GNU gettext.
Also check if you have cvs, a dependency of autopoint.
Otherwise, you will not be able to build a source tarball.
==============================================================
generating modules/**/Makefile.am
.....
+ autoreconf --install --force --verbose -I m4
autoreconf: Entering directory `.'
autoreconf: running: true --force
....
bin/Makefile.am: installing 'autotools/depcomp'
autoreconf: Leaving directory `.'
+ rm -f po/Makevars.template
+ rm -f stamp-h*
+ set +x
Successfully bootstrapped
Building the contribs
Generating EGL pkg-config file
Generating GLESv2 pkg-config file
Guessing build system... x86_64-linux-gnu
Creating configuration file... config.mak
Bootstrap completed.
Run "make" to start compilation.
Other targets:
* make install same as "make"
* make prebuilt fetch and install prebuilt binaries
* make list list packages
* make fetch fetch required source tarballs
* make fetch-all fetch all source tarballs
* make distclean clean everything and undo bootstrap
* make mostlyclean clean everything except source tarballs
* make clean clean everything
* make package prepare prebuilt packages
curl -f -L -- "http://downloads.videolan.org/pub/contrib/a52dec-0.7.4.tar.gz" > "../../contrib/tarballs/a52dec-0.7.4.tar.gz"
Lots of fetching and cloning
...
Lots of configuration and make logs
...
Libraries have been installed in:
/<...>/vlc/android/vlc/contrib/arm-linux-androideabi/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[4]: Leaving directory `/<...>/vlc/android/vlc/contrib/contrib-android-arm-linux-androideabi/gmp'
make[3]: Leaving directory `/<...>/vlc/android/vlc/contrib/contrib-android-arm-linux-androideabi/gmp'
make[2]: Leaving directory `/<...>/vlc/android/vlc/contrib/contrib-android-arm-linux-androideabi/gmp'
make[1]: Leaving directory `/<...>/vlc/android/vlc/contrib/contrib-android-arm-linux-androideabi/gmp'
touch .gmp
contribs: make failed
make kept failing, but everytime with different libs, and I had to repeat ./compile.sh command several times. But after a similar error with zvbi
make[4]: Leaving directory `/<...>/vlc/android/vlc/contrib/contrib-android-arm-linux-androideabi/zvbi'
make[3]: Leaving directory `/<...>/vlc/android/vlc/contrib/contrib-android-arm-linux-androideabi/zvbi'
make[2]: Leaving directory `/<...>/vlc/android/vlc/contrib/contrib-android-arm-linux-androideabi/zvbi'
make[1]: Leaving directory `/<...>/vlc/android/vlc/contrib/contrib-android-arm-linux-androideabi/zvbi'
touch .zvbi
contribs: make failed
There was a different error message this time:
mkdir -p -- /<...>/vlc/android/vlc/contrib/arm-linux-androideabi/share/aclocal && cd libgpg-error && autoreconf -fiv -I/<...>/vlc/android/vlc/contrib/arm-linux-androideabi/share/aclocal
autoreconf: Entering directory `.'
autoreconf: running: autopoint --force
autopoint: *** The AM_GNU_GETTEXT_VERSION declaration in your configure.ac
file requires the infrastructure from gettext-0.19.3 but this version
is older. Please upgrade to gettext-0.19.3 or newer.
autopoint: *** Stop.
autoreconf: autopoint failed with exit status: 1
make: *** [.gpg-error] Error 1
contribs: make failed
$ gettext --version
gettext (GNU gettext-runtime) 0.18.3
As of this writing even vivid (v0.19.2-2) does not have that high level of gettext. So, I cheated and manually downgraded required gettext version to 0.18:
$ grep --include=configure.ac -rn AM_GNU_GETTEXT_VERSION .
./vlc/configure.ac:439:AM_GNU_GETTEXT_VERSION([0.19.2])
./vlc/contrib/contrib-android-arm-linux-androideabi/gnutls/configure.ac:148:AM_GNU_GETTEXT_VERSION([0.18])
./vlc/contrib/contrib-android-arm-linux-androideabi/libgpg-error/configure.ac:158:AM_GNU_GETTEXT_VERSION([0.19.3])
One more ./compile.sh and bingo:
[armeabi-v7a] SharedLibrary : libvlcjni.so
[armeabi-v7a] Install : libvlcjni.so => libs/armeabi-v7a/libvlcjni.so
rm jni/../../android-libs/libbinder.c jni/../../android-libs/libui.c jni/../../android-libs/libutils.c jni/../../android-libs/libstagefright.c jni/../../android-libs/libcutils.c jni/../../android-libs/libhardware.c jni/../../android-libs/libmedia.c
make: Leaving directory `/<...>/vlc/android/libvlc'
Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.2.1/gradle-1.2.1.pom
...
> Configuring > 0/3 projects > root project
But then it hanged there forever (probably, because of conflict in proxy configurations). ps x revealed:
/bin/sh ./compile.sh
java -Dorg.gradle.appname=gradlew -classpath /<...>/vlc/android/gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain assembleVanillaARMv7Debug
So, I decided to cancel Ctrl+C ./compile.sh and try to import the project to Android Studio.
Launched the AS and chose "Open an existing Android Studio project". AS also fetched some packages from jcenter and bingo (this time for real)!
Information:Gradle tasks [:libvlc:generateDebugSources, :libvlc:generateDebugAndroidTestSources, :vlc-android:generateChromeARMv5DebugSources, :vlc-android:generateChromeARMv5DebugAndroidTestSources]
:libvlc:preBuild UP-TO-DATE
:libvlc:preDebugBuild UP-TO-DATE
:libvlc:checkDebugManifest
:libvlc:prepareDebugDependencies
:libvlc:compileDebugAidl
:libvlc:compileDebugRenderscript
:libvlc:generateDebugBuildConfig
:libvlc:generateDebugAssets UP-TO-DATE
:libvlc:mergeDebugAssets
:libvlc:generateDebugResValues
:libvlc:generateDebugResources
:libvlc:packageDebugResources
:libvlc:processDebugManifest
:libvlc:processDebugResources
:libvlc:generateDebugSources
:libvlc:preDebugAndroidTestBuild UP-TO-DATE
:libvlc:prepareDebugAndroidTestDependencies
:libvlc:compileDebugAndroidTestAidl
:libvlc:compileLint
:libvlc:copyDebugLint UP-TO-DATE
:libvlc:mergeDebugProguardFiles
:libvlc:processDebugJavaRes UP-TO-DATE
:libvlc:compileDebugJava
Note: /<...>/vlc/android/libvlc/src/org/videolan/libvlc/LibVlcUtil.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /<...>/vlc/android/libvlc/src/org/videolan/libvlc/VLCObject.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:libvlc:packageDebugJar
:libvlc:compileDebugNdk UP-TO-DATE
:libvlc:packageDebugJniLibs
:libvlc:packageDebugLocalJar UP-TO-DATE
:libvlc:packageDebugRenderscript UP-TO-DATE
:libvlc:bundleDebug
:libvlc:compileDebugSources
:libvlc:assembleDebug
:libvlc:processDebugAndroidTestManifest
:libvlc:compileDebugAndroidTestRenderscript
:libvlc:generateDebugAndroidTestBuildConfig
:libvlc:generateDebugAndroidTestAssets UP-TO-DATE
:libvlc:mergeDebugAndroidTestAssets
:libvlc:generateDebugAndroidTestResValues
:libvlc:generateDebugAndroidTestResources
:libvlc:mergeDebugAndroidTestResources
:libvlc:processDebugAndroidTestResources
:libvlc:generateDebugAndroidTestSources
:vlc-android:preBuild UP-TO-DATE
:vlc-android:preChromeARMv5DebugBuild UP-TO-DATE
:vlc-android:checkChromeARMv5DebugManifest
:libvlc:copyReleaseLint UP-TO-DATE
:libvlc:mergeReleaseProguardFiles
:libvlc:preReleaseBuild UP-TO-DATE
:libvlc:checkReleaseManifest
:libvlc:prepareReleaseDependencies
:libvlc:compileReleaseAidl
:libvlc:compileReleaseRenderscript
:libvlc:generateReleaseBuildConfig
:libvlc:generateReleaseAssets UP-TO-DATE
:libvlc:mergeReleaseAssets
:libvlc:generateReleaseResValues
:libvlc:generateReleaseResources
:libvlc:packageReleaseResources
:libvlc:processReleaseManifest
:libvlc:processReleaseResources
:libvlc:generateReleaseSources
:libvlc:processReleaseJavaRes UP-TO-DATE
:libvlc:compileReleaseJava
Note: /<...>/vlc/android/libvlc/src/org/videolan/libvlc/LibVlcUtil.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /<...>/vlc/android/libvlc/src/org/videolan/libvlc/VLCObject.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:libvlc:packageReleaseJar
:libvlc:compileReleaseNdk UP-TO-DATE
:libvlc:packageReleaseJniLibs
:libvlc:packageReleaseLocalJar UP-TO-DATE
:libvlc:packageReleaseRenderscript UP-TO-DATE
:libvlc:bundleRelease
:vlc-android:preChromeARMv5ReleaseBuild UP-TO-DATE
:vlc-android:preChromeARMv6fpuDebugBuild UP-TO-DATE
:vlc-android:preChromeARMv6fpuReleaseBuild UP-TO-DATE
:vlc-android:preChromeARMv6nofpuDebugBuild UP-TO-DATE
:vlc-android:preChromeARMv6nofpuReleaseBuild UP-TO-DATE
:vlc-android:preChromeARMv7DebugBuild UP-TO-DATE
:vlc-android:preChromeARMv7ReleaseBuild UP-TO-DATE
:vlc-android:preChromeARMv8DebugBuild UP-TO-DATE
:vlc-android:preChromeARMv8ReleaseBuild UP-TO-DATE
:vlc-android:preChromeMIPS64DebugBuild UP-TO-DATE
:vlc-android:preChromeMIPS64ReleaseBuild UP-TO-DATE
:vlc-android:preChromeMIPSDebugBuild UP-TO-DATE
:vlc-android:preChromeMIPSReleaseBuild UP-TO-DATE
:vlc-android:preChromeX86DebugBuild UP-TO-DATE
:vlc-android:preChromeX86ReleaseBuild UP-TO-DATE
:vlc-android:preChromeX86_64DebugBuild UP-TO-DATE
:vlc-android:preChromeX86_64ReleaseBuild UP-TO-DATE
:vlc-android:preTvARMv5DebugBuild UP-TO-DATE
:vlc-android:preTvARMv5ReleaseBuild UP-TO-DATE
:vlc-android:preTvARMv6fpuDebugBuild UP-TO-DATE
:vlc-android:preTvARMv6fpuReleaseBuild UP-TO-DATE
:vlc-android:preTvARMv6nofpuDebugBuild UP-TO-DATE
:vlc-android:preTvARMv6nofpuReleaseBuild UP-TO-DATE
:vlc-android:preTvARMv7DebugBuild UP-TO-DATE
:vlc-android:preTvARMv7ReleaseBuild UP-TO-DATE
:vlc-android:preTvARMv8DebugBuild UP-TO-DATE
:vlc-android:preTvARMv8ReleaseBuild UP-TO-DATE
:vlc-android:preTvMIPS64DebugBuild UP-TO-DATE
:vlc-android:preTvMIPS64ReleaseBuild UP-TO-DATE
:vlc-android:preTvMIPSDebugBuild UP-TO-DATE
:vlc-android:preTvMIPSReleaseBuild UP-TO-DATE
:vlc-android:preTvX86DebugBuild UP-TO-DATE
:vlc-android:preTvX86ReleaseBuild UP-TO-DATE
:vlc-android:preTvX86_64DebugBuild UP-TO-DATE
:vlc-android:preTvX86_64ReleaseBuild UP-TO-DATE
:vlc-android:preVanillaARMv5DebugBuild UP-TO-DATE
:vlc-android:preVanillaARMv5ReleaseBuild UP-TO-DATE
:vlc-android:preVanillaARMv6fpuDebugBuild UP-TO-DATE
:vlc-android:preVanillaARMv6fpuReleaseBuild UP-TO-DATE
:vlc-android:preVanillaARMv6nofpuDebugBuild UP-TO-DATE
:vlc-android:preVanillaARMv6nofpuReleaseBuild UP-TO-DATE
:vlc-android:preVanillaARMv7DebugBuild UP-TO-DATE
:vlc-android:preVanillaARMv7ReleaseBuild UP-TO-DATE
:vlc-android:preVanillaARMv8DebugBuild UP-TO-DATE
:vlc-android:preVanillaARMv8ReleaseBuild UP-TO-DATE
:vlc-android:preVanillaMIPS64DebugBuild UP-TO-DATE
:vlc-android:preVanillaMIPS64ReleaseBuild UP-TO-DATE
:vlc-android:preVanillaMIPSDebugBuild UP-TO-DATE
:vlc-android:preVanillaMIPSReleaseBuild UP-TO-DATE
:vlc-android:preVanillaX86DebugBuild UP-TO-DATE
:vlc-android:preVanillaX86ReleaseBuild UP-TO-DATE
:vlc-android:preVanillaX86_64DebugBuild UP-TO-DATE
:vlc-android:preVanillaX86_64ReleaseBuild UP-TO-DATE
:vlc-android:prepareAndroidLibvlcUnspecifiedLibrary
:vlc-android:prepareComAndroidSupportAppcompatV72211Library
:vlc-android:prepareComAndroidSupportCardviewV72211Library
:vlc-android:prepareComAndroidSupportRecyclerviewV72211Library
:vlc-android:prepareComAndroidSupportSupportV42211Library
:vlc-android:prepareChromeARMv5DebugDependencies
:vlc-android:compileChromeARMv5DebugAidl
:vlc-android:compileChromeARMv5DebugRenderscript
:vlc-android:generateChromeARMv5DebugBuildConfig
:vlc-android:generateChromeARMv5DebugAssets UP-TO-DATE
:vlc-android:mergeChromeARMv5DebugAssets
:vlc-android:generateChromeARMv5DebugResValues
:vlc-android:generateChromeARMv5DebugResources
:vlc-android:mergeChromeARMv5DebugResources
:vlc-android:processChromeARMv5DebugManifest
:vlc-android:processChromeARMv5DebugResources
warning: string 'advanced_debugging' has no default translation.
warning: string 'beta_warning' has no default translation.
warning: string 'enable_iomx' has no default translation.
warning: string 'enable_wheel_bar' has no default translation.
warning: string 'filebrowser_title' has no default translation.
warning: string 'main_prefs_category' has no default translation.
warning: string 'new_app' has no default translation.
warning: string 'new_app_go' has no default translation.
warning: string 'new_app_msg' has no default translation.
:vlc-android:generateChromeARMv5DebugSources
:vlc-android:preChromeARMv5DebugAndroidTestBuild UP-TO-DATE
:vlc-android:prepareChromeARMv5DebugAndroidTestDependencies
:vlc-android:compileChromeARMv5DebugAndroidTestAidl
:vlc-android:processChromeARMv5DebugAndroidTestManifest
:vlc-android:compileChromeARMv5DebugAndroidTestRenderscript
:vlc-android:generateChromeARMv5DebugAndroidTestBuildConfig
:vlc-android:generateChromeARMv5DebugAndroidTestAssets UP-TO-DATE
:vlc-android:mergeChromeARMv5DebugAndroidTestAssets
:vlc-android:generateChromeARMv5DebugAndroidTestResValues
:vlc-android:generateChromeARMv5DebugAndroidTestResources
:vlc-android:mergeChromeARMv5DebugAndroidTestResources
:vlc-android:processChromeARMv5DebugAndroidTestResources
:vlc-android:generateChromeARMv5DebugAndroidTestSources
Information:BUILD SUCCESSFUL
Information:Total time: 22.922 secs
Information:0 errors
Information:0 warnings
Information:See complete output in console
Pressed Shift+F10 and:
Uploading file
local path: /<...>/vlc/android/vlc-android/build/outputs/apk/VLC-Android-CHROME-1.4.0-ARMv5.apk
remote path: /data/local/tmp/org.videolan.vlc.debug
Installing org.videolan.vlc.debug
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/org.videolan.vlc.debug"
pkg: /data/local/tmp/org.videolan.vlc.debug
Success
Launching application: org.videolan.vlc.debug/org.videolan.vlc.gui.MainActivity.
DEVICE SHELL COMMAND: am start -n "org.videolan.vlc.debug/org.videolan.vlc.gui.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=org.videolan.vlc.debug/org.videolan.vlc.gui.MainActivity }
I put abundant information and logs here with the hope that this will be helpful for others.
On 64-bit Ubuntu 15.04 (Vivid) is buil succesfull without using Android studio. Is needed only change this line:
from
AM_GNU_GETTEXT_VERSION([0.19.3])
to
AM_GNU_GETTEXT_VERSION([0.19.2])
in
./vlc/contrib/contrib-android-arm-linux-androideabi/libgpg-error/configure.ac
after this fail:
make: *** [.gpg-error] Error 1
contribs: make failed
As suggested: ozbek.
I was stuck at:
contribs: make failed
I found another guide which helped me get this build working correctly.
The part that did it for me was the downloading and installation of protobuf3. Once I did that, vlc built for me.
Here's the snippet from the tutorial that made everything work
Download:
https://github.com/google/protobuf/releases/download/v3.1.0/protobuf-cpp-3.1.0.tar.gz
Then do:
sudo tar zxvf ./protobuf-cpp-3.1.0.tar.gz # decompression
cd ./protobuf-3.1.0/ # Extracted folder
./configure # Run configure
make
make check
sudo make install
make clean
sudo ldconfig # Update shared library cache
After this, running:
./compile.sh
worked correctly.
I have rebuilt libvlc on Ubuntu 14.04 since my attempt above on Ubuntu 16.04, and I noticed that this didn't fix my issue for Ubuntu 14.04. Once I created another Ubuntu 16.04 VM, this seamed to do the trick.
I think it's also related to the gettext program. Libvlc might be requiring a version of gettext only available on 16.04.
Building VLC player is really complex task and takes a lot of time. And error you get it's just first of many errors you'll try to fix on your way.
I'll suggest to you an easy way - not build VLC by yourself. Main ideas is - if you don't want to modify VLC sources it would be enough to get .so file from original VLC.apk(you could just unzip an apk) and copy org.videolan.libvlc.* files from vlc sources in your project.
You could check this project to get an idea how it could work.
After four days of New Year holiday I found the way to build this project.
Thanks ozbek and all helps.
I install ubuntu 15.10 again and clone it from https://github.com/hieu19926/vlc
Because I can't clone from origin site.
Following wiki of vlc to build, and following ozbek above.
Maybe you will have error of curl, following: curl Failed to connect to localhost port 80
or: https://github.com/rvm/rvm/issues/2989
That say: $echo ip4 >> ~/.curlrc
and logout, login again.
After step 2, if you see error of contrib, if it is iconv error, just edit in file: $vi vlc/contrib/src/iconv/rules.mak
line 26: comment out this line:
$(APPLY) $(SRC)/iconv/libiconv-android-ios.patch
And rebuild, it will run longer than before and successfully
Now I continue to find how to import libvlc to android studio T_T, Anyone who can remember some lib to install after build success, Please comment or post here for everyone, thanks!

Categories

Resources