Android Studio does not start on my machine with a warning about unsufficient memory. So I want to work on Android apps with Qt Creator. Unfortunately Google decided to make it harder to just get the Android SDK and refers to Android Studio, so all older tutorials link to dead pages or to pages that are redirected to the Android Studio website.
So what are the steps needed to install the plain SDK, the NDK and enable Qt Creator for Android development?
I documented the steps I took to make it work and will post them in an answer hoping they will be halpful for other people as well.
This is how it works in February 2017.
Download the Android SDK command line tools from the link at the bottom end of https://developer.android.com/studio/index.html
Unzip. Note that you need to leave the folder name untouched (tools/), otherwise it will not work. I have it unpacked as /usr/local/Android/android-sdk/tools creating the folders Android/ and android-sdk/ and then unzip into android-sdk/.
Run ./android from the tools/ folder. A GUI is spawning where you can select SDK stuff to be installed. Of course there is also a newer version of the SDK tools available than the one you just downloaded two minutes ago. ;)
Select the Android version of your device (you can probably deselect the Intel-based sub packages and Android TV stuff from that version, so check the contents of the packages you select. If in doubt, install them, though. :) ... The installation process will take some time.
Download the Android NDK from https://developer.android.com/ndk/downloads/index.html
Unzip. According to my SDK tools folder, I chose to unzip the NDK into /usr/local/Android/ as android-ndk/.
In Qt Creator go to the Settings dialog (Tools -> Settings...) and there to Devices -> Android and fill in the locations of your SDK and NDK. Note: for the SDK you need to state the folder containing the tools/ folder, not the tools/ folder itself. So for me:
/usr/local/Android/android-sdk
/usr/local/Android/android-ndk
Add some SDK and NDK paths to your shell's rc file, e.g. ~/.bashrc or ~/.zshrc:
export PATH=$PATH:/usr/local/Android/android-sdk/tools
export PATH=$PATH:/usr/local/Android/android-sdk/platform-tools
export PATH=$PATH:/usr/local/Android/android-ndk
Now you should be good to go. ... For me on one system the QtCreator kits were created automatically on another they weren't. Not sure why. If needed, you can create the kits manually and be done. :)
Related
After I installed an older Unity version (5.6.0f3) I can't build a simple android app:
Unable to list target platforms. Please make sure the android sdk path
is correct. See the Console for more details. See the Console for
details.
As I understand I need Android tools 25.2.5 or earlier in order to build android apps in Unity 5.6.0f3.
According to this instruction I need just to add the path of the unzipped SDK to the Edit -->Preferences ---> External Tools --->SDK box. The problem is that after that Unity is not accepting this path and asks me to choose a different one.
While following this instruction, since I have a mac, I downloaded and unzipped the file and double-clicked android.bat and installed the recommended packages. But the problem remains, I still see the error message.
What might be the problem and how it can it be fixed?
Thank you in advance!
The reason Unity does not accept the path is because you are not linking the right folder for the sdk path. You may have to play around with the inner/outer folders of the sdk path in order to get it right.
On my mac the file path after installing the sdk is Library/Android/sdk (this is installed from Android Studio so that path may be a bit different).
And on my windows the correct folder is just the unzipped outer folder e.g tools_r25.2.3-windows
SDK / ADK: is the path to the folder that contains "platform-tools" folder (which contain ADB binary)
JDK: is the folder that contains the bin folder that contains java / javac (comipler) binary
NDK: download and unpack this massive ugly zip with 56k files in it. It should be version r13b - untiy doesn't like newer versions. No need to install anything
Thankfully for new versions of Unity assist you in managing those dependencies via the hub, but I am posting the screenshots for future reference as I often find myself looking for the very same answer
Want to set up a linux server only to build and test, and I found Android does not offer sdk only package anymore.
Previous sdk download page was redirect to studio download page.
I need android sdk package. but now Android only supply the sdk-tool, in my mind sdk-tool/ is under sdk/, like path-to-sdk/tools. When android project builds, I need to set env $ANDROID_HOME, and $ANDROID_HOME is the directory of the sdk/ not the sdk/tool/
I try the android-studio-linux, but the pack I unzipped can not found android sdk, it seems android download sdk on first run.
I try the to find the android-sdk, but only get the older releas.
Please give me some suggestion, how to build android apk in non-gui linux server, the server is Ubuntu 64bit.
Well they still offer, they just have moved it to bottom to promote Android Studio more over other other IDEs.
Check the bottom of the page or just use this link to download it for linux. You can very well use gradle to build and package your app so if there is actually no compulsion of using Android Studio.
Update Also this document explains how to develop Android apps/libs from commandline.
I want to integrate some c code with Android so as first step I has to specify NDK path in Native Development node. But when I specify NDK path it gives error Invalid path for NDK
I googled but could not find some solution. Am I missing some step.
SDK and NDK are in the same folder and SDK path working fine.
Please help
I have installed
make-3.81
nawk-2007.10.23-setup
Cygwin
ADT-17.0.0
Sequoyah
android-ndk-r7b-windows.zip (Extracted)
EDIt:
I just check the link and came to know that it could be GCC absent problem .How do I check that if its GCC problem or not , or How can I check if GCC is installed or not?
Mmm... weird error. Keep in mind that in order to use the NDK, the SDK should be working in perfect way before you start with the NDK, said that, I suggest you to try the following:
1- Be sure you have the pre-requisites:
For all development platforms, GNU Make 3.81 or later is required.
Earlier versions of GNU Make might work but have not been tested.
A recent version of awk (either GNU Awk or Nawk) is also required.
For Windows, Cygwin 1.7 or higher is required. The NDK will not work
with Cygwin 1.5 installations.
2- Start from scratch again by deleting any NDK references such as the settings on eclipse, paths, folders, zips, etc.
3- Be sure you have updated to the latest Android SDK and ADT Tools. Using the Help->Check for Updates Menu in ECLIPSE and then be sure you have all the things are up to date on the Android SDK Manager.
4- I see a "D:/" on your question, so you're using a Windows PC... it must be a Windows XP (32-bit) or Vista (32- or 64-bit). Be sure to get the Windows version (http://dl.google.com/android/ndk/android-ndk-r7b-windows.zip), and when you have unzipped that ndk, rename the folder to "ndk". You can put it next to where your SDK's folder is, it should not matter.
5- Open Eclipse, and give it the path to the NDK, and see what happens.
Good luck!
I exhuasted to solve this problem "Invalid path for android SDK" but it got solved at last.
Here is how it got solved.
My system specs: P4 3.2 GHz, Windows 7 32-bit, Eclipse Standard Edition 4.3 (Kepler).
Other supporting softwares: MinGW with GNU make 3.81.
Problem (first the problem I faced and then the solution):
I downloaded Android NDK latest version from "developer.android.com/sdk/ndk/index.html" which was "android-ndk-r9-windows-x86.zip". Then I extracted it in C:\ directory then I added a ";C:\android-ndk-r9" in my PATH variable. Then I installed "Sequoyah Android Native Code Support" using eclipse "install new software" option (Help ➤ Install New Software➤type "Indigo - http://download.eclipse.org/releases/indigo" in the work with field ➤ go to Mobile and Device Development category and select Sequoyah Android Native Code Support).
Then I went to eclipse menu "Window ➤ Preferences ➤ Android ➤ Native Development" and entered "C:\android-ndk-r9" in the NDK location and got error " Invalid path for NDK".
Solution: I search exhaustively on internet and tried different solution but the solution worked for me was:
I downloaded the older version of NDK ( download link: "dl.google.com/android/ndk/android-ndk-r7c-windows.zip" ) and extracted in C:\ directory using winrar and updated the PATH in environment variable to point to the new NDK version 7c. When now I entered the path it accepted. No error appeared.
the problem is Sequoyah doesn't accept new version because it has not updated since 2011 ( I'm not sure)
Note1: for Linux users download link: "dl.google.com/android/ndk/android-ndk-r7b-darwin-x86.tar.bz2"
Note2: you can change the version in the link according to your requirement for example "dl.google.com/android/ndk/android-ndk-r4bc-windows.zip" to download version 4b.
Thanks.
Try to create a new systems variable called "NDK" and set its value to the NDK path.
Check your path to the NDK-- this has, on more than one occasion been the issue for me, at least with the SDK. (Not NDK in my instance) I know that, for instance, at the moment my NDK path is ~/android-ndk-r6/android-ndk-r6/
Also, to install gcc in windows, you must install Cygwin or such compatible gcc setup for windows. (The docs here say that it is required, but I think I may have heard of people using some slightly different implementation.) Cygwin works well for me, but you may need to specify gcc, make, and so on, in the installer as packages to be downloaded and set up on your machine, so read your installation options carefully. If you find that you have more packages that need to be installed, you can run the setup.exe program again and install them in-place.
In addition, here (at the bottom of the page) you can find an installation guide for the NDK in case you run into further issues.
Hope some file is missing in your ndk folder, so that it is unable to identify the ndk folder. Download ndk again and load it, otherwise update the native development plugin...
You said SDK and NDK are in same folder. It could be a conflict with the route. Try this:
Uninstall NDK
Reinstall NDK at D:\ecpspace\NDK\android-ndk-r7b
Create new PATH on enviroment var
Restart computer
On linux work for me, i had 2 ndks installed in different routes, and when i used eclipse, was compiling using the other one, and don't worked as i wanted.
This might sound dumb, but did you download the correct package? I had the same problem on linux until I realized I was trying to use the Windows version (I had downloaded it earlier while I was trying to install it on a different computer with cygwin). I downloaded the linux package and everything worked.
I've only been at this for a couple of days, but in my brief experience, the NDK and eclipse do not play well together. I would suggest moving to the command line for the NDK portion of the project for the time being. Some good tutorials can be found at:
http://www.cmumobileapps.com/2011/08/31/compiling-open-source-libraries-with-android-ndk-part-1/
http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/
I have similar bug (Eclipse Version: Indigo Service Release 2, Build id: 20120216-1857). The main problem was in Sequoya plug-in. Problem disappear when I update Sequoya to the latest version.
I am trying to make Android programs using IntelliJ. Unfortunately, I cannot get the Android SDK to be recognised on IntelliJ. (I.e. Eclipse has Android SDK Manager installed just fine.)
I select create new project from scratch.
I give the project a name and select make Android module.
Create source directory (next).
The computer then shows Android SDK none. I click the ellipses (...) and the program can see my JDK files.
I click on the + and select Android SDK.
I then find the directory c:\Program Files (x86)\Android\android-sdk.
However, when I click OK a dialog box appears stating "Please select Java SDK". It only gives me the choice of 1.6 (and not the other one 1.7). I then press OK for 1.6.
Finally the computer then reports it cannot find any Android targets in this SDK.
Please help!!!!
Before creating a new Android Project on IntelliJ Idea, you need to configure the Java and Android Development Kits at the IDE level.
Assuming you already installed the JDK and the Android SDK and you just launched IntelliJ (I'm using version 13.0.2):
Press Ctrl+Shift+Alt+S (to access the Project Structure dialog)
On the left navigation pane, click on 'Project Settings->Project'
On the right navigation pane, you should see a drop-down list displaying '<No SDK>'
Click on 'New', select 'JDK' and choose the path to your JDK
Click on 'New', select 'Android SDK' and choose the path to your Android SDK
Please note you have to define the JDK before the Android SDK.
This procedure is documented at:
https://www.jetbrains.com/idea/webhelp/configuring-global-project-and-module-sdks.html
On linux, run tools/android under the SDK to run the Android SDK Manager. Then download one or more of the platforms. Check out "SDK Readme.txt" in the SDK directory for more. Once you're done there, you will be able to select a platform, and your IntelliJ system will start to run.
For others who may encounter this issue on Intellij14 + Mac - the solution that worked for me was to
1) Open intellij - select add android sdk from the project settings section, select the android-sdk-macrox root directory
2) the sdk manager pops up - download at least 1 package.
3) Restart intellij (without this restart, it didnt seem to work)
Oddly, IntelliJ 12 Community doesn't give us the option to select the JDK location for Android projects.
I've found a workaround for this:
First, create a new Java project. I used 'Java Hello World' project. This'll give you the chance to select your JDK.
Install the Android SDK and run the Android SDK Manager to install tools and a platform, as others have mentioned.
Create a new Android project. Under 'SDK', select the Android SDK. Intellij will remember the JDK location you defined in step #1.
On Mac, IntelliJ won't detect the installation of Android SDK. When selecting SDK for new Android module, select your android-sdk-macosx folder as your location.
More info: https://peterboctor.wordpress.com/2010/12/02/installing-the-android-sdk-on-mac-os-x/
Alternatively, Google just releases Android Studio which is a whole IDE base on IntelliJ.
With IntelliJ IDEA 14.1.2, I couldn't select the Android SDK install location on Mac OS X. That install location was ~/Library/Android/sdk, which IntelliJ wouldn't navigate to because ~/Library is a hidden folder. So I created a symlink in my home directory (ln -s ~/Library/Android/sdk/ ~/AndroidSDK) and IntelliJ DID let me select that.
(linux, osx)
When going standalone (without Android Studio), make sure you have the sdk tools (from the standalone sdk, "command line tools" option), build-tools, platform-tools and an sdk (platform).
./tools/bin/sdkmanager --update
# list available packages (pick a version)
./tools/bin/sdkmanager --list
# install requeriments
./tools/bin/sdkmanager "build-tools;26.0.0"
./tools/bin/sdkmanager "platforms;android-26"
# you might get wrong permissions from the downloaded packages
sudo chmod -R +rxw tools # will need write perm to create AVDs
This may help others. I found that I couldn't get IntelliJ (MacOS) to recognise the Android targets in the android-sdk-macosx folder. Moving the Android SDK folder out of the Applications folder and into a directory in my User's folder resolved the issue. IntelliJ was then able to recognise the Android SDK. It may have had something to do with permissions, but no errors were shown to indicate this. Hope this helps.
I had the same problem with version 15 intelliJ after upgrading on OS Linux Ubuntu 12.04
I found because the android sdk wasn't in the home folder of the user running intelliJ that you had to change the Folder/file permissions before it would see this
Mine was in the root
Issuing the command chown -R <yourusername> /path/to/android_sdk_dir
solved the problem for me
If this fails after doing this delete the ~/.ideaC(Lastversion number) any previous ~/.ideaC(Lastversion numbers) folder's and then re open intelliJ
You will have to go through the initialization of the IDE and give the path to your Java installation ver8 upwards only on intelliJ version15 and thereafter your android sdk installation
I found this can also cause conflicts
As a further tip add the following to the very end of your ~/.bashrc using one of your editors my (nano , vi etc )
Example vi ~/.bashrc
The following lines set the Android Path
PATH=$PATH:/path/to/android/:/path/to/android/tools
export PATH
For SDK version r_08 and higher, also add these two lines for adb:
PATH=$PATH:/path/to/android/platform-tools
export PATH
for setting android emulator to 32 bit version add this line
export ANDROID_EMULATOR_FORCE_32BIT=true
Exit your choice of editor (vi , nano etc ) and
Re invoke bashrc with the command below
source ~/.bashrc
Hope that helps you
You need to run SDK Manager.exe to download at least one of the platforms, then you'll be able to select the downloaded platform, see also this tutorial.
If you are behind a proxy server :
1.After starting the Android-SDK-Manager, go to :
Tools > Options.
Add your proxy details.
2.Then go to Packages > Reload
3.After this you should be able to see all the platform options of the Android.
PS : Pheew! Spent an hour figuring this out!
You can create symlink to your sdk location, even to hidden folder. And then point point IDEA to symlink.
For example: ln -s /Users/*username*/Library/Android/sdk /Users/*username*/androidsdk
I followed a tutorial to install Eclipse and the Android development files onto an Ubuntu (Lucid) installation and Iv a feeling things are not quite right.
The tutorial can be found here.
The problem seems to be that because everything was installed into the /opt folder I am unable to load any of the sample files because of course they are read only, and I'm unsure about how safe it would be to run Eclipse as root.
My thoughts were to remove all of the Android files and start again and set the location in my /home folder somewhere, but I am unable to find any information on actually removing it (Or if this is in fact the best thing to do).
Here's what you need to do:
Install the latest java JDK.
Within eclipse, install the android ADT plugin http://developer.android.com/sdk/eclipse-adt.html
Download and install the android sdk http://developer.android.com/sdk/index.html
Run the AVD manager (in the android sdk) to install the platform components. (this can be ran from within eclipse)
In eclipse, go to preferences/android and set the SDK path.
Create an android application!
Good luck!