Print the compileSdkVersion and targetSdkVersion runtime of android app - android

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

Related

App crashes on Android 11 after targetSdkVersion upgrade to 30 without any error logs

minSdkVersion = 25
compileSdkVersion = 29
targetSdkVersion = 30
It is a React Native project, and the app works well till android 10. issue persist only in android 11.
i tried updating Google WebView which was suggested in a similar issue, but it didnt work..
if anyone have a solution, please share..
Add this line to your app/build.gradle:
implementation("com.squareup.okhttp3:okhttp:4.9.2")
Edit: Although it is resolved since react native #0.67.2
Try to upgrade the compileSdkVersion = 30.
The compileSdkVersion should not be lower than the targetSdkVersion.

Instant App Not Compiling

When I am trying to compile with following configuration in base feature,
compileSdkVersion 25
targetSdkVersion 25
I get the below error message
"Feature modules require compileSdkVersion set to 26 or higher. compileSdkVersion is set to 25"
Is there a relation between compileSdkVersion and targetSdkVersion of instant app and installable app ? Please help.
You need a compileSdkVersion of 26. You should always use the highest possible value for compileSdkVersion and targetSdkVersion. This does not affect backward compatibility. Moreover, Google requires current values for uploading to Google Play.

Apps are not supported in lesser than v5.0(lollipop)

In android studio, i have create new project that run on 2.2(that shows 100% compatibility). The project is about calculation. I have installed on my phone(lollipop), and the app is working properly. But, I tried to install in my friends kitkat phone, the app is installed but, When i open the app, that shows Unfortunately the app has stopped. So, I need a help. What I have to do?
Thank You.
May be you set Minimum SDK at Lollipop check it out in build.gradle file.
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.communitynow.communitynow"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
and add
compile 'com.android.support:multidex:1.0.0'
in gradle file
Here in defaultConig{} minSdkVersion should be 15 or according to your minimum android run requirement.
You need to create a kit kat emulator to run the app on then check the log cat to see what the error is.

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.

Error in Android studio New Application

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 .

Categories

Resources