1. Problem phenomenon:
When compiling the android project, Gradle Sync is normal, but an error is reported during compilation, prompting Could not resolve. . .
2. Solutions
When dealing with the above problems, four solutions were used, and the last method 4 took effect.
method 1:
Recompile:
Clean the project first and then recompile the project.
This method does not take effect for this error.
Method 2:
Clear all resources of the project and reload them.
This method does not take effect for this error.
Method 3:
Upgrade the Gradle plug-in version of the project and the corresponding Gradle version. Note that the Gradle plug-in version and the Gradle version must correspond.
After trying, this method still cannot solve this problem.
Method 4:
Delete the gradle.properties file under the corresponding environment variable.
Windows path: C:\Users\username.gradle
Back up the .gradle folder in this directory and delete it.
Then reload the project.