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!");