Error in Android studio New Application - android

Whenever i start new application in android studio this error pop ups
what should i do

It seems that is because your Compile SDK version is below 23.
Make compileSdkVersion 23 in your buiild.gradle file and rebuild your project.

You should use compileSdkVersion 23 in your build.gradle.
First make sure that you set
compileSdkVersion 23
buildToolsVersion "23.0.1"
and
targetSdkVersion 23
Then Clean-Rebuild-Gradle .
Try this way .I hope it works .

Related

problem in my first project of android studio

When I was creating a new project it showed this warning and I do not understand what is it for.
This is the image of the warning it is showing.image
I changed to 31 and here are some screenshots regarding the issue.
Try changing the compileSdk to 31 instead of 32 in your build.gradle.
change your compileSdkVersion and targetSdkVersion in build.gradel file
compileSdkVersion 31
targetSdkVersion 31

Print the compileSdkVersion and targetSdkVersion runtime of android app

I'm having a cordova outsystems android app and I want to make sure it's running the compileSdkVersion and targetSdkVersion that I've set. Is it possible to print it out runtime in android code (not javascript)?
Getting the targetSdkVersion is simple:
val targetSdkVersion = application.applicationInfo.targetSdkVersion
Getting the compileSdkVersion is more complex, there are answers posted here:
How to get compileSdkVersion in my custom gradle plugin

Adding React-Native-Admob in React-Native

I am trying to add React-Native-Admob 2.0.0-beta.5 into React-Native v0.55.4 for Android.
compileSdkVersion =26
buildToolsVersion ="27.0.3"
targetSdkVersion = 26
supportLibVersion = "26.1.0"
minSdkVersion = 18
And React-Native-Admob has
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
}
And when i Compile the error Exception occur
The SDK Build Tools revision (23.0.1) is too low for project ':react-native-admob'. Minimum required is 25.0.0
I can't downgrade my project's SDK, other package uses that SDK.
You don't need to downgrade, you need to upgrade. Dependencies were probably added in the SDK that admob relies on. You can download the specified version packages for the SDK through Android studio and then set your SDK version in the file to the appropriate version necessary for admob.
Edit
I see that you are saying that admob is using version 23. You may need to submit an issue with them on GitHub for this.
you can change the buildToolVersion of the library you are using, just go to -> node_modules/{your-library}/android/build.gradle, change buildToolsVersion from 23.0.1 to 25.0.0.
if the studio asks for any updates regarding build, just update it, and it might work.
another solution:
although I haven't tried it, it has a lot of emoji love on GitHub,
https://github.com/oblador/react-native-keychain/issues/68#issuecomment-304836725
Goto
"node-module/react-native-admob/android/build.gradle" file, then change the compileSdkVersion and buildToolsVersion to following values
compileSdkVersion 27
buildToolsVersion "27.0.3"

Android Layout Unable to see app Preview

I am not able to see the preview in the Android layout like the toolbar or the ActionBar. Below is the screenshot of the app:
Thanks.
Check if you are using SDK 28 as SDK 28 has a bug. Change
compileSdkVersion 28
targetSdkVersion 28
to
compileSdkVersion 27
targetSdkVersion 27
and use this in build.gradle:
implementation 'com.android.support:appcompat-v7:27.1.1'
If you're not using SDK 28, you can try Build -> Clean Project or restart Android Studio.

What is the buildToolsVersion for android SDK 24?

There's not much I can say about this. Oh well. Google released a new version of android called Nougat (android N). It is compileSdkVersion 24. However, on the build tools page in the official documentation, it is not mentioned.
I want to give my app to 100% of the people using Google Play Store, which includes android N users.
tl;dr: What should I fill in the buildToolsVersion field?
Thanks.
buildToolsVersion
Using android gradle plugin version > 3 you can remove the android.buildToolsVersion property
Quoting from the New Features section of the Android Gradle plugin release notes for version 3.0.0:
You no longer need to specify a version for the build tools. By default, the plugin automatically uses the minimum required build tools version for the version of Android plugin you're using.
[minSdkVersion, targetSdkVersion, compileSdkVersion]
buildToolsVersion should be set to 25 and 25.0.0, as seen below:
compileSdkVersion 25
buildToolsVersion '25.0.0'
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
You can get the latest buildToolsVersion from SDK Manager in Android Studio.

Categories

Resources