Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Simple Android App Basic Android Programming Choosing a Random Fact

Gradle build running for more than 4 minutes every time I rerun an app after making changes. AVD is already running.

Is this normal? The time it takes to run the app in the video is almost instantaneous.

Specifically, the status bar shows up as below Executing tasks: [:app:assembleDebug] (5 minutes ago) . Gradle build running .....

build.grade is shown below:

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

    // 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 }

1 Answer

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

We might be speeding things up a bit through the magic of editing ;)

That said, 4 minutes is a REALLY long time for an app to build. Unless you're on an older laptop, it shouldn't be taking that long. Here's a guide on how to Optimize Your Build Speed that might be useful. I haven't tried it, but hopefully it's able to help out.

Thanks! It seems to have gotten better by itself. However, I see the following message on the console when running my app.

08/01 11:23:53: Launching app
$ adb shell am start -n "sansar.com.funfacts/sansar.com.funfacts.FunFactsActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..

Also, I added the following log message that is also not showing up in logcat

        Log.d("FunFactsActivity", "We're logging from the onCreate() method!");