How to change default sdk version in Android Studio in windows OS - android

Whenever I create sample for eg:login template in android studio the project is getting created in android sdk version 23, I want to change this for all projects created in future.How to change the sdk version of android studio. Changing gradle settings after creation of project wont help since all the UI elements will be created for sdk23.Please suggest a solution.

You can change it from
your module level build.gradle file
compileSdkVersion 23
minSdkVersion 15
targetSdkVersion 23
change these values and rebuild your code.

Related

Android Studio - Android Gradle Plugin That Supports 33 (?)

It occured three days ago and couldn't find a solution yet. When I tried to run an app on my phone I receive this eror : " Recommended action: Update this project's version of the Android Gradle plugin to one that supports 33, then update this project to use compileSdkVerion of at least 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on)."
I literally tried every kind of update but still couldn't figure it out.
I updated Git VSC plugin , compileSDKversion ,Android Gradle , crated a new project , restarted Android Studio... None of them worked out.

Android version downgrade

Please I am trying to build a small android app with ionic but I downloaded android SDK 5.1.1 .
I wish to deploy to a device that has android version 2.3.3 but it won't even build .
It keeps telling me that the target app is android-22. I want it to build for a lower version like android-8.
Please any help will really be appreciated.
I only want it to be able to build for a lower version
I tried to edit the version in the androidManifest.xml files on my project but still I get errors
->First of all, let`s make sure you have downloaded the plateform for Android 2.2 using Android SDK Manager.
->Set android:minSdkVersion to 8 in androidManifest.xml
->Verify the BuidTarget attribute, since it specifies the development tool of which api to provide you.
->Your problem seems to be the absence of API8 in your SDK.
you might need to change your minSdk in build.gradle
in the app build.gradle file set the min sdk version as 8.
defaultConfig {
applicationId "com.etrade.mobilepro.activity"
minSdkVersion 8
versionCode 87
versionName "4.5"
}
Since the app is not building I guess you don't have that particular sdk.I would suggest downloading the sdk through sdk manager.

Android Studio build error for new project

I have uninstalled and reinstalled the Android Studio and when i created a new project I got the error stating files under build cannot be changed.Is this a problem with Gradle?.
Update your SDK, i.e. Marshmallow (API level 23). Then, choose targetSdkVersion to 23 and compileSdkVersion to 23. Finally, rebuild your project through Build > Rebuild project.

Android Studio with compileSdkVersion 16 don't compile on Mac

I have used linux for a while, and now I'm on Mac.
I use Android Studio and I want to compile my old projects exported from Eclipse on linux. I have "repaired" gradle configuration to work on Mac, but I have some issues with compileSdkVersion setted on 16 (like I used on linux). My project give me some errors about appcompat-v7
Image link: (not sufficient points to post image) http://i.stack.imgur.com/uWj7f.jpg
When I set a bigger compileSdkVersion, it gives me about 5 errors, but I want to compile like on linux with version 16. What I need to do?
Regards!
To use AppCompat 23.0.1, you must compile with API 23.
Note that compileSdkVersion does not actually change any behavior in your app - that is what targetSdkVersion does.
Check your compilesdk version. It needs to be >= to the support library version. E.g if you use appcompat version 7.23, then use compileSdkVersion 23

failed to find target with hash string 'android-22'

I have updated android studio with latest version and then after googling I also updated Android SDK with API 18 but still it gives the same error.
Just click on the link written in the error:
Open Android SDK Manager
and it will show you the dialogs that will help you to install the required sdk for your project.
Open the Android SDK Manager and Update with latest :
Android SDK Tools
Android SDK Build Tools
Then Sync ,Re-Build and Restart Your Project
Demo Code for build.gradle
compileSdkVersion 21 // Now 23
buildToolsVersion '21.1.2' //Now 23.0.1
defaultConfig
{
minSdkVersion 15
targetSdkVersion 19
}
Hope this helps .
Okay you must try this guys it works for me:
Open SDK Manager and Install SDK build tools 22.0.1
Sync gradle That'all
I modified build.gradle compileSdkVersion to 23 from 22 and targetSdkVersion to 23 from 22.
My API level was 23. I had to update the API version to 23 as well.
I had to import my project from Eclipse to Android Studio. It worked for me.
I had similar issue. I updated android studio build tools and my project didn't find "android-22". I looked in android sdk manager and it was installed.
To fix this issue I uninstalled "android-22" and installed again.
I created a new Cordova project, which created with latest android target android level 23. when i run it works. if i changed desire android target value from 23 to 22. and refresh the Gradle build from the Andoid Studio. now it's fail when i run it. i got the following build error.
project-android /CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java
Error:(217, 22) error: cannot find symbol method requestPermissions(String[],int)
I changed the target level in these files.
project.properties
AndroidManifest.xml
and inside CordovaLib folder.
project.properties
However, i also have another project which is using the android target level 22, whenever i run that project, it runs. Now my question is can we specify the desire android level at the time of creating the project?
I think you should install API 18 from android sdk if not already installed, otherwise you can try "invalidate caches and restart" (Find: File->invalidate caches and restart).
Change
compileSdkVersion 18
minSdkVersion 10
targetSdkVersion 18
in build.gradle in your app directory/module
Or Download Latest API Version
In sdk Manager download android 5.1.1, it worked for me
Open project.properties file and change the line with target=android-22 to the desired value.
For example:
target=android-19

Categories

Resources