Android Studio: auto-build similar to Eclipse

I decided to use Android Studio after using Eclipse over the years. But I found one bad thing for Android Studio. Indeed, it seems impossible to have an auto-build feature, for example, in Eclipse. When files are changed and saved, I don’t see if there are errors, warnings, etc. in my project.

So, is there a way to enable this?

+44
android android-studio
Dec 09 '13 at 21:08
source share
3 answers

IntelliJ (Android Studio) has a completely different build system for eclipse. It has incremental compilation which is different.

IntelliJ will tell you if there is something with an error / warning of an open CURRENT file.

So the short answer is no, you cannot. You will see errors when opening files, you can select "rebuild project" from the menu, which will show you these errors. You can also enable "auto-import" for Gradle, which may help.

You do not want to constantly "rebuild the project." Therefore, I recommend getting used to it.

Also, you should not rely on compilation errors for coding, you should safely reorganize, and this should be a surprise when something gives a compilation warning, and you have to fix it.




You should read the IntelliJ FAQ

Q: What happened to incremental compilation? How to compile my project?

A: It is there, but it works a little differently. By default, IntelliJ IDEA compiles files only when necessary (when you launch your application or explicitly call the "Do" action), and thus saves the system resources for other tasks that may be more important at the moment. Compilation is incremental: IntelliJ IDEA tracks dependencies between source files and recompilation only if the file has been modified.

Files with compilation errors, as well as folders containing them, are highlighted, so you can easily analyze them through the Project view. To see a list of all files with compilation errors, select "Scope" | Problems with the presentation list as a type of project. After each compilation, IntelliJ IDEA constantly runs the background code to analyze the error files and remove the red highlight automatically when you fix them.

To enable compilation of files each time you save, you can use the EclipseMode plugin: http://plugins.jetbrains.com/plugin/?id=3822 (third-party development, not bundled).

To be able to run the code with errors, you can select the Eclipse compiler in the settings dialog, compiler, Java compiler and add -proceedOnError for additional command-line options for the compiler.

http://www.jetbrains.com/idea/documentation/migration_faq.html

+20
Dec 09 '13 at 9:12
source share

To enable automatic assembly, you can follow these steps: click on Android Studio / Preferences / Compiler and enable the Make project option automatically. enter image description here This will work for all projects imported into Android Studio.

If you want to use this option only for some projects: go to the "Run / Edit Configurations" section and add the "Make" parameter in the "Before Launch" list. enter image description here

+16
Jan 16 '15 at 14:43
source share

Android Studio does not have the auto-build feature that is present in eclipse.

One thing we can do if we change the public fields, class name, methods, variables mentioned in another eclipse class will show that the changed field is passed by another class by automatically creating the project. Therefore, we need to rebuild the project in android studio.

It will show errors if the changed fields are passed by any other class. This is a way to check if fields or a method are class names of other classes.

+3
Mar 07 '14 at 5:59
source share



All Articles