There are not available platforms - android

Im using cocos2d-x version 12 and NDKrc12 and I have all the paths in my
.bash_profile set. But when I build for android and type:
cocos compile -p android
It displays a message "There are not available platforms" which can't be because I have the android SDK installed in the correct path what is wrong?

On the latest version of cocos2d-x for some odd reason you need to use the '-s' option like this:
cocos run -s /Users/me/myprojects/mygame -p android
Otherwise without '-s' it displays "there are not available platforms"
seems unnecessary when your in your project folder but I guess it is!

Run android on the command line, this will open the Android SDK manager. From here make sure that you have installed the appropriate SDK for your device.

cd your project root, then open .cocos_project.json, find "android_cfg" arg, if you have the folder. if you don't find, then create a new cocos project, cocos compile, then judge which platform can run, in new project folder open .cocos_project.json. You can look for diffences between them.

Related

Unable to run aapt command - keeps returning "Android SDK Build-tools"

What I'm attempting to do: Install the Android build tools on Mac OSX so I can use the aapt command to crunch/process some images for testing
What I've done:
Installed the Android SDK using brew
Run the android command to bring up the SDK Manager
Used the Manager to install the SDK tools (22.3), SDK Platform-tools(19), SDK Build-tools(19) and Android 4.4
I've verified that the tools were added to the default location when using brew.
What happens:
Running aapt or aapt v always returns Use the 'android' tool to install the "Android SDK Build-tools".
I've also tried updating the tools using android update, but it still fails to work.
EDIT:
Running the full path to aapt v works. I'm now assuming I have an issue with my PATH which I still need to resolve
Any clues as to what to try next would be greatly appreciated.
I'm pretty sure that the Android SDK doesn't try to modify your PATH variable for you. If you want to be able to run SDK tools without specifying their full path, you'll need to add the folder(s) containing them to your PATH one by one.
You can do this by editing your ~/.bash_profile and adding a line like so (or editing an existing line like this if you have one already):
export PATH="$PATH:/PATH/TO/android-sdk-macosx/build-tools/17.0.0"
Alternatively, you can just specify the full path to the tool when invoking it, like so:
/PATH/TO/android-sdk-macosx/build-tools/17.0.0/aapt v
I'm not sure this ever happens with aapt, but this can be useful to disambiguate if multiple versions of a tool are installed. To see which version of a command that bash is resolving to, you can usually find out by running which, like so:
which aapt
EDIT
There have been a number of good comments on this answer including Jared's excellent suggestion to dynamically add the latest build-tools to the path. I reimplemented his code in pure 3.x bash, here's what's currently in my ~/.bash_profile. First, make sure to set ANDROID_HOME:
export ANDROID_HOME="$HOME/Library/Android/sdk" #Set this to the path to your Android SDK if it's not in the default location
Then (if you are using bash):
BUILD_TOOLS=($ANDROID_HOME/build-tools/*)
ANDROID_LATEST_BUILD_TOOLS="${BUILD_TOOLS[#]:(-1)}"
export PATH="$PATH:$HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_LATEST_BUILD_TOOLS"
Alternatively, here is a POSIX version that should work in any shell:
ANDROID_LATEST_BUILD_TOOLS=$(ls -r ${ANDROID_HOME}/build-tools|head -1)
export PATH="$PATH:$HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/$ANDROID_LATEST_BUILD_TOOLS"

Ruboto: Android SDK Tools is missing

I'm trying to develop android apps using Ruboto. I can't seem to get it all up and running though. When I try to run something like:
ruboto gen app --package com.test.me --name Test --target android-17
I got the following output:
Found '/usr/bin/adb' but it is not in a proper Android SDK installation.
RuntimeError: The '<ANDROID_HOME>/tools' directory is missing.
Please set the ANDROID_HOME environment variable to a proper Android SDK installation.
I have followed the guide on the Ruboto git site (https://github.com/ruboto/ruboto/wiki/Environment-setup-for-ubuntu) but whatever I do, I still get that error. When I manually go to the directory, the tools directory isn't missing.
Some extra info:
I am using Ubuntu 13.10.
I installed every SDK after running android in the terminal.
I am using jruby through rvm

Cordova-CLI & PhoneGap-CLI do not see android sdk

I've created app with "phonegap create" command. Then I switch to project dir and try to run it with "phonegap local run android" and I have next error message:
Please install Android target 17 <...>
Android SDK is placed to C:\dev\sdk
My PATH variable contains C:\dev\sdk; C:\div\sdk\platforms\;C:\dev\sdk\platform-tools
I run "android" command from cmd and SDK Manager shows no updates or no missed sdk files.
I tried create and run project with cordova cli but had same problem.
What can it be?
It seems that for latest Cordova (3.0.6),
cordova platform add android
command only recognize Android 4.2.2(API17) SDK. After I install the API17 SDK, the error was gone.
Not sure if there is a cordova command option that can specify SDK version.
I had just the same problem (error message) with os x (10.8).
After executing the command android in the Terminal some android-packet-management-UI popped up. There i could install stuff that made it run ..
I had API17 installed but was still getting this error.
I needed to install apache-ant, set ANT_HOME=C:\Program Files\Java\apache-ant\, JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21\ and add both bin's to my PATH += C:\Program Files\Java\jdk1.7.0_21\bin;C:\Program Files\Java\apache-ant\bin
See https://stackoverflow.com/a/13986997/956397
I had the same problem and the very most simple way to resolve it is changing the target in project.properties to 16 and try.
it seems if you type "android" at the same command prompt you type your cordova commands, you get a separate Android SDK manager then the one launched via Eclipse and so then there you select the appropriate packages and updates to achieve the version number of the Adroid SDK required. For me I'm guessing it's from an adt-bundle I installed with _? (I don't know actually no clue) that runs instead.
My best guess is the installer when updating doesn't doesn't update the path correctly.
Ya you need to manually correct duplicates and anomalies in the path.
Point to the "sdk" folder and tools of a valid most current adt-bundle-windows folder.
Maybe it was NetBeans that did this?
No it seems plausible when I put an update of Eclipse (C:\Library\Dev\Android\adt-bundle-windows-*) I must have not realized I needed to update the path too having done it manually the first time to get it to work.
It seems I needed plateform-tools added as well for adb to run the emulate command...
C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk;C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk\tools;C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools;

How to add Ruboto path to android sdk?

I am new to Ruboto gem. I am currently working on android with Ruboto. I know android. I have installed the all requirements for Rubuto. I try to created the sample project using following command,
$ ruboto gen app --package org.sample.rubotoapp --target android-17
Output: Android SDK not in path
/bin/sh: android: not found
Please anybody can solve my problem. Thanks....
It looks like the Android SDK tools directory is not in your path. If you check you path variable with
echo $PATH
it will probably not contain the Android SDK tools directory. Also, you can check if the "android" command is in your path using
which android
You will probably get an empty response.
If you use Ruboto 0.12.0, you should be able to use
ruboto setup
to configure your environment. Recently, in Android SDK r22, the path to the build tools was changed. This will break your setup, and you will have to add
<android sdk location>/build-tools/17.0.0
to your path manually. This is fixed for Ruboto 0.13.0 which will be released in june.

How do I update an Android project from a Jenkins job?

I am setting up Jenkins to clone my git project, update the project, then build using ant. If I perform an ls in the job after cloning the repo, I see my project.properties file present (containing target).
To update the project (and therefore generate the build.xml file) I issue the following command:
android update project -p ./
However, I get the following console output:
Error: The project either has no target set or the target is invalid.
Does anyone know how to update an android project from Jenkins and avoid this problem?
So you've eliminated the first part of the error (i.e. the project does have a target set), but not the second part.
The message "target is invalid" means that you don't have the target platform installed in the Android SDK that Jenkins is using.
e.g. if your target is android-17, then you need to install the Android 4.2 platform (for example via the command android update sdk -u -t android-17).
As an aside, you can automate both the relevant calls to android update -p and the installation of required target platforms using the Android Emulator Plugin for Jenkins.

Categories

Resources