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 trial

Android Android Activity Lifecycle Introducing SharedPreferences Logging the Lifecycle Methods

Fernando Zegarra
PLUS
Fernando Zegarra
Courses Plus Student 2,596 Points

Cant open the project

when I Open the app with Android Studio, it looks like something is going wrong

It appears "faild to Build Tools revision23.0.0"

and I can't have a good view of the Gradle

Thanks in advance

5 Answers

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

Hmm... there's probably something in that project's 'build.gradle' file that isn't on your system. Try creating a new project, and then comparing the 'build.gradle' files of this project with your new project. Then update any version numbers in this project to reflect what you see in the new project*. I actually troubleshoot opening a Github project in this video (around the 3 minute mark is where I get the first issue).

*whatever versions are in the new project are pretty much guaranteed to be a version you have installed

Javier Mera
Javier Mera
16,472 Points

Just like Ben mentioned differences between your system and what the project was built in, your system probably has either an older or higher version of Build Tools installed. Just install version 23.0.0 through the sdk manager and you should be good to go.

Jeremiah Shore
Jeremiah Shore
31,168 Points

Ben Deitch and Javier Mera both have sound advice.

I didn't have version 23 of the sdk installed, so I thought that was the first requirement, though after later steps it became irrelevant.

Next I was getting the message "Unsupported method: BaseConfig.getApplicationIdSuffix(). The version of Gradle you connect to does not support that method." I resolved this by: 1.) opening the build.gradle file (I had to use project view) and changing the classpath dependency to 'com.android.tools.build:gradle:3.2.1' (what shows up in a new project) 2.) I got an error about not being able to find that that dependency, and used the suggested fix action "Add google maven repository and sync project" 3.) got an error about the minimum verison of gradle and a problem with the gradle wrapper; applied the suggested fix action "fix gradle wrapper and reimport project"

After that, I was good to go, but got some warnings about deprecated methods and their pending removal. E.g. "WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'." Those are just warnings though, and I was still able to run the app. They are pretty straightforward to fix if you were updating this project to use the latest version of gradle, just a matter of following the warning and looking at the documentation I believe. That and a warning about the minimum supported version of the Android SDK build tools for the version of the gradle plugin I am using, see Build > Sync.

I hope that helps!

michael lee
michael lee
5,179 Points

this comment is the best I've found and really solved my problem, thanks a lot man!!

David Lacho
David Lacho
20,864 Points

In the individual module build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "25.0.0"

    defaultConfig {
        applicationId "com.teamtreehouse.activitylifecycleexample"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
}

In the top-level build.gradle build file:

// 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.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}