Android studio build failed due to reasons: missing components Build Tools - android

Installed Android Studio Dolphin 2021.3.1 on Windows 10 System.
While running first Simple Hello World App I am getting error Build failed
SDK API 33 is installed
I tried to install SDK Build tools using --> SDK Tools ---> Android SDK Build Tools
But it also failed to install.
I changed build.girdle file as follows :
android {
namespace 'com.example.myapplication'
compileSdk 33
defaultConfig {
applicationId "com.example.myapplication"
minSdk 28
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Build Tools folder structure contains as
Tools Folder structure contains as :
please guide , what is wrong with setup?

Related

android app installs but i can't open on android 4.4.2

i have built an app in android studio.
Here is the story so far:
1) the app runs on all my android devices with 5.0 or higher. 2) the app runs in the emulator with Android 5.0 or higher AND android 4.4 as the OS
The issue is that it will not open and run on devices, that is an Android KitKat (Android 4.4.2). I can install the app and see it in the installed apps list, but I cannot OPEN the app, nor will it run on the device
I used the android studio to create the app. Here is the app Gradle.build file:
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.app"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
You need set your project's target SDK version lower. In your project, you should set the target SDK version lower than 29.

Issues while running AVD

I am trying to run AVD with newly installed Android Studio. I have an AMD Ryzen processor, who I downloaded the ARM API.
I still get an error
minSdk(api27) > devSdk(api25)
I learnt that I need to make changes in the build.gradle file.
when I opened it. It already had the settings as below
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.rahul.myfirstandroidapplication"
minSdkVersion 28
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
please help
Your min SDK in the gradle file should be 25 or lower if you want to run the application on this AVD or you should create another AVD with different SDK version.

Why android studio always install sdk plataform 26

I'm started developping to android with android studio and im targeting api 19 so i've configured all workstation to run around it
but even if i configure a project to api 19 always on every new project android studio forces me to download android sdk 26
the default generated gradle is like
compileSdkVersion 26
defaultConfig {
applicationId "com.tomatedigital.myapplication"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
My computer runs on ssd and i have low free space, but even if i had tons of GB free why am i forced to download something i dont want to use? is there a way to disable it?

APK Installation failed after updating target SDK to android P

I have updated compile SDK and target SDK version to android P but after updating application is not able to install it is giving the same error popup even after uninstalling the older version of APK from my device.
My build.gradle settings :
compileSdkVersion 'android-P'
defaultConfig {
applicationId "com.my.app"
minSdkVersion 15
targetSdkVersion 'P'
versionCode 31
versionName "1.2.14"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
What I figured out is that you can't target a developer preview version as the targetSdkVersion in a device or emulator that has a release version. If you really need to set the targetSdkVersion, you need to run it in a device/emulator running android-P developer preview.

My first program in Android Studio (Hello world)

Everyone!!
I try to launch my first program in Android Studio. I have got error, something like this:
Failed to refresh Gradle project 'Hello World'
Cause: failed to find Build Tools revision 16.0.2
Please install the missing Build Tools from the Android SDK Manager.
Open Android SDK Manager
I installed Android SDK :
Honestly i don't see in my installations Android SDK Build-tools revision 16.0.2
I have googled to download this revision, but i couldn't find any refs... ??
Can you help me with this problem?
Looks like you have a very old version of Android Studio. Have a look at the android section in the build.gradle file in your project. Your screenshot shows that you have build-tools 19.0.3 installed, so change the appropriate line to
buildToolsVersion "19.0.3"
And update your Android Studio so it won't produce outdated build.gradle files in the first place!
Find the root build.gradle file. It will look something like this:
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 15
targetSdkVersion 19
versionCode 4
versionName "0.9.4"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
Change the buildToolsVersion to 19.0.3 and be sure you installed this build tools version. The latest version of Android Studio should give a notification if you use an outdated version of buldToolsVersion.
Small side note: Please be aware that Android Studio is still in beta. Not everything works perfectly at the moment. Nevertheless, I think it works already a lot better than Eclipse.

Categories

Resources