Reputation: 109
My android project runs Gradle build running in about 7 min every time.
And the "Task :launcher:processDebugResources" takes 5 min.
What did it do?
I read and try all the answer in Android Studio gradle takes too long to build But no use, sadly.
And how to fix it please?
The full log:
Task :launcher:bundleDebugResources AAPT2 aapt2-4.1.3-6503028-osx Daemon #0 Failed to shutdown within timeout java.util.concurrent.TimeoutException: AAPT2 aapt2-4.1.3-6503028-osx Daemon #0: Failed to shut down within 30 seconds. Forcing shutdown at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.stopProcess(Aapt2DaemonImpl.kt:224) at com.android.builder.internal.aapt.v2.Aapt2Daemon.shutDown(Aapt2Daemon.kt:148) at com.android.builder.internal.aapt.v2.Aapt2Daemon.handleError(Aapt2Daemon.kt:183) at com.android.builder.internal.aapt.v2.Aapt2Daemon.handleError$default(Aapt2Daemon.kt:168) at com.android.builder.internal.aapt.v2.Aapt2Daemon.link(Aapt2Daemon.kt:128) at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.link(Aapt2DaemonManager.kt:175)
Upvotes: 0
Views: 895
Reputation: 109
Finally I found the reason. If AS takes a long the in the task "processDebugResources",it means you have too many resources to process in appt task.
Check you build.gradle, find the "aaptOptions".
And my code likes:
aaptOptions {
noCompress = ['a','b','c','d','e']
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}
noCompress = ['a','b','c','d','e'] just for an example.
Check the noCompress Array. If you have too many item in Array,try to remove some items.And it will be better.
I didn't find anything wrong after I deleted them. Maybe you will,please tell us how to do better.
Upvotes: 1