Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialEric Drake
6,339 PointsColorizer: sync failed
I imported the project files that were included in the teacher's notes. The project fails to sync, and it gives the following error.
WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Remove Build Tools version and sync project
Affected Modules: app
I tried to remove the buildToolsVersion line from the Gradle file. I also tried to update it to buildToolsVersion "28.0.3". Neither option has allowed the project to sync. Is there something else I can try?
3 Answers
Lauren Moineau
9,483 PointsHi Eric
- Just remove that
buildToolsVersion
line. Since Android Studio 3.0, it is no longer a requirement as the system selects the version for you (unless you want to use a different version than the default one). - Update your
compileSdkVersion
andtargetSdkVersion
to 28 - Under
dependencies
, replacecompile
withimplementation
and update the dependencies versions there too (Android Studio will highlight the ones that need updating and tell you which version to use) - Follow Android Studio's instructions for anything else
Hope that helps :) Good luck!
David Lacho
20,864 PointsI managed to get the project running by changing my app file to:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.teamtreehouse.colorizer"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.github.bumptech.glide:glide:3.7.0'
}
and my build.gradle file to:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Jack Chaffin
Courses Plus Student 4,462 PointsCopy/Pasted David's code and changed the url in gradle-wrapper-properties to the most updated gradle distro and got it to build properly. Just wish I understood what I was doing with gradle better so I didn't just have to copy/paste to get these old project files to work. It'd be nice if treehouse actually updated things too.
Eric Drake
6,339 PointsEric Drake
6,339 PointsLauren,
Thanks for the help. It's getting me closer to where I want to be. Here is my build.gradle file:
Here are the errors that I get:
Lauren Moineau
9,483 PointsLauren Moineau
9,483 PointsOk. That's good. In your top-level
build.gradle
file (the other one), just add thegoogle()
repository, like this:That should do it. That's what those Google Maven repository error logs are all about.
Adolfo Obregon
10,156 PointsAdolfo Obregon
10,156 PointsI did all this but still didn't solved the problem. What solved the problem was changing the Gradle Version to 6.3. Go to File>Project Structure>Project>Gradle Version to 6.3 After that File>Invalidate and Restart
I have no more errors on AppCompatActivity.