When developing an Android application using as, you often encounter Gradle build running running and even stuck, the workaround is as follows:
Method 1: (Pro-Test effective)
1. Create a new gradle.properties file in the c:\user\< user name >\.gradle directory and add a line inside it: org.gradle.daemon=true
2, Open as, in Settings set Gradle mode of operation for offline, such as:
So that we can solve the problem that has been running.
Method 2:
Find path C:\Users\admin\.gradle\wrapper\dists, there is a Gradle version folder under this folder, Open after is a long name folder,
For example my C:\Users\admin\.gradle\wrapper\dists\gradle-2.4-all\6r4uqcc6ovnq6ac6s0txzcpc0 then Download the corresponding version of the gradle, the download of the compressed package directly into the name of a long folder, you do not need to extract
Method 3:
The Gradle agent needs to be configured in Android Studio, of course with goagent. After you open the Setting->gradle->gradle VM options:-dhttp.proxyhost=127.0.0.1-dhttp.proxyport=8087 Setup is successful, restart the Androidstudio , the speed will be very fast.
Method 4:
1) Go to the bin directory in the newly installed Android Studio directory. Locate the Idea.properties file and open it with a text editor.
2) Add a line at the end of the idea.properties file: Disable.android.first.run=true, and then save the file.
3) after shutting down Android studio and restarting, you can enter the interface.
Method: 5:
may be Because some of the domestic anti-virus software disabled the Aapt.exe process caused. aapt is Android Asset Packaging Tool, under the Build-tools directory of the SDK. The tool can be viewed, created, updated in zip format with document attachments (Zip, jar, apk). You can also compile the resource files into binaries, although you may not have used the AAPT tool directly, but the build scripts and IDE plugins Use this tool to package the APK file to form an Android application.
Workaround:
There is a solution on the Internet, by extending the Aapt.exe start time to solve, in the system variable with "Slave_aapt_timeout", and set the value of 30, but also in the user variable to add "java_home" setting, But believe that as long as the JAVA or Android development people will set the "Java_home" it
Another way is to update Build-tools to the latest version
But these methods do not cure the symptoms.
The fundamental way to solve this is to let the antivirus software Trust all of Androidstudio's operations.
This will require you to use the anti-virus software used by your computer to add the trust program, the specific process depends on the use of different software
Add Studio.exe (32-bit) or Studio64.exe (64-bit) as the trusted program, and these two files are in the installation directory \ Bin folder of Androidstudio
Or simply set the entire Androidstudio installation directory folder to the Trust zone.
If the above steps are troublesome, then close or completely uninstall the anti-virus software to ... Simple, brutal, quick.
Method 6:
Download version of newer Android studio, the new version of this situation has a good improvement. I used 2.2.3, with almost no lag in the situation.
Android Studio has been grandle Build Running when importing a project