I am using Visual Studio 2017 and creating an Android App in C++.
I have one Android Packaging Project and a Android Library Project.
If I select the Android Packaging Project and go to:
Configuration Properties => General => Target API Level
The lowest I can select is KitKat 4.4, but I need to go down to 4.0.3.
But if I select an Android Library Project and go to:
Configuration Properties => General => Project Defaults => Target API Level
I can select down to Gingerbread 2.3.
So the question is, how can I select lower API level in a Android Packaging Project?
I have tried to install lowest API from Android SDK Manager and have tried to search on Google but not found anything helpful.
Before you can select a Target or Minimum API level in Xamarin.Android, you must install the Android SDK platform version that corresponds to that API level. The range of available choices for Target Framework, Minimum Android version, and Target Android version is limited to the range of Android SDK versions that you have installed.
For more detail you can refer to here
Related
I have a C# Xamarin Forms Solution in Visual Studio 2019 that was created from the Xamarin Forms Template.
When the Android version (Target Framework), (found in the 'Application' Tab of the properties Window of the Android project) is set to either
1) Android 8.1 (Oreo)
2) Android 9.0 (Pie)
then my app works great on a phone running Android 9.0
However, as soon as I change it to 'Android 8.0 (Oreo)' then Visual Studio generates errors and warnings. Here is an image of them:
The reason I think I need to change the Android version to 8.0 is so that I can use the app on Android phones with this version. When I try to install the APK file (built targeting either 8.1 or 9.0) on an 8.0 Android device then the app does not work.
The error suggestion to "..increase the $(TargetFrameworkVersion)..." seems odd considering I am trying to target a lower version.
I should point out that I have all the Android SDK's installed for 8.0/8.1/9.0 and all the Android SDK Build Tools.
What am I doing wrong? I am wanting to target Android 8.0 (Oreo).
I am very new to Xamarin.
You only need to change the Minimum Android Version to run on lower API versions. Make Target Android version higher (to version 9) and Minimum Android Version to a version which you would like to support (maybe version 6). Also note that if you have any android support libraries or Xamarin.Forms, those also have a minimum build version. You have to target equal or higher version to build with those. Another thing you have to check is Supported Architectures (Properties-> Android Options -> Advanced -> Supported Architectures). Make sure it checked the architecture of the device that you try to deploy
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
I am absolutly new in Android development and I have the following problem trying to build a sample project that I have downloaded from Internet.
When I try to build it I obtain the following error message:
Error:Cause: failed to find target with hash string 'android-18' in: C:\Users\Andrea\AppData\Local\Android\sdk
Install missing platform(s) and sync project
So I search online and I found this SO link: Android studio - Failed to find target android-18
Ok so I go into Tools > Android > SDK Manager and infact I have installed Android 6 corrisponding to the API level 23 but not Android 4.3 corrisponding to API level 18.
So what it means? It means that I have installed a different version o the Android framework ?(is it the SDK considerable as a framework or what?)
So, on Android Studio can I install different version of the SDK?
I think that the API level have to be defined in some way into the dowloaded application. How can I specify to this application to don't use the API level 18 but instead it use the installed API level 23 ? I think that it is not a problem because I have installed a newest version that have to support all the stuff of the oldest one, is it?
I will explain the problem a bit for you and then provide you with the solution.
You are facing this problem, because your project is targeting API level 18 to compile the project. So you MUST have API 18 SDK installed to compile the project.
This is why the IDE is complaining that,
Install missing platform(s) and sync project
The SDK is not the framework. The Android framework is same all over, but with different API levels new updates are pushed to the SDK, the latest being API 23, Marshmallow.
You should not download an older SDK to compile the project.
Always try to use the latest SDK available to work with. So, just head over to your build.gradle file or AndroidManifest.xml file and change the compileSdkVersion to 23.
You can either change the compileSdkVersion version in build.gradle to 23 or whatever version you have in your local machine
You can obtain the API Level 18 from the SDK Manager.
I go into Tools > Android > SDK Manager and infact I have installed Android 6 corrisponding to the API level 23 but not Android 4.3 corrisponding to API level 18.
So what it means? It means that I have installed a different version of the Android framework ?
Yes, you have a newer version of the SDK.
on Android Studio can I install different version of the SDK?
Yes, that is what the SDK Manager is designed for
I think that the API level have to be defined in some way into the dowloaded application. How can I specify to this application to don't use the API level 18 but instead it use the installed API level 23 ?
It is defined. Check either the AndroidManifest.xml or the build.gradle file in the module for the app (not in the project root). You should see some combination of minSdk, targetSdk, and/or compileSdk with a number after it. Since you are getting an error about missing SDK 18, then that number will be 18.
I think that it is not a problem because I have installed a newest version that have to support all the stuff of the oldest one, is it?
The support libraries are separate from the core SDK. You cannot run SDK 23 specific code on devices that have a version less than 23, therefore, to be safe, it is recommended that you start with downloading SDK 18, then run it, then try updating the compileSdkVersion number.
I just installed Android Studio and when I was downloading Android 4.4.2 (API 19).
I noticed Android 4.4W (API 20) has already been installed by default.
How do I make sure Android Studio uses 4.4.2 and not 4.4W?
Is there a way to check which SDK Android Studio is currently selecting?
I'm using Mac o/s if it matters.
You can choose what version of API to use during a new project creation.
For existing project: File > Project Structure. Select the appropriate module on the left pane, then open Properties tab. Compile Sdk Version will be there.
Another option is to edit <project_folder>\app\build.gradle file manually.
1- Right click on the project's folder >> under Resources - Android.
2- you will find the current platform "checked".
I'm building an Android app, I'm a newbie and I was wondering what build SDK and Minimum required SDK is recommended?
Also what does each one mean?
Upto my knowledge build SDK means which Android O.S version you are building against and
Minimum required SDK means: the minimum Android O.S version you want to support.
For Example
If build SDK = 2.3.3
and Minimum required SDK = 2.2
then your application will run on 2.2 and above