travis-ci build keeps failing with ShellCommandUnresponsiveException - android

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.

Related

Android connectedAndroidTest fails with com.android.ddmlib.InstallException: Unknown failure (Error: failed to write;(No such file or directory))

Until a few weeks ago, my Android connected tests were working correctly. Now I receive the same error whether connected to a physical device or a VM.
In both cases, adb devices shows that ADB is connected.
I'm running the following command line:
./gradlew --rerun-tasks connectedAndroidTest
If I run one of the connected tests from inside Android Studio, it runs. However, I need the command line for automated testing as part of our nightly builds and our release process.
Here is the failing output:
> Task :app:connectedDebugAndroidTest
03:55:08 V/ddms: execute: running am get-config
03:55:09 V/ddms: execute 'am get-config' on '52007ba3c0fcb457' : EOF hit. Read: -1
03:55:09 V/ddms: execute: returning
03:55:10 V/ddms: execute: running pm install -r -t "/data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#658c9f0e-debug.apk"
03:55:11 V/ddms: execute 'pm install -r -t "/data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#658c9f0e-debug.apk"' on '52007ba3c0fcb457' : EOF hit. Read: -1
03:55:11 V/ddms: execute: returning
Unable to install /home/smm/hcs/orc.trunk.java11/tablet/android/ORConnect/app/build/outputs/apk/debug/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#658c9f0e-debug.apk
com.android.ddmlib.InstallException: Unknown failure (Error: failed to write; /data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9#658c9f0e-debug.apk (No such file or directory))
at com.android.ddmlib.Device.installRemotePackage(Device.java:1031)
at com.android.ddmlib.Device.installPackage(Device.java:902)
at com.android.ddmlib.Device.installPackage(Device.java:880)
at com.android.ddmlib.Device.installPackage(Device.java:869)
at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:126)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:147)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:59)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
com.android.builder.testing.ConnectedDevice > runTests[SM-T580 - 7.0] FAILED
com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure (Error: failed to write; /data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9#658c9f0e-debug.apk (No such file or directory))
at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:132)
03:55:11 I/XmlResultReporter: XML test result file generated at /home/smm/hcs/orc.trunk.java11/tablet/android/ORConnect/app/build/outputs/androidTest-results/connected/TEST-SM-T580 - 7.0-app-.xml. Total tests 1, failure 1,
> Task :app:connectedDebugAndroidTest FAILED
[no message defined]
java.lang.RuntimeException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure (Error: failed to write; /data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9#658c9f0e-debug.apk (No such file or directory))
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure (Error: failed to write; /data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9#658c9f0e-debug.apk (No such file or directory))
at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:132)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:147)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:59)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
... 4 more
Caused by: com.android.ddmlib.InstallException: Unknown failure (Error: failed to write; /data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9#658c9f0e-debug.apk (No such file or directory))
at com.android.ddmlib.Device.installRemotePackage(Device.java:1031)
at com.android.ddmlib.Device.installPackage(Device.java:902)
at com.android.ddmlib.Device.installPackage(Device.java:880)
at com.android.ddmlib.Device.installPackage(Device.java:869)
at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:126)
... 7 more
The file it is trying to install does in fact exist:
ls -l /home/smm/hcs/orc.trunk.java11/tablet/android/ORConnect/app/build/outputs/apk/debug/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9\$_run_closure1\$_closure5#658c9f0e-debug.apk
-rw-rw-r-- 1 smm smm 15684152 Sep 11 15:55 '/home/smm/hcs/orc.trunk.java11/tablet/android/ORConnect/app/build/outputs/apk/debug/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#658c9f0e-debug.apk'
At this point, I'm baffled as to why Gradle is failing. Any ideas?
Update 1
Gradle version:
smm#smm-HP-ZBook-15-G2:~/hcs/orc.trunk.java11/tablet/android/ORConnect$ ./gradlew --version
------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------
Build time: 2018-02-28 13:36:36 UTC
Revision: 8fa6ce7945b640e6168488e4417f9bb96e4ab46c
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_181 (Oracle Corporation 25.181-b13)
OS: Linux 4.15.0-54-generic amd64
I'm trying to run the tests on these devices:
Samsung Galaxy Tab A 10.1 - (SM-T580) - Android 7.0
Virtual Box VM (2 CPUs, 2 Gigs Ram - 8 Gigs Hard Drive) - Android 7.1 (from http://www.android-x86.org/)
Update 2
Martin Zeitler suggested trying adb push and see what happens. Oddly, it succeeds:
smm#smm-HP-ZBook-15-G2:~/bin$ adb push /home/smm/hcs/orc.trunk.java11/tablet/android/ORConnect/app/build/outputs/apk/debug/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9\$_run_closure1\$_closure5#2542336c-debug.apk /data/local/tmp/test.apk
/home/smm/hcs/orc.trunk.java11/tablet/android/ORConne...: 1 file pushed. 17.3 MB/s (15684098 bytes in 0.864s)
I can access the directory with adb shell too:
smm#smm-HP-ZBook-15-G2:~/bin$ adb shell
gtaxlwifi:/ $ cd /data/local/tmp
gtaxlwifi:/data/local/tmp $ ls
ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#50729ffc-debug.apk
ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#658c9f0e-debug.apk
Update 3
It is worth noting that it isn't just my laptop that experiences the problem, but also I our build system (Jenkins under Windows vs. my laptop under Windows).
Update 4
Additional logging turned on:
> Task :app:installDebug
Task ':app:installDebug' is not up-to-date because:
Executed with '--rerun-tasks'.
02:40:41 V/ddms: execute: running am get-config
02:40:42 V/ddms: execute 'am get-config' on '52007ba3c0fcb457' : EOF hit. Read: -1
02:40:42 V/ddms: execute: returning
Installing APK 'ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#58873f75-debug.apk' on 'SM-T580 - 7.0' for app:debug
02:40:42 D/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#58873f75-debug.apk: Uploading ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#58873f75-debug.apk onto device '52007ba3c0fcb457'
02:40:42 D/Device: Uploading file onto device '52007ba3c0fcb457'
02:40:42 D/ddms: Reading file permision of /home/smm/hcs/orc.trunk.java11/tablet/android/ORConnect/app/build/outputs/apk/debug/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#58873f75-debug.apk as: rw-rw-r--
02:40:43 V/ddms: execute: running pm install -r -t "/data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#58873f75-debug.apk"
02:40:44 V/ddms: execute 'pm install -r -t "/data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#58873f75-debug.apk"' on '52007ba3c0fcb457' : EOF hit. Read: -1
02:40:44 V/ddms: execute: returning
Unable to install /home/smm/hcs/orc.trunk.java11/tablet/android/ORConnect/app/build/outputs/apk/debug/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#58873f75-debug.apk
com.android.ddmlib.InstallException: Unknown failure (Error: failed to write; /data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9#58873f75-debug.apk (No such file or directory))
at com.android.ddmlib.Device.installRemotePackage(Device.java:1031)
at com.android.ddmlib.Device.installPackage(Device.java:902)
at com.android.ddmlib.Device.installPackage(Device.java:880)
at com.android.ddmlib.Device.installPackage(Device.java:869)
Running it on my shell prompt gives the same results:
smm#smm-HP-ZBook-15-G2:~/hcs/orc.trunk.java11/tablet/android/ORConnect$ adb shell pm install -r -t "/data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#58873f75-debug.apk"
Error: failed to write; /data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9#58873f75-debug.apk (No such file or directory)
I just noticed that am get-config seems to be failing before the pm install. However, if I run that on the command line, it succeeds:
smm#smm-HP-ZBook-15-G2:~/hcs/orc.trunk.java11/tablet/android/ORConnect$ adb shell am get-config
config: en-rUS-ldltr-sw800dp-w1280dp-h776dp-xlarge-notlong-notround-land-notnight-hdpi-finger-keysexposed-nokeys-navhidden-nonav-v24
abi: armeabi-v7a,armeabi
Update 5
I think I'm getting closer. I can see from the last failed build that it failed with:
03:04:25 V/ddms: execute: running pm install -r -t "/data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#c92421a-debug.apk"
03:04:26 V/ddms: execute 'pm install -r -t "/data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#c92421a-debug.apk"' on '52007ba3c0fcb457' : EOF hit. Read: -1
If I use adb shell ls /data/local/tmp/, I can see that the file does exist. However, if I run:
$ adb shell ls "/data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9$_run_closure1$_closure5#c92421a-debug.apk"
ls: /data/local/tmp/ORConnect-3.1.0-build_st1vdmehqb3wug0ysb60kna9#c92421a-debug.apk: No such file or directory
Note that the file name passed to ls is not the file name ls claims it can't find. My current theory is that Android is not the escaping the $ correctly in the pm install command. Anyone have any ideas where those $s came from or how to get rid of them?
There might not be enough space to upload the package: Error: failed to write; /data/local/tmp/...
From the error message it is just unclear, if the directory or the package does not exist.
It is pretty useless while it only exists in the local file-system, but not the target device file-system, which the error message refers to (you could still try adb push to see what it complains about).
Make sure that adb is even on path, because this could theoretically be another possible reason.
So there are a variety of problems that turned out to be working together to make this hard to figure out.
First, the install is using pm and failing, because the APK being generated has $'s in it. That is a problem only because Gradle/Android/Someone is not smart enough to properly escape those out in the pm command (never mind that the upload to the device worked correctly).
So, where did the $'s come from? Well, turns out they are placeholders for versionName it the defaultConfig. Here is a snippet from the app.gradle file:
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 24
//noinspection OldTargetApi
targetSdkVersion 26
// The versionCode and versionName are defined in the top level (android) build.gradle file.
versionCode versionValue
versionName versionString()
buildConfigField "String", "BUILD_TIMESTAMP", "\""+buildTimeStamp+"\""
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
The value for versionString is generated in the top level gradle file:
def major = rootProject.file('../../../nb/major.dat').text.trim()
def minor = rootProject.file('../../../nb/minor.dat').text.trim()
def patch = rootProject.file('../../../nb/patch.dat').text.trim()
versionString = { major + "." + minor + "." + patch + "-" + revnum };
The versionString is generated using Lazy Property Evaluation (https://reflectoring.io/gradle-lazy-property-evaluation/).
Why did we do this? Well, it turns out this project is connected to a much bigger project, with a Java Server and traditional Java Client. Naturally, it is useful to share code and version information as we build a Server/Client/Android applications at the same time. So, the version information comes from the older (traditional) Server/Client projects (not Android or Gradle related). We read the major, minor, patch and build (SVN revision number) from files. Unfortunately, the last file is generated by the ant scripts that build the traditional projects and may not be present when Gradle is called to build the Android project.
So, we switched to using the lazy property evaluation, which solved our build problem when the file is not present and created this new problem. Switching away from it resolved this particular problem.
Now my top level Gradle build file looks like:
def major = rootProject.file('../../../nb/major.dat').text.trim()
def minor = rootProject.file('../../../nb/minor.dat').text.trim()
def patch = rootProject.file('../../../nb/patch.dat').text.trim()
revnumFile = rootProject.file('../../../nb/build.dat')
// Before adding the Revision Number to our Version String, we need to make sure the file exists
def revnum = '';
if (revnumFile.exists()) {
revnum = revnumFile.text.trim()
}
versionString = major + "." + minor + "." + patch + "-" + revnum

react native run ".\packager\packager.sh" failed

run .\gradlew :Example:UIExplorer:android:app:installDebug
:ReactAndroid:preBuild UP-TO-DATE
:ReactAndroid:preReleaseBuild UP-TO-DATE
:ReactAndroid:compileReleaseNdk UP-TO-DATE
:ReactAndroid:compileLint
...
Installing APK 'app-debug.apk' on 'HTC One - 4.2.2 - API 17 - 1080x1920 - 4.2.2' for app:debug
Installed on 1 device.
BUILD SUCCESSFUL
then ,run .\packager\packager.sh start service.
problem come cross:
Error: Cannot find module 'F:\gitProject\local-cli\cli.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:134:18)
at node.js:962:3
PS:I create 'AwesomeProject' follow the react-native doc works well.

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!

Error with travis-c and appcompat v-21

i wnt to set CI with travis-ci with my android project.
Those are my gradles:
top-level
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
flatDir{
dirs 'libs'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.1'
classpath 'org.robolectric:robolectric-gradle-plugin:0.12.0'
}
}
allprojects {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
Project specific:
apply plugin: 'com.android.application'
apply plugin: 'robolectric'
apply from: 'config/quality.gradle'
dependencies {
compile files('libs/com.mobandme.ada_v2.4.4.jar')
compile 'com.squareup:otto:1.3.5'
compile 'com.google.code.gson:gson:2.3'
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.github.pedrovgs:renderers:1.0.9'
compile 'com.jakewharton:butterknife:5.0.1'
compile 'com.etsy.android.grid:library:1.0.4'
compile 'ch.acra:acra:4.5.0'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.android.support:support-v4:21.0.2'
compile 'com.android.support:cardview-v7:21.0.2'
compile 'com.shamanland:fab:0.0.5'
compile 'com.github.johnkil.android-robototextview:robototextview:2.1.0'
compile 'com.path:android-priority-jobqueue:1.1.2'
compile "com.android.support:appcompat-v7:21.0.2"
compile 'com.jakewharton:disklrucache:2.0.2'
compile 'com.squareup.retrofit:retrofit:1.7.1'
compile 'com.snappydb:snappydb-lib:0.5.0'
compile 'com.esotericsoftware.kryo:kryo:2.24.0'
}
repositories{
flatDir{
dirs 'libs'
}
}
android {
compileSdkVersion 21
buildToolsVersion '21.1.1'
defaultConfig {
minSdkVersion 18
targetSdkVersion 21
versionCode 113
versionName "1.0"
testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
}
signingConfigs {
release {
storeFile file('***')
storePassword '***'
keyAlias '***'
keyPassword '***'
}
}
lintOptions {
disable 'InvalidPackage'
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
productFlavors {}
}
And my travis file
language: java
jdk: oraclejdk7
env:
matrix:
- ANDROID_SDKS=android-21 ANDROID_TARGET=android-21
branches:
only:
- master
before_install:
- chmod +x gradlew
# Install base Android SDK
- wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
- tar xzf android-sdk_r23.0.2-linux.tgz
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
# install android build tools
- wget https://dl-ssl.google.com/android/repository/build-tools_r21.1.1-linux.zip
- unzip build-tools_r21.1.1-linux.zip -d $ANDROID_HOME
- mkdir -p $ANDROID_HOME/build-tools/
- mv $ANDROID_HOME/android-5.0 $ANDROID_HOME/build-tools/21.1.1
- echo yes | android update sdk --filter build-tools-21.1.1 --no-ui --force > /dev/null
- echo yes | android update sdk --filter tools --no-ui --force > /dev/null
- echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null
- echo yes | android update sdk --filter android-21 --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-google-m2repository --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-google-google_play_services --no-ui --force > /dev/null
script:
- TERM=dumb ./gradlew assembleRelease
This is travis output
Using worker: worker-linux-docker-e8480109.prod.travis-ci.com:travis-linux-6
system_info
Build system information
Build language: java
Installing an SSH key from: default repository key
Key fingerprint: c3:f4:e6:fd:0c:b3:83:41:2a:d8:cd:ca:b1:3e:65:ca
git.checkout
1.15s$ git clone --depth=50 --branch=master git#github.com:colymore/firext-android.git colymore/firext-android
Cloning into 'colymore/firext-android'...
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
remote: Counting objects: 2088, done.
remote: Compressing objects: 100% (909/909), done.
remote: Total 2088 (delta 1137), reused 1840 (delta 912)
Receiving objects: 100% (2088/2088), 5.69 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1137/1137), done.
Checking connectivity... done.
$ cd colymore/firext-android
$ git checkout -qf 80a86aee1209b99d40d2b11d08292dba6958dbbd
This job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables. See http://docs.travis-ci.com/user/workers/container-based-infrastructure/ for details.
Setting environment variables from .travis.yml
$ export ANDROID_SDKS=android-21
$ export ANDROID_TARGET=android-21
$ jdk_switcher use oraclejdk7
Switching to Oracle JDK7 (java-7-oracle), JAVA_HOME will be set to /usr/lib/jvm/java-7-oracle
$ export TERM=dumb
$ java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
$ javac -version
javac 1.7.0_60
before_install.1
0.01s$ chmod +x gradlew
before_install.2
1.19s$ wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
--2014-11-30 13:29:31-- http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
Resolving dl.google.com (dl.google.com)... 74.125.228.97, 74.125.228.98, 74.125.228.99, ...
Connecting to dl.google.com (dl.google.com)|74.125.228.97|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 140827643 (134M) [application/x-tar]
Saving to: `android-sdk_r23.0.2-linux.tgz'
100%[======================================>] 140,827,643 118M/s in 1.1s
2014-11-30 13:29:33 (118 MB/s) - `android-sdk_r23.0.2-linux.tgz' saved [140827643/140827643]
before_install.3
1.37s$ tar xzf android-sdk_r23.0.2-linux.tgz
before_install.4
0.00s$ export ANDROID_HOME=$PWD/android-sdk-linux
before_install.5
0.00s$ export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
before_install.6
0.38s$ wget https://dl-ssl.google.com/android/repository/build-tools_r21.1.1-linux.zip
--2014-11-30 13:29:34-- https://dl-ssl.google.com/android/repository/build-tools_r21.1.1-linux.zip
Resolving dl-ssl.google.com (dl-ssl.google.com)... 74.125.22.136, 74.125.22.190, 74.125.22.91, ...
Connecting to dl-ssl.google.com (dl-ssl.google.com)|74.125.22.136|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32642454 (31M) [application/zip]
Saving to: `build-tools_r21.1.1-linux.zip'
100%[======================================>] 32,642,454 109M/s in 0.3s
2014-11-30 13:29:34 (109 MB/s) - `build-tools_r21.1.1-linux.zip' saved [32642454/32642454]
before_install.7
0.71s$ unzip build-tools_r21.1.1-linux.zip -d $ANDROID_HOME
Archive: build-tools_r21.1.1-linux.zip
creating: /home/travis/build/colymore/firext-android/android-sdk-linux/android-5.0/
inflating: /home/travis/build/colymore/firext-android/android-sdk-linux/android-5.0/NOTICE.txt
before_install.8
0.01s$ mkdir -p $ANDROID_HOME/build-tools/
before_install.9
0.01s$ mv $ANDROID_HOME/android-5.0 $ANDROID_HOME/build-tools/21.1.1
before_install.10
3.17s$ echo yes | android update sdk --filter build-tools-21.1.1 --no-ui --force > /dev/null
Error: Ignoring unknown package filter 'build-tools-21.1.1'
before_install.11
1.19s$ echo yes | android update sdk --filter tools --no-ui --force > /dev/null
before_install.12
2.30s$ echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null
before_install.13
7.11s$ echo yes | android update sdk --filter android-21 --no-ui --force > /dev/null
before_install.14
3.12s$ echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null
before_install.15
4.00s$ echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null
before_install.16
3.19s$ echo yes | android update sdk --filter extra-google-m2repository --no-ui --force > /dev/null
before_install.17
3.89s$ echo yes | android update sdk --filter extra-google-google_play_services --no-ui --force > /dev/null
56.27s$ ./gradlew assemble
Downloading https://services.gradle.org/distributions/gradle-2.1-all.zip
[Downloads..]
WARNING: Dependency org.json:json:20080701 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING [Project: :Firext] variant.getProcessManifest() is deprecated. Call it on one of variant.getOutputs() instead.
:Firext:preBuild
:Firext:compileDebugNdk
:Firext:preDebugBuild
:Firext:checkDebugManifest
:Firext:preReleaseBuild
:Firext:prepareComAndroidSupportAppcompatV72100Library
:Firext:prepareComAndroidSupportCardviewV72102Library
:Firext:prepareComAndroidSupportSupportV42102Library
:Firext:prepareComEtsyAndroidGridLibrary104Library
:Firext:prepareComGithubJohnkilAndroidRobototextviewRobototextview210Library
:Firext:prepareComGoogleAndroidGmsPlayServices6171Library
:Firext:prepareComShamanlandFab005Library
:Firext:prepareComSnappydbSnappydbLib050Library
:Firext:prepareDebugDependencies
:Firext:compileDebugAidl
:Firext:compileDebugRenderscript
:Firext:generateDebugBuildConfig
:Firext:generateDebugAssets UP-TO-DATE
:Firext:mergeDebugAssets
:Firext:generateDebugResValues
:Firext:generateDebugResources
:Firext:mergeDebugResources
/home/travis/build/colymore/firext-android/Firext/src/main/res/drawable-hdpi/ic_launcher.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
:Firext:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Firext:mergeDebugResources'.
> /home/travis/build/colymore/firext-android/Firext/src/main/res/drawable-hdpi/ic_launcher.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
* 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: 28.369 secs
The command "eval ./gradlew assemble" failed. Retrying, 2 of 3.
WARNING: Dependency org.json:json:20080701 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING: Dependency org.json:json:20080701 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING [Project: :Firext] variant.getProcessManifest() is deprecated. Call it on one of variant.getOutputs() instead.
:Firext:preBuild
:Firext:compileDebugNdk UP-TO-DATE
:Firext:preDebugBuild
:Firext:checkDebugManifest
:Firext:preReleaseBuild
:Firext:prepareComAndroidSupportAppcompatV72100Library UP-TO-DATE
:Firext:prepareComAndroidSupportCardviewV72102Library UP-TO-DATE
:Firext:prepareComAndroidSupportSupportV42102Library UP-TO-DATE
:Firext:prepareComEtsyAndroidGridLibrary104Library UP-TO-DATE
:Firext:prepareComGithubJohnkilAndroidRobototextviewRobototextview210Library UP-TO-DATE
:Firext:prepareComGoogleAndroidGmsPlayServices6171Library UP-TO-DATE
:Firext:prepareComShamanlandFab005Library UP-TO-DATE
:Firext:prepareComSnappydbSnappydbLib050Library UP-TO-DATE
:Firext:prepareDebugDependencies
:Firext:compileDebugAidl UP-TO-DATE
:Firext:compileDebugRenderscript UP-TO-DATE
:Firext:generateDebugBuildConfig UP-TO-DATE
:Firext:generateDebugAssets UP-TO-DATE
:Firext:mergeDebugAssets UP-TO-DATE
:Firext:generateDebugResValues UP-TO-DATE
:Firext:generateDebugResources UP-TO-DATE
:Firext:mergeDebugResources
/home/travis/build/colymore/firext-android/Firext/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
:Firext:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Firext:mergeDebugResources'.
> /home/travis/build/colymore/firext-android/Firext/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
* 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: 11.542 secs
The command "eval ./gradlew assemble" failed. Retrying, 3 of 3.
WARNING: Dependency org.json:json:20080701 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING: Dependency org.json:json:20080701 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING [Project: :Firext] variant.getProcessManifest() is deprecated. Call it on one of variant.getOutputs() instead.
:Firext:preBuild
:Firext:compileDebugNdk UP-TO-DATE
:Firext:preDebugBuild
:Firext:checkDebugManifest
:Firext:preReleaseBuild
:Firext:prepareComAndroidSupportAppcompatV72100Library UP-TO-DATE
:Firext:prepareComAndroidSupportCardviewV72102Library UP-TO-DATE
:Firext:prepareComAndroidSupportSupportV42102Library UP-TO-DATE
:Firext:prepareComEtsyAndroidGridLibrary104Library UP-TO-DATE
:Firext:prepareComGithubJohnkilAndroidRobototextviewRobototextview210Library UP-TO-DATE
:Firext:prepareComGoogleAndroidGmsPlayServices6171Library UP-TO-DATE
:Firext:prepareComShamanlandFab005Library UP-TO-DATE
:Firext:prepareComSnappydbSnappydbLib050Library UP-TO-DATE
:Firext:prepareDebugDependencies
:Firext:compileDebugAidl UP-TO-DATE
:Firext:compileDebugRenderscript UP-TO-DATE
:Firext:generateDebugBuildConfig UP-TO-DATE
:Firext:generateDebugAssets UP-TO-DATE
:Firext:mergeDebugAssets UP-TO-DATE
:Firext:generateDebugResValues UP-TO-DATE
:Firext:generateDebugResources UP-TO-DATE
:Firext:mergeDebugResources
/home/travis/build/colymore/firext-android/Firext/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
:Firext:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Firext:mergeDebugResources'.
> /home/travis/build/colymore/firext-android/Firext/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png: Error: Cannot run program "/home/travis/build/colymore/firext-android/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
* 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: 11.423 secs
The command "eval ./gradlew assemble" failed 3 times.
The command "./gradlew assemble" failed and exited with 1 during .
Your build has been stopped.
To Top
Tip:
Did you know that you can split a build into several smaller pieces? Learn more
How can we help?
Support Ticket
Live Chat
E-Mail us
Documentation
Running Jobs (0)
There are no jobs
Queue (0)
There are no jobs
Update: VM images already include fixed android-wait-for-emulator script and android SDK tools version 24.0.0 by default solving issues I commented.
Solution - issue 1: Appcompat v21.0.2
I suggest you try to update platform-tools before tools.
Tools 23.0.5 requires platform-tools 19+, so i don't think you are updating it.
And appcompat-v7:21.0.2 requires last android-m2repository that requires tools 23.0.5.
Update: If I'm right about the issue2, you are using their pre-installed SDK, so you are updating tools correctly because they preinstalled platform-tools v20 but if you solve issue2, your problem will be issue1. I'm not sure about issue 2 because you use language:java, I use language:android. Check the path and search their SDK tools echo $PATH.
Alternative: If I'm wrong and your problems persist. I see you include a library that could depen on android-support-v4 and appcompat-v7.
Check dependencies conflicts.
- ./gradlew androidDependencies
- ./gradlew -q :Firext:dependencies
- ./gradlew -q :Firext:dependencyInsight --dependency support-v4 --configuration compile
- ./gradlew -q :Firext:dependencyInsight --dependency appcompat-v7 --configuration compile
You need version 21.0.2 from android.m2repository, you can try to exclude them.
compile files('libs/com.mobandme.ada_v2.4.4.jar') {
exclude group: 'com.android.support'
}
Solution - issue 2: Builds-tools aapt not found
I read in your log that build-tools/aapt is not found. You are adding ANDROID_HOME to the end of PATH, but Travis-ci already did first, so you are using their tools/android at usr/local/android-sdk-23.0.2 that includes build-tools v20.0.0 no 21.1.1.
As you are using docker and you can not update tools to 23.0.5 there due to another issue, you can use my work around so you save already installed platforms and system-images and can use old tools/android to update to 23.0.5. You don't need download it using wget:
- echo "WARNING! delete when fixed"; export OLD_SDK=/usr/local/android-sdk-23.0.2
- cp -R ${OLD_SDK}/tools ${SDK}/tools || echo "SDK tools copy failed."
- cp -R ${OLD_SDK}/platforms ${SDK}/platforms || echo "SDK platforms copy failed."
- cp -R ${OLD_SDK}/system-images ${SDK}/system-images || echo "SDK system-images copy failed."
or wait they update VM images soon
or change the order, so you use your SDK:
- export ANDROID_HOME=${TRAVIS_BUILD_DIR}/android-sdk-linux
- export PATH=${ANDROID_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}
Suggestion:
you don't need download build-tools using wget.
I'm currently using this for updates:
- echo "LIST SUGGESTED SDK PACKAGES"; android list sdk -e || true
- echo "LIST AVAILABLE SDK PACKAGES"; android list sdk -a -e || true
- echo "UPDATE PACKAGES IF REQUIRED"; echo y | android update sdk -u -t platform-tool,tool,\
extra-android-support,extra-google-google_play_services,\
extra-android-m2repository,extra-google-m2repository,\
android-19,sys-img-armeabi-v7a-android-19,\
android-18,sys-img-armeabi-v7a-android-18,\
android-17,sys-img-armeabi-v7a-android-17,\
android-16,sys-img-armeabi-v7a-android-16,\
android-15,sys-img-armeabi-v7a-android-15 || true
- echo "UPDATE PACKAGES IF POSSIBLE"; echo y | android update sdk -a -u -t ${BUILD_TOOLS},\
android-20,android-21,${SDK_EXTRA_PKGS:-} || true
- echo "LIST SDK UPDATES BY FILTERS"; android update sdk -u -n -t platform,system-image,\
add-on,extra || true

Cannot build android project using Android Studio - Gradle 1.7

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.

Categories

Resources