My build.gradle file
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "########"
minSdkVersion 15
targetSdkVersion 23
versionCode 40
versionName "3.1.9"
}
}
I want to remove the extra android.jar and res from my project path.How can I do that? Of the android.jar's one belongs to version 23 (MarshMallow) and other belogs to 19(Kitkat).I would prefer to keep MarshMallow jar and remove the Kitkat jar.
Follow the image below :
Right click on the project -> Open Module Settings
Related
I just pulled up the android studio again and the current SDK version appears to have major bugs. While on SDK version 31 I get an error message saying SDK tools are corrupted and to uninstall then reinstall version 31.
When I switch to version 30 I get another error message stating that "the minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/Gradle/aarmetadata.properties) is greater than this module's compileSdkVersion", and I can't find any sources on google for altering minCompileSdk.
I just need to fix one of these problems, not both.
p.s. - I have already uninstalled and reinstalled APK 31 several times.
in your project, app -> build.gradle:
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "...."
minSdkVersion 16
targetSdkVersion 30
}
}
here the minSdkVersion is minCompileSdk.
You can change minSdk and targetSdk. And ensure minSdk and target < compileSDK
compileSdk 31
defaultConfig {
...
minSdk 25
targetSdk 31
...
}
"the minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/Gradle/aarmetadata.properties)
Im set compileSdk 31 to fixed that error. Show me your build.gradle
Thanks for the feedback! It looks like the solution was to change targetSDKversion and compileSDKVersion to 31 but keep buildToolsVersion at 30.0.3. I'm guessing any version between target and min will work.
I was working on a project in late 2018 and left that as it is after that now i want to make changes in it and publish it to the playstore. The project had the v7 dependencies
&
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.andropc.wallpro"
minSdkVersion 15
targetSdkVersion 27
The app crashes after Android7.1 so how to run the app on above android versions what changes to make in the project or in dependencies to make it run in all versions.
First of all android support libraries had mean migrated to androidx!(https://developer.android.com/jetpack/androidx/releases/appcompat)
But you can still use old dependencies as well (I would recommend you to switch to androidx).
You need to change targetSdkVersion: 29 in build.gradle in order to support latest android version which is android 10.
Why [Default and static interface methods] of java 8 are not supported in Android Studio 3.0?
The code always got the error hint.
The build.gradle settings :
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.dreamzone.mtime"
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
But android studio doc shows it can compatible any api level.
https://developer.android.com/studio/write/java8-support.html
You need to set Java 8 compatibility in your module's build.gradle file, via the compileOptions closure inside the android closure:
apply plugin: 'com.android.application'
android {
// other good stuff here
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
// only chnage minSdkversion to more then 26
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 26
targetSdkVersion 30
versionCode 1
versionName "1.0
}
Google have recently released API 27. I am planning to update my application with API 27. I have marked that there latest build tool is 26.0.2 and API is 27. If I use like below it can cause any issue in app ?
compileSdkVersion 27
buildToolsVersion "26.0.2"
and Application's minimum and maximum API is like below
minSdkVersion 16
targetSdkVersion 27
Thanks
1) Build tools version has nothing to do with compile SDK version.
Your current setup will work fine.
compileSdkVersion 27
buildToolsVersion "26.0.2"
2) You should use the newest build tools available.
If you had an old project you could say this:
compileSdkVersion 25
buildToolsVersion "27.0.0"
3) Build tools version is picked automatically in Android plugin 3.0.0.
You don't have to specify it. This is enough:
compileSdkVersion 27
You can use
android {
compileSdkVersion 27
buildToolsVersion '27.0.0'
defaultConfig {
targetSdkVersion 27
}
Read official guideline about Set Up the Android 8.1 SDK
If you are using last version of android-studio you can remove buildToolsVersion "26.0.2" from your gradle it's not mandatory.
The buildToolsVersion will work along-side with compileSdkVersion.
compileSdkVersion 27
buildToolsVersion "26.0.2"
Your config works. You should use lasted build tool.
From android studio 3.0, buildToolsVersion is ignored. It automatically pick the build tool version for you.
in android studio im getting a lot of errors because i think something must have happened in the build.gradle. I may have accidentally deleted the dependices method (or whatever it is) inside the build.gradle now everytime i try to run a gradle project sync this happens (below)
I have tried the invalidate caches/restart but that has not worked.
Here is my what my gradle settings look like. (below).
All my other projects in android studio seem to be working fine. Can someone please help me here.
You misplaced the defaultConfig block. Should be like:
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
applicationId "com.example.app"
}
buildTypes {
...
}
...
}