Studio3.1.1's solution to Error:Unable to resolve dependency

In class, life and death could not be resolved, and then the teacher came to help me tinker. . . Write down the teacher's solution, so that you can solve it yourself if you make mistakes in the future

My mistake:

Possible causes:<ul><li>The project ‘XXXXXXX' may be using a version of Gradle that does not containPossible causes:<ul><li>The project ‘XXXXXXX' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The <a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

 the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

 

Or similar errors, my previous solution was to copy a copy of the previous gradle dependencies

dependencies {    implementation fileTree(include: ['*.jar'], dir: 'libs')    implementation 'com.android.support:appcompat-v7:26.1.0'implementation 'com.android.support.constraint:constraint-layout:1.0.2'testImplementation 'junit:junit:4.12'androidTestImplementation 'com.android.support.test:runner:1.0.1'androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'


    
    
    
    

}


But recyclerview always reports an error. .

The teacher said that the reason for my problem was that after downloading the new Android Studio , the corresponding gradle was not downloaded successfully because of the wall . .

The solution is to open settings and search for HTTP proxy after scientifically surfing the Internet .


Fill in the code of the HTTP(S) proxy server at this time into the Host name and port number , build it again , and switch to no proxy after the compilation is successful.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324492540&siteId=291194637