Unity requires Android SDK to be minimum API level 21 - android

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.

Related

Could not find android.jar for API Level 26 in Visual Studio 2017

Could not find android.jar for API Level 26. This means the Android
SDK platform for API Level 26 is not installed. Either install it in
the Android SDK Manager (Tools > Open Android SDK Manager...), or
change your Xamarin.Android project to target an API version that is
installed. (C:\Program Files
(x86)\Android\android-sdk\platforms\android-O\android.jar missing.)
As you can see from below that I have the correct api sdk platforms installed but as you will notice on the error message, it is searching for an android-O directory.
Here is my directory which you will notice has everything in it but doesn't contain android-O
I looked in my visual studio project settings and here is what it shows for target framework
Does this mean that Visual Studio 2017 doesn't support Android SDK 26+?
I discovered that you can fix this issue with 2 steps:
Download and install Visual Studio 2017 Preview by going to https://www.visualstudio.com/vs/preview/
Download and install the Xamarin update extension on both versions of Visual Studio 2017 installed by going to https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/extension-gallery/ and follow the steps
If you're building for a Xamarin project, you may need to rename the folder in the SDK folder from "android-{alphabetOSVersion}" to "android-{numericOSVersion}" (IE change the folder "android-o" to "android-27").
This should be done in the C:\Program Files (x86)\Android\android-sdk\platforms folder.
I was getting a similar issue.
Severity Code Description Project File Line Suppression State
Error Could not find android.jar for API level 29. This means the
Android SDK platform for API level 29 is not installed. Either install
it in the Android SDK Manager (Tools > Android > Android SDK
Manager...), or change the Xamarin.Android project to target an API
version that is installed. (C:\Program Files
(x86)\Android\android-sdk\platforms\android-29\android.jar missing.)
The easy fix was to follow the steps mentioned in the error itself from your Visual Studio (I was using Visual Studio 2019).
Click on the Apply Changes button and then reload the project.
MVS 2017 does support Android SDK 26+,
Im using it with v15.3.3.
If you have MVS 2017 installed on your machine,make sure it's up to date
then download and install the Xamarin update extension.
Check out this guide
https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/extension-gallery/
And as a rule of thumb,whenever you get the error "Resolve the “Could not find android.jar for API Level XX” in Xamarin Studio" this are steps to follow to solve such an error
This happens when you target your project to a non-installed Android SDK platform, to fix this you have to install the right components.
Step 1:Target another Android Framework
On the project you have created right-click the project > Options
Go to the Xamarin project configurations
Then go to Build > General > Target framework, and select other Android target framework.
Xamarin project Android target framework
Step 2:Install the Android SDK you need
As the second option you can install the missing components needed to debug on the SDK Android platform; for this you have to go to:
Tools > Open Android SDK Manager
Android SDK Manager Option
Then look at the API Level number on the error or look at the version of the target framework as stated at the previous steps; then select to install the “SDK Platform” and press the “Install 1 package” button.
Choose the right Android SDK Platform
Accept license agreements
license agreements
With this you are ready, press F5 and you can debug now.

How to Change Target API Version in Visual Studio Xamarin

My VS worked well before I synchronized my project with my friend's using GitHub. After that, somehow I notice Visual Studio targets different location to android.jar file. So, whenever I compile my code, I receive the following error.
Could not find android.jar for API Level 24. This means the Android
SDK platform for API Level 24 is not installed. Either install it in
the Android SDK Manager (Tools > Open Android SDK Manager...), or
change your Xamarin.Android project to target an API version that is
installed.
(C:\Users\Joshua\AppData\Local\Xamarin\MonoForAndroid\AndroidSDK\platforms\android-24\android.jar
missing.)
C:\Users\Joshua\AppData\Local\Xamarin\MonoForAndroid\AndroidSDK\platforms\android-24\android.jar is a directory location in my friend's drive.
How to change the target location of that android.jar file in VS 2015?
Looks like your app is trying to use Android N tools to compile or targeting API level 23
Under your Android project properties -> Application, set the Target Android Version and Compile using Android Version to API Level 23 to fix it
Go to android project then right click -> Properties -> Android Manifest (scroll down) then you will see Minimun android version and Target android version.
in vs project -> your application properties -> change target framework to your api version. that's it

Cannot compile with API 18

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.

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