The title is a duplicate but my question is different.
The same project works fine and is allowed to be built on
buildToolsVersion 23.0.3
on my colleague's system. As far as I know only the android studio version is different. Is it possible that if I hadn't upgraded my android studio to "2.3.Beta 2" I could still build with 23.0.3?
Open the Preferences window by clicking File > Settings (on Mac, Android Studio > Preferences). In the left panel, click Appearance & Behavior > System Settings > Updates. Be sure that Automatically check for updates is checked, then select a channel from the drop-down list (see figure 1). Click Apply or OK.
Install the SDKClick Tools > SDK Manager. In the SDK Platforms tab, select Android 12. In the SDK Tools tab, select Android SDK Build-Tools 31. Click OK to install the SDK.
You have to change top-level build.gradle from
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
allprojects {
repositories {
jcenter()
}
}
to:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
allprojects {
repositories {
jcenter()
}
}
Ok I found a solution to this.
For people facing the same problem in the future, here's what I did:
I added the following to my root build gradle android/build.gradle (Not the android/app/build.gradle)
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
}
}
}
}
That forces all the submodules to use the specified compileSdkVersion and buildToolsVersion. Problem gone now.
if I hadn't upgraded my android studio to "2.3.Beta 2" I could still build with 23.0.3?
Yes.
You can still run the build process from command line with any version of build tools.
Feel free to upgrade build tools to 25.0.2 (latest as of 27.1.2017). This only affects build process, it doesn't affect the app behavior.
Newer versions of build tools incorporate more options and newer technologies and newer versions of Android Studio depend on these technologies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With