search

Home  >  Q&A  >  body text

android-studio - Android Studio requires clean and gradle build every time you modify the code

After a power outage, Android Studio needs to clean every time it modifies the code so that gradle build can take effect on the device

Is there any way to solve this situation, because it affects time too much

The problem has been solved and it is not a problem of power outage. Before the power outage, I modified the build.gradle file and then did not operate it again, so I mistakenly thought that the Android Studio configuration was lost. Please refer to my answer for the solution.

世界只因有你世界只因有你2794 days ago1307

reply all(3)I'll reply

  • 某草草

    某草草2017-05-16 13:31:07

    Problem found

    For the name of the previous package, I set a time, accurate to the minute

    def releaseTime() {
        return new Date().format("yyyy-MM-dd_HHmm", TimeZone.getTimeZone("UTC"))
    }

    was modified to

    def releaseTime() {
        return new Date().format("yyyy-MM-dd_HH", TimeZone.getTimeZone("UTC"))
    }

    After that, modify the code and click Run directly, and it will take effect

    Some students may use timestamps to generate apk names, you can check to see if this is the problem

    reply
    0
  • 阿神

    阿神2017-05-16 13:31:07

    Try the following:

    File --> Invalidate Cache/ Restart

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:31:07

    http://blog.csdn.net/wbshuang...
    Try this, it will greatly improve the compilation speed
    And it is recommended to use the android studio developer version
    I am currently using android-studio-ide-171.3829324-windows

    reply
    0
  • Cancelreply