Cannot compile with API 18 - android

I have installed Android Studio 0.2.4 and the SDK for API 18 from http://dl.google.com/android/installer_r18-windows.exe.
Now, when I start a new project, I can choose target SDK : API 18, but I can only compile with API 17. What to I have to do in order to compile with API 18?

In my case I was previously using intelliJ 13 EAP and switched to Android Studio for better Gradle support. Android Studio was pointing to a different Android SDK than I was updating. Android Studio bundles an Android SDK and places it in "\(relevant Program Files)\Android\android-studio\sdk" for all users or "\Users\(username)\AppData\Local\Android\android-studio\sdk" for just me user. So in your case I don't think you needed to download the SDK separately and it would have defaulted to the bundled SDK. To check or switch Android SDKs in Android Studio:
From the initial start screen choose "Configure/Project Defaults/Project Structure".
Click on "Project Settings/SDKs" on the left.
Check "Android SDK home path" points to the Android SDK you are using
and update if necessary using "Apply" or "OK".
Restart Android Studio and try create a new project.

After updating, make sure you have android-18 in your android-stuidio/sdk/platforms folder. I had to copy mine from my Android folder where sdk manager downloads them on my pc. After I did that, it made the dropdown with api-18 available.

Related

how can I download old packages( android 5.0) on sdk manager of Android studio 2.3.3

I am using eclipse all the time. I want to study android studio , and downloaded android studio and sdk. When I run the sdk manager , only android 7.0 was installed. The new sdk manager has a few differences. I don't know how to download android 5.0 packages?
Run sdk manager and you will see something like this:
You can check any android version you want here and by clicking apply and ok, it starts downloading.
If you don't want the whole package for each android version, you can click the show package detail checkbox on the button right of this window and see details of each package like below image:
Here you can check any subpackage you need and then click apply and ok.
It is also possible to copy and paste platforms, build-tools and other modules you need from your eclipse sdk to android studio sdk. Or set in your android studio preferences to use eclipse sdk.
You should launch the standalone SDK manager to have access to available packages.
Your SDK path is D:\Android\SDK.
Use explorer to open that directory then launch sdk manager.exe.
Now you have access to available packages.
It is also possible using android studio itself. check sdk tools and sdk update sites. Available packages can be found there too.

Unity requires Android SDK to be minimum API level 21

So I've been trying to build a Unity 4.6.1 project in Android, but the problem is that my Android SDK is outdated. However, I believe Google discontinued support of the traditional ADT to switch to Android Studio. Android Studio doesn't have an easy to find SDK folder in version 1.0.1. This is the error I get: "Error building Player: UnityException: Minimum platform required is Android 5.0 (API level 21)" How do I build my Unity project for Android, if the ADT doesn't have support for API level 21?
Click on the SDK manager button (on the top) and in a grayed out text on top of the window (which looks like it did in ADT) it should show you the location of your SDK(e.g. C:\users\admin\appdata...) . And you can change that location in the settings. Just remember to move the files.
1) Download SDK Tools (v25.2.5) from http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
2) Extract in a folder and navigate inside.
3) run android.bat which would open SDK Manager.exe. Update the packages from this tool (must done step). You can also install any specific API if required in your unity project.
4) In Unity, Go to Edit -> Preferences -> External tools and update path for JDK and the path of the folder where you extracted SDK Tools.
Now Unity would build for android without any issues.

"Please specify Android SDK" in Android Studio 0.2

I'm trying to run AVD/SDK manager from Android Studio. Each time the dialog pops up.
It's strange because i'm already specified Android SDK.
Is there any another place where i should add Android SDK path ? Thanks
I do not use Android studio, but suppose you need specify SDK in Modules scection
Simply perform these 3 steps
Open gradle.buld in your app module
Change minSdkVersion and sync gradle
Revert back your minSdkVersion and sync gradle again
For me, in the wake of a Windows Easy Transfer that didn't 100% work, the answer was to do the following, and the key step is in bold:
File->Close Project
Click "Configure"
Click "SDK Manager"
Select the appropriate Android API, e.g., "Android 4.3 (API 18)" for the project
While you're here, also select the appropriate Android SDK Build-tools, e.g., 18.1.1
Click "Install packages..."
Close out and reopen your project, and you should have no problem accessing the SDK Manager via Tools->Android->SDK Manager
Note: You can determine which versions of the Android SDK and SDK Build-tools you need by inspecting your build.gradle file. In my case, I had the following lines:
compileSdkVersion 18
buildToolsVersion "18.1.1"
My experience is somewhat peculiar, because I recently migrated from Windows 7 to Windows 8.1 using Windows Easy Transfer. When I did this, my local git repository and some of my Android Studio settings transferred over, but apparently not everything. When I installed Android Studio on the new machine, I set my ANDROID_HOME environment variable, then opened Android Studio, and it immediately put me in the project I had most recently opened on the old machine. My fresh install of Android Studio didn't include the Android 4.3 SDK, and it seems that jumping straight into the project threw SDK Manager for a loop.
Prior to performing the above sequence of steps, I confirmed that my ANDROID_HOME was correctly set. I also tried setting the project default SDK, as described here: https://stackoverflow.com/a/18409923/315702. AND I tried setting the SDK within the Project Structure of the project that was giving me trouble. None of these things fixed my particular problem.
I fixed the issue by setting correct android sdk
Android Studio->project structure->Modules(app)->properties tab-> set the correct SDK
You can simply tap Sync Gradle
Nice and Clean !!!
For me, what did the trick was changing the compileSdkVersion 19 to compileSdkVersion "Google Inc.:Google APIs:19" so it uses the Google API platform instead of just the 19 platform.
Right click on your project and select Project Structure, on left hand select sdks and in right panel browse your sdk from sdk folder like (adt-bundle-windows-x86_64-20131030 folder for Windows)
For me even simpler steps worked:
Open buld.gradle in app module
Add a space or newline on any line's
end
Sync gradle
Note I am on Android Studio 2.x , but solution should hold for earlier versions of android studio as well
My environment is not exactly same as yours. I am using Android Studio 0.5.2 (android-studio-bundle-130.737825-windows.exe). I also met the "Please specify the Android SDK" message as your screenshot.
After some investigation, I notice the "SDK Manager" binary was missing in the Android Studio. Then I installed adt-bundle-windows-x86_64-20130917.zip. In Android Studio - File - Project Structure - Android SDK - Android SDK location, fill in the folder for adt-bundle-windows-x86_64-20130917\sdk. And everything was OK.

How do you add an SDK to Android Studio?

I'm using Google's Android Studio 0.1 based on IntelliJ, and I cannot figure out how to add additional SDKs to my project.
I exported my existing project from Eclipse to a Gradle project, which I imported into Android Studio, as recommended by Google.
My project's SDK is Google APIs 2.3.3. However, I use a library called PullToRefresh which appears to need SDK 4.1, so I'm trying to add the SDK 16 to my project.
I've already made sure to download the SDK using the SDK manager. These SDKs are added to the Android Studio.app's sdk folder automatically.
I opened the Project Structure window, clicked "SDKs" under Platform Settings, and I currently see JDK 1.7 and Google APIs 2.3.3 shown. I click the + sign above that list to add a new SDK. I then navigate to the sdk directory that has android-16, as shown in the screenshot below. I am not quite sure what this wants me to add, but I've highlighted the android-16 folder (about the only thing I can select), and when I click "Choose," the window disappears, but no new SDK appears in the SDK list.
And here is a screenshot of my SDK Manager view, showing the installed SDKs:
I had opened a ticket also with Google's support, and received the solution. Instead of choosing the sdk/platform/android-16 folder, if you select the top-level "sdk" folder instead, you'll then be asked to choose which SDK you want to add. This worked!
You have to put your SDK's in a given directory or .app directory. You have to do it in finder while you are out of the application i'm assuming, but personally I'd use terminal in Mac instead of doing it in the App itself or finder. According to Google:
On Windows and Mac, the individual tools and other SDK packages are saved within the Android Studio application directory. To access the tools directly, use a terminal to navigate into the application and locate the sdk/ directory. For example:
Windows: \Users\<user>\AppData\Local\Android\android-studio\sdk\
Mac: /Applications/Android\ Studio.app/sdk/
You can change from the "build.gradle" file the line:
compileSdkVersion 18
to the sdk that you want to be used.
I had to restart Android Studio for changing the sdk after installing a new one. Then Android Studio asked me for configuring my SDK and let me do it.
And For linux(ubuntu)
/usr/share/android-studio/data/sdk
Download your sdk file, go to Android studio: File->New->Import Module
I followed almost the same instructions by #Mason G. Zhwiti , but had to instead navigate to this folder to find the SDK:
/Users/{my-username}/Library/Android/sdk
I'm using Android Studio v1.2.2 on Mac OS
For those starting with an existing IDEA installation (IDEA 15 in my case) to which they're adding the Android SDK (and not starting formally speaking with Android Studio), ...
Download (just) the SDK to your filesystem (somewhere convenient to you; it doesn't matter where).
When creating your first project and you get to the Project SDK: bit (or adding the Android SDK ahead of time as you wish), navigate (New) to the root of what you exploded into the filesystem as suggested by some of the other answers here.
At that point you'll get a tiny dialog to confirm with:
Java SDK: 1.7 (e.g.)
Build target: Android 6.0 (e.g.)
You can click OK whereupon you'll see what you did as an option in the Project SDK: drop-down, e.g.:
Android API 23 Platform (java version "1.7.0_67")

android target api not visible

i have installed android sdk.
i have also downloaded and installed the adt plugin in my eclipse ide.
now when i go to preferences to set the path for android sdk, when i set the path and then press apply-- automatically the target api should be listed below. But they are not being listed below for some reason.
what could be the problem?
thank you in advance
Within eclipse, go to Window > Android SDK and AVD Manager then choose Installed Packages from the left hand side. Do you see things like SDK Platform Android 2.3, API 9, revision 1 listed? If not then you need to download them. Select Available Packages then expand Android Repository then select the SDK versions you want to download.

Categories

Resources