165

The Android Studio Build menu has options including

Make Project
Rebuild Project

When should I use each?

cja
  • 9,512
  • 21
  • 75
  • 129

3 Answers3

162

Most of the time you should use Make Project. Sometimes, after adding libraries and making big changes to the project you should use Rebuild Project.

If you look at the menu, you'll see that Make Project and Compile have keyboard shortcuts, that suggests that they are often used. Others are seldom used.

It is the same as IntelliJ Idea.

Compile All the source files in the specified scope are compiled. The scope in this case may be a file, a package, etc.

Make Project All the source files in the entire project that have been modified since the last compilation are compiled. Dependent source files, if appropriate, are also compiled. Additionally, the tasks tied to the compilation or make process on modified sources are performed. For example, EJB validation is performed if the corresponding option is enabled on the Validation page.

Make Module Compiled are all the source files that have been modified since the last compilation in the selected module as well as in all the modules it depends on recursively.

Rebuild Project All the source files in the project are recompiled. This may be necessary when the classpath entries have changed, for example, SDKs or libraries being used added, removed or altered

Copied from IntelliJ Idea 13 help.

Grzegorz Żur
  • 47,257
  • 14
  • 109
  • 105
  • Thanks. I did use the search function at http://www.jetbrains.com/idea/webhelp/ but failed to get anywhere near a useful answer – cja Dec 04 '13 at 13:03
  • 10
    I still don't see when to use which. – Kuno Apr 20 '15 at 11:03
  • 3
    @Kuno - Use **Make project** to compile only the files whose source code has been changed. Use **Rebuild project** to compile all the source files(irrespective of whether they have changed or not) – Nanda May 10 '15 at 18:44
  • 4
    This is not an answer because the way Android Studio projects are compiled is via gradle. A correct answer would say what the differences are at the gradle level. – miguel Jun 04 '15 at 21:23
79

The difference is that Rebuild executes gradle's clean task first. If you look in the Gradle Console 'Rebuild Project' will say something like

Executing tasks: [clean, :app:compileDebugSources, :app:compileDebugAndroidTestSources]

While 'Make Project' won't have clean

Executing tasks: [:app:compileDebugSources, :app:compileDebugAndroidTestSources]
miguel
  • 16,205
  • 4
  • 53
  • 64
  • 1
    I think it should be the accepted answer.But I find something while 'Make Project' in gradle console `Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]` – chefish Jan 21 '17 at 02:52
  • 5
    Every time I hit `Make Project` an inner voice tells me to hit `Rebuild Project` just to be sure. – iCantC May 10 '20 at 08:15
  • Thanks. You give me more than an answer! – fateflame Nov 06 '20 at 12:08
6

Difference between make and rebuild is "clean" task.

When you do rebuild project it performs clean too.

rupesh jain
  • 3,410
  • 1
  • 14
  • 22