Azure DevOps pipeline android build setting sdk location - android

I am trying to build an android app using a yaml pipeline. The gradle build task is complaining that it can't find the android sdk root. I've tried both the local.properties file and the environmental variable ANDROID_SDK_ROOT, and neither work. This is my build pipeline:
# Android
# Build your Android project with Gradle.
# Add steps that test, sign, and distribute the APK, save build artifacts, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/android
trigger:
- master
- dev
pool:
name: 'Default'
steps:
- task: UseDotNet#2
inputs:
version: '2.2.x'
packageType: runtime
- task: GitVersion#5
displayName: GitVersion
inputs:
useConfigFile: true
configFilePath: GitVersion.yml
# trying to set the env variable doesn't work.
# - task: PowerShell#2
# inputs:
# targetType: 'inline'
# script: |
# # Write your PowerShell commands here.
# [Environment]::SetEnvironmentVariable("ANDROID_SDK_ROOT", "C:\Users\Administrator\AppData\Local\Android\Sdk", "User")
- task: file-creator#6
inputs:
filepath: '$(System.DefaultWorkingDirectory)/local.properties'
filecontent: 'sdk.dir=C:/Users/Administrator/AppData/Local/Android/Sdk'
fileoverwrite: true
# trying to execute gradlew manually does not work
# - task: CmdLine#2
# inputs:
# script: |
# gradlew.bat assembleDebug
# workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: Gradle#2
inputs:
workingDirectory: '$(System.DefaultWorkingDirectory)'
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
tasks: 'assembleDebug'
This is the output:
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/gradle
==============================================================================
SYSTEMVSSCONNECTION exists true
C:\Windows\system32\cmd.exe /D /S /C "C:\VSTS\_work\8\s\gradlew.bat -p C:\VSTS\_work\8\s assembleDebug"
Starting a Gradle Daemon, 1 incompatible and 4 stopped Daemons could not be reused, use --status for details
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\VSTS\_work\8\s\local.properties'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 16s
Error: The process 'C:\VSTS\_work\8\s\gradlew.bat' failed with exit code 1
at ExecState._setResult (C:\VSTS\_work\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\2.176.0\node_modules\azure-pipelines-task-lib\toolrunner.js:816:25)
at ExecState.CheckComplete (C:\VSTS\_work\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\2.176.0\node_modules\azure-pipelines-task-lib\toolrunner.js:799:18)
at ChildProcess.<anonymous> (C:\VSTS\_work\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\2.176.0\node_modules\azure-pipelines-task-lib\toolrunner.js:721:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:920:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
##[error]Error: The process 'C:\VSTS\_work\8\s\gradlew.bat' failed with exit code 1
Finishing: Gradle
If I rdp into the build agent and run gradlew manually with the generated local.properties file present from the command line the build DOES succeed though, so I'm not sure what the issue with running it in a pipeline is.

You can set environmental variables in azure pipeline by defining it in the Variables section. You can add below to your yaml pipeline.
variables:
ANDROID_SDK_ROOT: 'C:\Users\Administrator\AppData\Local\Android\Sdk'
You can also set the environmental variable ANDROID_SDK_ROOT using the task.setvariable logging command in the scripts. For below example.
steps:
- powershell: echo "##vso[task.setvariable variable=ANDROID_SDK_ROOT]C:\Users\Administrator\AppData\Local\Android\Sdk"

I figured out the issue. I installed the android sdk on the administrator account, but devops created a separate windows user for builds. Installing the android sdk for that user fixed my build.

Related

Azure devops - SDK location not found. Define location with an ANDROID_SDK_ROOT environment

I get the below error while trying to run android application in a self hosted ubuntu agent. Am I getting this error because Android SDK is not present in the Ubuntu agent? If so, is there any workaround? I do not get this issue while the same app is run in a macos agent.
Any help is much appreciated
2022-07-28T23:36:24.0840286Z ##[section]Starting: Build Task
2022-07-28T23:36:24.0850273Z ==============================================================================
2022-07-28T23:36:24.0850626Z Task : Gradle
2022-07-28T23:36:24.0850911Z Description : Build using a Gradle wrapper script
2022-07-28T23:36:24.0851183Z Version : 3.205.0
2022-07-28T23:36:24.0851592Z Author : Microsoft Corporation
2022-07-28T23:36:24.0851981Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/gradle
2022-07-28T23:36:24.0852397Z ==============================================================================
2022-07-28T23:36:24.4320361Z ##[warning]Used 'chmod' method for gradlew file to make it executable.
2022-07-28T23:36:24.4933143Z [command]/azp/_work/1/s/gradlew assembleDebug
2022-07-28T23:36:25.2820472Z Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
2022-07-28T23:36:33.1825697Z
2022-07-28T23:36:33.1828123Z > Configure project :app
2022-07-28T23:36:33.1831681Z WARNING: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
2022-07-28T23:36:33.1834823Z It will be removed in version 5.0 of the Android Gradle plugin.
2022-07-28T23:36:33.1836236Z VersionCode is set to 999
2022-07-28T23:36:33.1837886Z releaseVersion is set to 1.1.0
2022-07-28T23:36:33.2796793Z WARNING: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
2022-07-28T23:36:33.2797944Z It will be removed in version 5.0 of the Android Gradle plugin.
2022-07-28T23:36:33.9796986Z
2022-07-28T23:36:33.9798819Z FAILURE: Build failed with an exception.
2022-07-28T23:36:33.9799385Z
2022-07-28T23:36:33.9799910Z * What went wrong:
2022-07-28T23:36:33.9801449Z A problem occurred configuring project ':app'.
2022-07-28T23:36:33.9802801Z > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/azp/_work/1/s/local.properties'.
2022-07-28T23:36:33.9803386Z
2022-07-28T23:36:33.9803681Z * Try:
2022-07-28T23:36:33.9804986Z Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
2022-07-28T23:36:33.9805350Z
2022-07-28T23:36:33.9805674Z * Get more help at https://help.gradle.org
2022-07-28T23:36:33.9806648Z
2022-07-28T23:36:33.9807103Z Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
2022-07-28T23:36:33.9807912Z Use '--warning-mode all' to show the individual deprecation warnings.
2022-07-28T23:36:33.9808507Z See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
2022-07-28T23:36:33.9808801Z
2022-07-28T23:36:33.9809086Z BUILD FAILED in 9s
2022-07-28T23:36:34.4381110Z Error: The process '/azp/_work/1/s/gradlew' failed with exit code 1
2022-07-28T23:36:34.4386504Z at ExecState._setResult (/azp/_work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.205.0/node_modules/azure-pipelines-task-lib/toolrunner.js:944:25)
2022-07-28T23:36:34.4390433Z at ExecState.CheckComplete (/azp/_work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.205.0/node_modules/azure-pipelines-task-lib/toolrunner.js:927:18)
2022-07-28T23:36:34.4393277Z at ChildProcess.<anonymous> (/azp/_work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.205.0/node_modules/azure-pipelines-task-lib/toolrunner.js:840:19)
2022-07-28T23:36:34.4394910Z at ChildProcess.emit (events.js:198:13)
2022-07-28T23:36:34.4396280Z at maybeClose (internal/child_process.js:982:16)
2022-07-28T23:36:34.4397383Z at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
2022-07-28T23:36:34.4415403Z ##[error]Code analysis failed. Gradle exit code: -1. Error: Error: The process '/azp/_work/1/s/gradlew' failed with exit code 1
2022-07-28T23:36:34.4472252Z ##[section]Finishing: Build Task
SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/azp/_work/1/s/local.properties'.
The cause of this error is that the Android SDK is not installed or the Android environment is not configured on your self-hosted agent.
You need to check if Android SDK has been installed on your self-hosted agent.
If no, you can use the following command to install Android SDK.
sudo apt update && sudo apt install android-sdk
The location of Android SDK on Linux can be any of the following:
/home/AccountName/Android/Sdk
/usr/lib/android-sdk
/Library/Android/sdk/
/Users/[USER]/Library/Android/sdk
Then you can set the Android environment via setting environment variable or setting sdk.dir path in /azp/_work/1/s/local.properties.
For example:
Set environment variable
1.Edit your ~/.zshrc or ~/.bashrc or ...
2. Add SDK path:
export ANDROID_HOME=$HOME/Android/Sdk
export ANDROID_SDK_ROOT=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
3.Run command:
source $HOME/.bashrc
echo $ANDROID_SDK_ROOT

Azure devops pipline No toolchains found in the NDK toolchains folder for ABI with prefix

Hi I'm trying to build react native android app in azure pipelines but I can't get it to work...
The error I'm keep getting is like this. I tried everything I found on google but nothing helped.
Build task:
- task: Gradle#2
displayName: "Build APK"
inputs:
gradleWrapperFile: "android/gradlew"
workingDirectory: "android/"
options: "-PversionName=$(NEW_VERSION) -PversionCode=$(Build.BuildId)"
tasks: "assembleStage" # assembleRelease or assembleStage
publishJUnitResults: false
javaHomeOption: "JDKVersion"
jdkVersionOption: "1.11"
gradleOptions: "-Xmx3072m"
sonarQubeRunAnalysis: false
I use com.android.tools.build:gradle:3.5.2 (and can't upgrade it)
ERROR:
Task :react-native-document-scanner:stripReleaseDebugSymbols FAILED
Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.
Task :app:mergeStageJavaResource
Task :app:mergeExtDexStage
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':#react-native-document-scanner:stripReleaseDebugSymbols'.
No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 25m 59s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
690 actionable tasks: 690 executed
Error: The process '/Users/runner/work/1/s/android/gradlew' failed with exit code 1
at ExecState._setResult (/Users/runner/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/2.200.2/node_modules/azure-pipelines-task-lib/toolrunner.js:944:25)
at ExecState.CheckComplete (/Users/runner/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/2.200.2/node_modules/azure-pipelines-task-lib/toolrunner.js:927:18)
at ChildProcess. (/Users/runner/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/2.200.2/node_modules/azure-pipelines-task-lib/toolrunner.js:840:19)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Socket.stream.socket.on (internal/child_process.js:389:11)
at Socket.emit (events.js:198:13)
at Pipe._handle.close (net.js:607:12)
I tried specify ndkVersion to "21.4.7075529" didn't help. Also I tried to upgrade gradle version to 4.1.0 but same error came up.
Thanks
I managed to fix it by adding bash script as step like this:
echo "ndk.dir=$ANDROID_NDK_HOME" >> local.properties

SDK location not found. CircleCi

I am attempting to deploy a React Native Android application using CircleCI.
Here is the job
android_deploy_staging:
docker:
- image: cimg/android:2021.12.2-node
environment:
JAVA_OPTS: '-Xms512m -Xmx2g'
GRADLE_OPTS: '-Xmx3g -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx2g -XX:+HeapDumpOnOutOfMemoryError"'
steps:
- checkout
- *fetchDeployKeys
- run: git config --global url."https://qadrebot:$GITHUB_TOKEN#github.com".insteadOf "https://github.com"
- run: *set_node_version
- restore_cache: *restore_npm_cache
- run: *install_npm_dependencies
- save_cache: *save_npm_cache
- restore_cache:
key: 4-gems-{{ checksum "android/Gemfile.lock" }}
- run: cd android; bundle check || bundle install --path vendor/bundle --clean
- save_cache:
key: 4-gems-{{ checksum "android/Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Install Fastlane
command: sudo gem install fastlane
- run:
name: bundle install
command: cd android && bundle install
- run:
environment:
ANDROID_SDK_ROOT: '/home/circleci/android-sdk'
name: Prepare environment and compile beta
no_output_timeout: 30m
command: |
echo Executing fastlane
yarn deploy_staging:android
However I get an error about the SDK location not being found.
[12:36:31]: -------------------
[12:36:31]: --- Step: clean ---
[12:36:31]: -------------------
[12:36:31]: $ /home/circleci/project/android/gradlew clean -p .
[12:36:31]: ▸ Downloading https://services.gradle.org/distributions/gradle-6.4-all.zip
[12:36:32]: ▸ .............10%..............20%..............30%..............40%..............50%..............60%..............70%..............80%..............90%.............100%
[12:36:34]: ▸ Welcome to Gradle 6.4!
[12:36:34]: ▸ Here are the highlights of this release:
[12:36:34]: ▸ - Support for building, testing and running Java Modules
[12:36:34]: ▸ - Precompiled script plugins for Groovy DSL
[12:36:34]: ▸ - Single dependency lock file per project
[12:36:34]: ▸ For more details see https://docs.gradle.org/6.4/release-notes.html
[12:36:35]: ▸ Starting a Gradle Daemon (subsequent builds will be faster)
[12:36:49]: ▸ > Configure project :app
[12:36:49]: ▸ Reading env from: ./app/services/config/.env.staging
[12:36:49]: ▸ WARNING: DSL element 'DexOptions.incremental' is obsolete.
[12:36:49]: ▸ It will be removed in version 5.0 of the Android Gradle plugin.
[12:36:49]: ▸ WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
[12:36:49]: ▸ It will be removed in version 5.0 of the Android Gradle plugin.
[12:36:49]: ▸ For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
[12:36:51]: ▸ FAILURE: Build failed with an exception.
[12:36:51]: ▸ * What went wrong:
[12:36:51]: ▸ A problem occurred configuring project ':app'.
[12:36:51]: ▸ > Could not create task ':app:lintDebug'.
[12:36:51]: ▸ > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/home/circleci/project/android/local.properties'.
[12:36:51]: ▸ * Try:
[12:36:51]: ▸ Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[12:36:51]: ▸ * Get more help at https://help.gradle.org
[12:36:51]: ▸ BUILD FAILED in 20s
On the CircleCi website it states
This image contains the Android SDK and CLI tools.
But it looks like maybe the Android SDK isn't installed?
Has anyone come across this before?
You can check cimg-android docker template code.
# Install Android SDK Tools
ENV ANDROID_HOME "/home/circleci/android-sdk"
ENV ANDROID_SDK_ROOT $ANDROID_HOME
You don't need to set $ANDROID_SDK_ROOT yourself.
Instead, the sdk path can be refered with $ANDROID_SDK_ROOT
- run:
name: 'Build Android App'
command: |
export ANDROID_SDK_ROOT='/home/circleci/android-sdk'
export JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64'
npm run build:android

Circleci. SDK location not found

Options mentioned in similar questions didn't help for me. That's why I'm creating question.
When trying to build project on CircleCi I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 17s
Exited with code 1
I've tried to take configuration file from here: https://circleci.com/docs/2.0/language-android/
I've also tried to use default configuration file, when building a project.
I've set ANDROID Home variable, I've checked local.properties file. Everything is correct.
Can anybody help?
My config.yml file:
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
command: sudo chmod +x ./gradlew
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Run Tests
command: ./gradlew lint test
- store_artifacts:
path: app/build/reports
destination: reports
- store_test_results:
path: app/build/test-results
go to app directory -> go to android directory -> create a file named local.properties
then add :
sdk.dir = /home/user-name/Android/Sdk
NOTE: replace sdk address with your's

Jenkins CI Android Gradle Build Fail

I have use jenkins with docker
after pull and install the following plugin
Git Plugin
Gradle Plugin
Android Lint Plugin
Google Play Android Publisher Plugin
THEN setup JDK, Repository (GitLab)
AND create project and run, it's show the following error.
RUN COMMAND
docker run -p 8080:8080 -v /Users/abc/Library/Android/sdk:/var/android_home -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
JENKINS CONSOLE OUTPUT
Building in workspace /var/jenkins_home/workspace/ABC Project
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url http://office.viinsoft.com/issoft/mappening-android.git # timeout=10
Fetching upstream changes from http://office.viinsoft.com/issoft/mappening-android.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials
> git fetch --tags --progress http://office.viinsoft.com/issoft/mappening-android.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 7a760b63852e92c57e5b4dea5bdf6680b01d8894 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 7a760b63852e92c57e5b4dea5bdf6680b01d8894
Commit message: "Test Jenkins#2"
> git rev-list --no-walk 7a760b63852e92c57e5b4dea5bdf6680b01d8894 # timeout=10
[Gradle] - Launching build.
[Mappening Project] $ "/var/jenkins_home/workspace/Mappening Project/gradlew" assembleDebug
Starting a Gradle Daemon (subsequent builds will be faster)
Configuration 'testCompile' in project ':app' is deprecated. Use 'testImplementation' instead.
Configuration 'androidTestCompile' in project ':app' is deprecated. Use 'androidTestImplementation' instead.
:app:preBuild UP-TO-DATE
:app:preDevDebugBuild UP-TO-DATE
:app:compileDevDebugAidl UP-TO-DATE
:app:compileDevDebugRenderscript UP-TO-DATE
:app:checkDevDebugManifest UP-TO-DATE
:app:generateDevDebugBuildConfig UP-TO-DATE
:app:generateDevDebugResValues UP-TO-DATE
:app:generateDevDebugResources UP-TO-DATE
:app:mergeDevDebugResourcesAAPT err(Facade for 849578689): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
AAPT err(Facade for 1702555035): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
Slave 1702555035 failed to start
java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
at java.lang.Thread.run(Thread.java:748)
AAPT err(Facade for 1365735589): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
Slave 1365735589 failed to start
java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
at java.lang.Thread.run(Thread.java:748)
AAPT err(Facade for 212997924): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
Slave 212997924 failed to start
java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
at java.lang.Thread.run(Thread.java:748)
Slave 849578689 failed to start
java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
at java.lang.Thread.run(Thread.java:748)
Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: No server to serve request. Check logs for details.
:app:mergeDevDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDevDebugResources'.
> Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: No server to serve request. Check logs for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
7 actionable tasks: 1 executed, 6 up-to-date
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
TRAIL AND STILL ERROR
I was google around it seem that, a solution need to use older build-tool which I don't want Android studio 2.1.2 gradle aapt Syntax error: Unterminated quoted string
and someone said I have missing library to execute 64 bit code, so I run the following command on my mac OSX and check, but it seem okay Android Studio 3.0 - No server to serve request
otool -L build-tools/26.0.2/aapt2
build-tools/26.0.2/aapt2:
#rpath/libc++.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
finally, I give permission to my local path sudo chmod 755 -R /Users/sattha.p/Library/Android/sdk but nothing change even restart docker.

Categories

Resources