{"action":"created","issue":{"url":"https://api.github.com/repos/MobileChromeApps/mobile-chrome-apps/issues/542","labels_url":"https://api.github.com/repos/MobileChromeApps/mobile-chrome-apps/issues/542/labels{/name}","comments_url":"https://api.github.com/repos/MobileChromeApps/mobile-chrome-apps/issues/542/comments","events_url":"https://api.github.com/repos/MobileChromeApps/mobile-chrome-apps/issues/542/events","html_url":"https://github.com/MobileChromeApps/mobile-chrome-apps/issues/542","id":65994105,"number":542,"title":"before_prepare/cca-check.js: [Error: Please install Android target: \"android-21\".","user":{"login":"marcellodesales","id":131457,"avatar_url":"https://avatars.githubusercontent.com/u/131457?v=3","gravatar_id":"","url":"https://api.github.com/users/marcellodesales","html_url":"https://github.com/marcellodesales","followers_url":"https://api.github.com/users/marcellodesales/followers","following_url":"https://api.github.com/users/marcellodesales/following{/other_user}","gists_url":"https://api.github.com/users/marcellodesales/gists{/gist_id}","starred_url":"https://api.github.com/users/marcellodesales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcellodesales/subscriptions","organizations_url":"https://api.github.com/users/marcellodesales/orgs","repos_url":"https://api.github.com/users/marcellodesales/repos","events_url":"https://api.github.com/users/marcellodesales/events{/privacy}","received_events_url":"https://api.github.com/users/marcellodesales/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-02T19:22:58Z","updated_at":"2015-04-02T19:37:45Z","closed_at":null,"body":"Hi there,\r\n\r\nI have installed Android 21.1 SDK: https://dl.google.com/android/android-sdk_r21.1-linux.tgz\r\n\r\nHowever, I'm getting this error while trying to build :(\r\n\r\n```\r\nRunning command: /pipeline/build/build/hooks/before_prepare/cca-check.js /pipeline/build/build\r\n## Inject CSP for android\r\nRunning command: /pipeline/build/build/platforms/android/cordova/build \r\n[Error: Please install Android target: \"android-21\".\r\n\r\nHint: Open the SDK manager by running: /home/ubuntu/android-sdk-linux/tools/android\r\nYou will require:\r\n1. \"SDK Platform\" for android-21\r\n2. \"Android SDK Platform-tools (latest)\r\n3. \"Android SDK Build-tools\" (latest)]\r\nERROR building one of the platforms: Error: /pipeline/build/build/platforms/android/cordova/build: Command failed with exit code 2\r\nYou may not have the required environment or OS to build this project\r\nError: /pipeline/build/build/platforms/android/cordova/build: Command failed with exit code 2\r\n    at ChildProcess.whenDone (/pipeline/build/node_modules/cca/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)\r\n    at ChildProcess.emit (events.js:98:17)\r\n    at maybeClose (child_process.js:766:16)\r\n    at Process.ChildProcess._handle.onexit (child_process.js:833:5)\r\n```\r\n\r\nDo I need to download the latest Platform and Build tools as 24.1.2, the latest, as well? \r\n\r\nhttp://developer.android.com/tools/sdk/tools-notes.html\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/MobileChromeApps/mobile-chrome-apps/issues/comments/89020407","html_url":"https://github.com/MobileChromeApps/mobile-chrome-apps/issues/542#issuecomment-89020407","issue_url":"https://api.github.com/repos/MobileChromeApps/mobile-chrome-apps/issues/542","id":89020407,"user":{"login":"marcellodesales","id":131457,"avatar_url":"https://avatars.githubusercontent.com/u/131457?v=3","gravatar_id":"","url":"https://api.github.com/users/marcellodesales","html_url":"https://github.com/marcellodesales","followers_url":"https://api.github.com/users/marcellodesales/followers","following_url":"https://api.github.com/users/marcellodesales/following{/other_user}","gists_url":"https://api.github.com/users/marcellodesales/gists{/gist_id}","starred_url":"https://api.github.com/users/marcellodesales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcellodesales/subscriptions","organizations_url":"https://api.github.com/users/marcellodesales/orgs","repos_url":"https://api.github.com/users/marcellodesales/repos","events_url":"https://api.github.com/users/marcellodesales/events{/privacy}","received_events_url":"https://api.github.com/users/marcellodesales/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T19:37:45Z","updated_at":"2015-04-02T19:37:45Z","body":"My entire installation is as follows:\r\n\r\n```\r\n#!/bin/sh\r\n\r\nexport sdk_version=\"21.1\"\r\n\r\n# Install SDK\r\nwget \"http://dl.google.com/android/android-sdk_r${sdk_version}-linux.tgz\"\r\ntar zxf \"android-sdk_r${sdk_version}-linux.tgz\"\r\nrm \"android-sdk_r${sdk_version}-linux.tgz\"\r\n\r\n# Set environment variables\r\nexport ANDROID_HOME=${PWD}/android-sdk-linux\r\nexport ANDROID_BUILD_TOOLS=\"21.1.1\"\r\nexport ANDROID_VERSION=\"4.4.2\"\r\nexport ANDROID_PLATFORM_TOOLS=\"21.1.1\"\r\nexport PATH=\"${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools\"\r\n\r\ntype android || { echo \"Path: $PATH\"; echo 'Android not available after installation, terminating.'; exit 1; }\r\n\r\n# Write environment variables to profile\r\necho \"export ANDROID_HOME=\\\"${ANDROID_HOME}\\\"\" | sudo tee -a /etc/profile.d/android.sh\r\necho \"export ANDROID_SDK_VERSION=\\\"${sdk_version}\\\"\" | sudo tee -a /etc/profile.d/android.sh\r\necho \"export ANDROID_BUILD_TOOLS=\\\"${ANDROID_BUILD_TOOLS}\\\"\" | sudo tee -a /etc/profile.d/android.sh\r\necho \"export ANDROID_PLATFORM_TOOLS=\\\"${ANDROID_PLATFORM_TOOLS}\\\"\" | sudo tee -a /etc/profile.d/android.sh\r\necho \"export ANDROID_VERSION=\\\"${ANDROID_VERSION}\\\"\" | sudo tee -a /etc/profile.d/android.sh\r\necho \"export PATH=\\\"${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools\\\"\" | sudo tee -a /etc/profile.d/android.sh\r\n\r\n# Install android components\r\n(while :\r\ndo\r\n  echo 'y'\r\n  sleep 2\r\ndone) | android update sdk -u -a -t 1,2,3,22,111,112\r\n```"}}