I know this question has been asked before, but there wasn\'t a satisfactory answer, and the last post was three years ago. I am using android studio 3.6.2 in windows 10. Ev
[][]
Go to Edit Configurations check that you are not building before each launch. Remove "Build"
I also encountered the same problem in Android Studio 4.x in Windows 10. Simply using "Restart and Invalidate" does not work for me. Sometimes, deleting the build
folder will work but I cannot build the project more than once. Here is my solution:
Having multiple daemons may cause problems as described in documentation from Gradle. To solve this problem,
$ANDROID_JDK/bin/java.exe --version
to find out the Java version.java.exe --version
to find out the default Java version used by the system.app
ConfigurationEmpty Composable Activity template will create two build configurations.
You should change the build configuration to app
as shown in the figure below. This solves my problem.
As illustrated in Bilal Aslam's solution, we can edit the build configurations (Run > Edit Configurations). After selecting Compose Preview > Default Preview
, you will see Build
then Gradle-aware Make
in the Before launch
panel. Remove Build
should be able to solve the problem. The side-effects are unclear.