I have a simple app and every time I hit "run" it takes more than 3 minutes for gradle to finish build and load the app. And it happens on both emulator and my android phone. And before you mark this post as a similar post, hear me out: I have been tying to troubleshoot the issue since last 10 days. I have gone through more than 20 stack overflow similar questions (like this one) and dozens of articles on google and I've tried every solution they suggested but nothing seems to work. Here is what I've tried so far:
- Added
org.gradle.parallel=true
andorg.gradle.daemon=true
to gradle.properties - Added --parallel and --offline to command line option settings
- Enabled "offline work" in settings
- Enabled/Disabled "instant run" - didn't make any difference
- I've allocated a lot of memory:
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-
8 - I've completely disabled Windows Defender
- I am using latest version of gradle (2.10) and latest version of Android Studio which is 2.1.1 Even after trying all these, it still takes more than 3 minutes and it is getting very frustrated.
When app is running for several minutes, I've noticed :app:processDebugResources
in gradle console. So maybe this might be causing the slow down, I don't know.
Also, I have an xml file that I am parsing and that xml file has about 70,000 lines in it. Could this be causing any problem? Could it be Windows 8?
Please provide any suggestions on how to fix this. Thank you :)