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
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.
Yes u can do 2.3 studio is upto 25 supported you want to install sdk 19to25 in studio
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.
I solved this issue:
added this code in android/build.gradle
```
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
}
}
}
}
```
Setting classpath 'com.android.tools.build:gradle:1.+' can resolve my problem when my project migrated from Android Studio 1.5.0 to 2.3.0.