Appcelerator 4 cannot find Android SDK on Mac - android

Appcelerator Studio 4.7.1.201609100950 on Mac OS X cannot find Android SDK. I have downloaded it with the button on the Appcelerator Studio Dashboard. After download was successfully finished, the Appcelerator Studio was not able to recognise it.
I was getting the following error : [Android SDK Home] No Android SDKs were found under the specified SDK location

I had this issue as well. The reason is (for me at least) is when I first created the App, it was with an older version of Studio & SDK.
One solution, is create a new Project with the latest SDK & Studio, then paste all your code in that new project (make sure everything is updated correctly in tiapp.xml), then you will see there is no more issues running Android.
You can also try it with just a new Mobile Project (with latest SDK, currently 5.5.1.GA), and see if it runs on Android. If this works, you can move all your code to this new project.

Did you try this:
To use the Android SDK with Studio, the path to the SDK must be set in the Preferences dialog.
Open the Preferences dialog:On Mac OS X, from the menu bar, select Appcelerator Studio > Preferences.
In the Preferences dialog, navigate to Studio > Platforms > Android.
Enter the path to your Android SDK in the [Android SDK Home] textbox by clicking Browse then navigate to the SDK directory.
The Android SDK will be found in the Library folder...something like /Users//Library/android-sdk
You did install the android-sdk right!?

What happens from command line when you run appc ti info -t android?
Also, check your Android SDK setting in appc ti config as well as check to see if you've set an environment variable in
/~/.bash_profile called ANDROID_SDK
, and if so that it matches the correct current location of the SDK
If you can't solve this try to change your sdk directory and change it in appcelerator too.
Hope that will help you.

I personally store my SDK and NDK in
/opt/android-sdk
and
/opt/android-ndk
with links in the .bash_profile
export ANDROID_SDK=/opt/android-sdk
export ANDROID_NDK=/opt/android-ndk
finally, use appc ti setup android to set the paths there as well. Both Studio and CLI will pick it up properly from there. Thx!

Related

Cordova fails to find ANDROID_HOME environment variable

I looked all over Google and Stack Overflow for an answer, but I couldn't find the right one for me. I am learning Cordova and I'm trying to run the android emulator through terminal, and when I run 'sudo cordova emulate android' I get this message:
''Failed to find 'ANDROID_HOME' environment variable. Try setting it manually.
Detected 'avdmanager' command at /Users/username/Library/Android/sdk/cmdline-tools/latest/bin but no 'tools/bin' directory found near.
Try reinstall Android SDK or update your PATH to include valid path to SDK/tools/bin directory.''
But I set the variables in the ~./bash_profile file and it looks like this:
export ANDROID_HOME="/Users/username/Library/Android/sdk"
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH=${PATH}:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
export PATH=${PATH}:$ANDROID_HOME/tools/bin
export PATH="$PATH:$ANDROID_HOME/build-tools/30.0.0-rc2"
I am using a MacOS Mojave, does anyone know what the issue is?
Thanks in advance
Apparently, in the latest version of Android Studio, the old SDK tools (under /tools, which Cordova seems to expect) are already considered obsolete. There is a solution documented here on how to install the old version of SDK tools.
Open Android Studio
Open Tools -> Sdk Manager
Click on the Sdk Tools Tab
Uncheck Hide Obsolete Packages
Check Android Sdk Tools (Obsolete)
Click Apply
This should download the old SDK tools under the correct folder.
However, I think Cordova also needs to keep up with the newest Android development tools. There's another change I needed to make after this:
I had to delete the tools/emulator and tools/emulator-check binaries, and add $ANDROID_HOME/emulator to my $PATH, since the current emulator binary lives under emulator/emulator instead of path/emulator. See this post.
Then I was finally able to launch the app directly via Cordova.

libGDX can not see Android SDK

I am a newbie android develiper. I have just installed the most recent Android Studio and downloaded libGDX setup tool. However, when I try to generate a new project, it shows the error:
Your Android SDK path doesn't contain an SDK! Please install the Android SDK, including all platforms and build tools!
I am pretty sure I have Android SDK installed and I put a correct location C:\Users\Denis\AppData\Local\Android\Sdk, because I copied it from Android studio.
This is how libGDX is checking if android SDK location valid:
public static boolean isSdkLocationValid (String sdkLocation) {
return new File(sdkLocation, "tools").exists() && new File(sdkLocation, "platforms").exists();
}
However, I don't have tools folder in my setup. Probably, in fresh Android SDK it was renamed or I don't have required tools installed, not sure (pls suggest in comments). However, the workaround is to create an empty tools folder in C:\Users\Denis\AppData\Local\Android\Sdk
I just had the same issue to day. I think the problem is that the SDK that comes with Android Studio dos not contain the "tools" folder. You'll have to download it manually and add it to the SDK. Here is the link. I hope this helps you.
I found a lot of questions similar to this and found the following information
"Where does Android Studio install sdk on Mac?
Configure Android SDK Variable In macOS.
Generally, the Android SDK is installed in the /Users/user-name/Library/Android/sdk folder on macOS."
https://www.dev2qa.com/how-to-set-android-sdk-path-in-windows-and-mac/
In your "Android SDK: " area on libGDX you can type in the following path and just replace with your username
/Users/"user-name"/Library/Android/sdk

ionic not finding android

I have tried to use ionic lab. I tried to build a simple blank app using the lab but when I go to build my android app it says I need to have android sdk. I have android sdk and the platform tools already. I even added to my path in case you were wondering. I was graciously sent here to ask for help after trying to research my issue by looking at "ionic android build error - failed to find android_home".(which was when i checked my environment path). I took a screen shot of both(environment and error from ionic lab console). error and
environment
For windows:--
set ANDROID_HOME=C:\<installation location>\android-sdk-windows
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
The Android SDK download does not include specific Android platforms. To run the code in this guide, you need to download and install the latest SDK platform. You do this by using the Android SDK and AVD Manager that you installed in the previous section.
Open the Android SDK Manager window:
android
Note: If this command does not open the Android SDK Manager, then your path is not configured correctly.
Select the Tools checkbox.
Select the checkbox for the latest Android SDK.
From the Extras folder, select the checkbox for the Android Support Library.
Click the Install packages... button to complete the download and installation.
Note: You may want to install all the available updates, but be aware it will take longer, as each API level is a large download.
Could you please do following stuff in terminal. It might be helpful for you.
Step:--1
export ANDROID_HOME=~/android-sdk-macosx
PATH=$PATH:$ANDROID_HOME/tools
PATH=$PATH:$ANDROID_HOME/platform-tools
Step:--2
Update SDK and go to directiory and set your SDK path properly.

I can't get IntelliJ to recognise my Android SDK

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

how to add Android platform into Netbeans 7.0, after installed android plugin

I installed Android plugin using Tools/Plugins/Settings and copied the link there, and so on. In the next step, I would get to Tools/Java Platforms/Add platform, then it pope up with "1.Choose the platform folder" instead of "1.Select platform type". Because of that, I couldn't proceed into the next steps.
I tried to remove and reinstall Java SDK and Netbeans several times using different methods. But nothing has changed. I really appreciate the answer.
Thanks
You are following one of outdated install guides/tutorials. Current version of Android support only needs to know where your Android SDK is. Go to Tools | Options | Misc | Android and set the location there. You can find more details at http://www.nbandroid.org/
It can even detect this location automatically if you open some configured project but it seems this is not your case.
After installing the plugin the sdk and the platform then choose from netbeans file new project android project next choose the target platform listed under target name input package name and voila.
Installing the platform is a seperate step. Look in the sdk folder and read the readme. On linux, at least, it says to run the "android" program, which is in the tools folder. After installing the platform through this it should let you progress in setting up netbeans.
It's not an obvious step if you're a noob and head straight to google with "setup netbeans for android"

Categories

Resources