Reputation: 1199
Normally when i execute Run > Run or Run > Debug in Android Studio, this make project and found errors and re compile application, but now, when i click on Run or Debug, directly launch application without compile changes and nothing, if i enter in Configuration of Run, i have "Before launch: Make"
If i execute Build > Make project works correctly, but i don't want execute all time Build > Make project and Run > Run.
I use Android Studio 0.3.4.
Upvotes: 10
Views: 7903
Reputation: 50
Android Studio is feeling a little lazy and not really doing the whole building thing before you run or debug tryy these......
Check the Gradle Sync Thingy: So, like, you can click on "File" > "Sync Project with Gradle Files" to manually mess around with Gradle sync.
Go over to "Run" > "Edit Configurations" or something like that. Pick your app's configuration thing in left. Look for "Before launch" section,and click on "Make"or the '+' thing.
Cleaning and Rebuilding: Click on "Build" > "Clean Project" Then, do the "Build" > "Rebuild Project".
You could, like, update Android Studio if you want to, but then again, why bother? Older versions are kinda cool too, in a retro way.
Make sure you've messed with your code a bit before you hit "Run" or "Debug." If you haven't, Android Studio might decide to take a coffee break instead of building stuff.
I think there's some Gradle configuration thing hiding somewhere. Check it out if you're in the mood. It might have some auto-build stuff that you could turn on or off or something.
Custom Build Scripts? Maybe If you've got some fancy custom build scripts, well, they might be doing something funny. Or not. Who really knows? Third-Party Plugins, Whatever:
If you've got a bunch of third-party plugins cluttering up the place, maybe disable some of them? Or not. It's your party.
Take a peek at your Gradle scripts, XML files, and other random config files. There could be errors or something. Or not. Who's got time for that?
If all else fails, restart Android Studio. Or don't. Maybe it'll fix things, or maybe it won't. Life is full of mysteries, right?
Upvotes: 0
Reputation: 1996
Followed @Albert khang steps but after selecting "Gradle-aware Make" option and clicking on cancel it did'nt added in the list.
In the latest version of android studio (Android Studio Giraffe | 2022.3.1 Patch) it worked differently to get it added in list
Just revamping the albert's answer
Above steps worked for me i hope it will work for you as well..still i would appreciate if someone point out or provide solution why do we have to do this additional steps or extra configuration for building the project
Upvotes: 1
Reputation: 701
In my case:
Now Android will build "Make Project" first, apply all changes then run the app.
Upvotes: 3
Reputation: 57702
I have that issue as well and what helped was a complete reinstall of the android studio. So I just downloaded the latest version.
You will see that your settings are still there, your recent project will open normally and you should be able to just "run" your project again with "make" being executed correctly before.
Edit: I suspect that the main reason for the issue was a failed update try frm 0.3.4 to 0.3.5 and restoring the backup I made will have create even more issues...
Edit 2: As this is just a temporary fix (see my comment below) I made a ticket in the bugtracker.
Upvotes: 1
Reputation: 18988
Open the Run/Debug Configurations dialog (choose Run -> Edit Configurations
on the main menu).
Now select the run configuration you are using. On the right hand side you will see various options for the selected run configuration, look for the Before launch section (it should be near the bottom).
There should be a Make entry added to the list. If there is not a Make entry in the list add it using the green + symbol.
Upvotes: 2