make project before run application android studio
Asked Answered
W

5

10

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.

Winshell answered 11/11, 2013 at 3:29 Comment(0)
H
3

In my case:

  1. Select "APP" (next to "Make Project" button).
  2. Select "Edit Configuration".
  3. In "Before launch".
  4. Add "Gradle-aware Make" then it will ask you about "Select Gradle Task", just select cancel. Then you will see "Gradle-aware Make" in "Before launch" tab.
  5. Select "OK".

Now Android will build "Make Project" first, apply all changes then run the app.

Hyperform answered 15/4, 2021 at 5:41 Comment(0)
F
2

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.

Flyblow answered 11/11, 2013 at 7:44 Comment(2)
" if i enter in Configuration of Run, i have "Before launch: Make" " :/Winshell
Could be that something got messed up in the configuration. Maybe just try to create a new run configuration from scratch.Flyblow
R
1

I have that issue as well and what helped was a complete reinstall of the android studio. So I just downloaded the latest version.

  1. Make sure Android Studio does not run!
  2. make a backup of the "sdk" folder (you find it in your Android Studio folder)
  3. Delete the Android Studio folder
  4. Unpack the downloaded zip to the same location
  5. copy your "sdk" backup back into the folder
  6. Start Android Studio

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.

Rabkin answered 14/11, 2013 at 10:14 Comment(2)
I might have been too fast. While working this issue just reappeared.Rabkin
This should be fixed in the upcoming 0.3.6 release.Darelldarelle
A
1

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

  1. Select "APP" (next to "Make Project" button).
  2. Select "Edit Configuration".
  3. In "Before launch".
  4. Add "Gradle-aware Make" then it will ask you to add task with edit field and below that it will be written as Leave empty to assemble the relevant module..
  5. please note leave it empty and Select "OK".
  6. it will get added to list

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

Aguayo answered 2/9, 2023 at 14:25 Comment(0)
B
0

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?

Barina answered 9/9, 2023 at 9:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.