How to fix the default compilesdk version? - android-studio

I want to know how to fix my compilesdk version to 33 in build.gradle(:app) file.
Whenever I create a project, I have to go to the gradle file and change the sdk version from 32 to 33.
this is so annoying routine for me.
Anybody know about this issue, please help me :<
-- I have attached some setting image
sdk manager
I unchecked Android SDK Platform 32. but when I create new project, 32 is automatically downloaded.
What did I try
Uncheck the other version in sdk manager window
Then create new project, unchecked version 32 is automatically downloaded

Whenever I create a project, I have to go to the gradle file and change the sdk version from 32 to 33.
The SDK version 32 is automatically added by the project template generator in Android Studio. It is usually increased after some time but not frequently. Its something you gotta learn to live with because not all developers prefer the newest SDK Version.
I unchecked Android SDK Platform 32. but when I create new project, 32 is automatically downloaded.
This happens automatically because of the reason above,you dont have to fight it.It is also a one time occurence.The IDE downloads the SDK source files only once. If you change the compile SDK to 33, it proceeds to download the source files for that version.

Related

Is it possible to prevent Android Studio from downloading older SDKs automatically when opening older projects?

Let's say you're using API 29 for your current project. You open an older project to see how you did something, which used API 28. Android Studio starts automatically downloading everything you need for the older project to build, including the entire API 28 SDK. Is it possible to prevent that from happening?
Edit the build.gradle with any other text editor, before opening it as a project in Android Studio.
About the same applies for Gradle wrapper versions.

Android Studio Failed to find target with hash string 'android-26'

I've installed latest Android Studio and
- I've created new project for sdk 25
- I have sdk 25 installed
I have this issues:
first of all, I don't see Tools > Android > AVD Manager. So I have no idea how can I set up additional AVD
second: I get this error in console
Error:Failed to find target with hash string 'android-26' in: C:\Android
Install missing platform(s) and sync project
Why is it complaining about version 26? I have project with api 25 set up?
This problem seem to emerge because AndroidStudio tries to target the last version of SDK it aware of. There few ways to solve it and #HarryFromMarydelDE Jan 7 at 20:18 presented nice solution in form of youtube video. I'll make this answer verbose and more detailed:
One way to deal it is to install sdk-26. You really may not have Android->AVD Manager menu items under Tools menu. You can find SDK Manager icon just under the Android Studio main menu, or open File->Settings (Ctrl+Alt+S) and go to Appearance&Behavior->System Settings->Android SDK
Other way is to find gradle.build file in YourAppName/app folder, find lines: compileSdkVersion 26 and targetSdkVersion 26 in it and change number into SDKs you already have.
But, if you'll change target sdk from 26 to 25, you may encounter more errors. Particularly, if you checked Back Compatibility box when you created your app in wizard. In this case you'll need to change 'com.android.support:appcompat-v7:26.1.0' string to use sdk 25 version of appcompat-v7:25.1.0 in the same file.
After this, you may encounter one more error:
Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (25.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
To resolve it, edit app.iml in YourAppName/app folder: change 27.1.1 numbers to 25.1.0 and hopefully, Gradle will finally build your project.

Gradle sync error

After installing Android studio for first time, the gradle didn't sync.
The dependency is this: classpath 'com.android.tools.build:gradle:2.3.3'
so after watching some tutorials I downloaded and extracted gradle-3.3-all.zip in the .gradle folder.
Still it won't work and this is the error:
Error:CreateProcess error=216, This version of %1 is not compatible
with the version of Windows you're running. Check your computer's
system information and then contact the software publisher.
I'm using windows 32 bit btw.
This is my first time with android studio so pretty much everything in it is Greek for me. Please help.
not compatible with the version of Windows you're running
The download button on the Android Studio page is the installer for the 64 bit version, as far as I know, which is recommended since almost all newer computers are running 64 bit.
If you really want to continue using 32bit operating system, you're going to need to scroll down the page to actually download and setup that one.

standalone sdk manager in Android Studio

Tools => Android => SDK Manager to open SDK manager, and then check the "Show Package Details" to see the the list of installed and not installed components.
I try to find "Sample" folder under individual Android version, but I just unable to find the "Sample" component. I am very upset because I want to install Gesture builder that is inside the "Sample" folder.
By accident, I click the "Launch Standalone SDK" to launch the screen that looks similar to the SDK manager on eclipse, and I find the Sample folder.
Anyone can tell me what the reason I am unable to find the Sample folder on opened SDK manager (there are 3 tabs: SDK Platforms, SDK Tools and SDK update Sites)
Thanks
You need to download the samples for the particular sdk you're targeting. Furthermore, samples change from sdk to sdk.
So first find out which sdk, did the Gestures Builder sample come from, and then download that samples for that sdk.
After that, use the Android Studio wizard to create a project from the sample. Just be sure to target the same sdk (you can always change that target sdk later, once you have the sample).
Using Android Studio is best way to do it. There is no need to go to the folder itself and do things manually.
Actually, GesturesBuilder seems to be very old, it's api level 4 (Android 1.6). No wonder you have trouble finding it. My suggestion would be not to bother with it and try to find a more recent project example directly from github.com

Google Glass (Not installed)

I am new to Android Studio and google-Glass.
I am trying to create a knew project that will use google-glass but my problem is when I have to Check/select glass it is Disabled and I do not know how to fix this problem.
See the Image below.
and here is my SDK that shows that i have installed APK 19.
and with the Image below it shows that the glass does appear on Android Studio
can anyone please help me if the is something wrong that i am doing.
will appreciate your Help.
In my case, I needed to make sure I also installed the latest Android SDK Tools, Android SDK Platform-tools, and Android SDK Build-tools. Lastly, also install Android SDK Build-tools rev. 20. All four of these are under "Tools" in the SDK Manager.
Downloading the above allowed me to create a new Glass project.
Also try:
Go to File -> Project Structure -> SDK Location. Make sure it is the correct SDK directory.
I installed the GDK with version 1.3.2 but, even checking the correct path of the SDK and GDK, the initial wizard for starting a new project didn't recognize it (still was saying "Glass (not installed)").
I had then to uninstall the current version of Android Studio and delete the SDK; I installed version 1.1 and downloaded again the SDK and GDK and then it works.

Resources