recently reinstalled the system, and then re-installed Android Studio encountered a pit, opened the Studio to create the project prompted gradle project refresh failed to find all kinds of methods, I have seen a lot of solutions on the Internet, some have tried to no effect, the following is my own solution can refer to.
step 1: find the Studio Android directory D:\Android\Android Studio\gradle, copy the downloaded file to the directory
step 2: download the gradle span> version: https://pan.baidu.com/s/1hsKUK6K password: 7 im3
span> p>
part 3: set the proxy address my Settings are as follows (of course you can also try to set No proxy) :
Step 4: restart Android Studio,
if the problem has not been solved, I recommend using the following solution:
thank blogger: span> bear bear children turn from: https://www.jianshu.com/p/43b795895a79 span>
span> p>
different situations will have different solutions, you need to open the log file to find the detailed error information.
C:\Users\{Username}\.AndroidStudio2.1\system\log
1. Mandatory IPV4
add the variables in the environment variable
_JAVA_OPTIONS
set a variable’s value to,
– Djava.net.preferIPv4Stack=true
restart Android Studio, automatic update gradle.
2. Update JDK1.7 to JDK1.8
File-> Other Settings-> Default Project Structure… Delete. Gradle file
delete folder
c:\users\{username}\. Gradle
then restart Android Studiao to update gradle. Open the gradle properties file for the project and add the following configuration items:
org.gradle. Jvmargs = -xmx512m-xx :MaxPermSize=512m
.
5. Set the correct gradle version
File-> Settings
Build,Execution,Deployment-> Build Tools-> Gradle
this solves the Gradle version mismatch problem. 6. Manual synchronous gradle
Tools-> Android-> Sync Project with Gradle Files
7.
Build-> Clean Project
8. Invalidate and Restart
File-> Invalidate Caches/Restart…
Invalidate and Restart
9. Update android SDK
for the problem of not downloading the corresponding version of SDK, download as required.
10. Change the engineering build directory. The grade file
is sometimes Gradle this’ project_name 】 【 ‘project refresh failed: No cached version of the android. View the build: Gradle: 2.10 + available for offline mode.
Encounter this kind of situation will open the project directory of the build. Gradle file, after change
dependencies {
classpath ‘com. Android. View the build: gradle: 2.10 +’
}
open C: \ Users \} {your user name \. Gradle \ caches files, found no below 2.10 directory, under normal circumstances, When you restart Studio, if you don’t, you will re-download the file directory. If you can’t download it normally, just copy it and put it in the directory.
this is just the solution to my problem, maybe you have the same problem as me, I hope this blog can help you.
Read More:
- AndroidStudio sync failed solution
- Error in Cordova project execution command after Android studio upgrade: could not find gradle wrapper within Android SDK
- android studio Error Gradle project sync failed. Please fix your project and try again
- Add a warehouse in allprojects repositories and report an error
- Re installing Android studio always fails to install SDK when installing software (solution)
- Change API level Android studio
- How to Fix Android Error:This Gradle plugin requires Studio 3.0 minimum
- [Solved] Android gradle Error: gradle project sync failed. Please fix your project and try again
- Failed to find target with hash string ‘android-25’ in:D:\SDK
- Android Studio sync build.gradle appears: Failed to resolve: com.android.support:appcompat problem
- Errorjava.lang.NullPointerException(no error message)
- Solve the error when installing apk after compiling Android Studio: Error while Installing APK
- [problem record] installed build tools revision 31.0.0 is broken during Android studio compilation
- Solve the problem of installing APK after Android studio compilation: error while installing apk
- Some processing experiences of failed to notify build listener
- Failed to find Build Tools revision 27.0.3
- Android Studio could not resolve resource
- Could not install Gradle distribution
- Android Error | Failed to find target with hash string ”android-23′ in…
- ERROR: Unsupported method: AndroidProject.getVariantNames().