At the outset only a matter of Android studio encountered in the use of purely personal study notes, there is something wrong can leave a message.
The java file after shelling to drag Studio Android
Android Studio is first promptedERROR: Gradle version 2.2 is required. Current version is 5.1.1
First, make sure to configure Bild, Execution, Deployment> Build Tools > Gradle in
selected third, configuredGradle home
to gradle local version of Android, macOS can Right-click on the application Android studio show package contents, you can see in the gradle directory.
Tip build again
Could not find com.android.tools.build:gradle:2.2.3.
to view the current version gradle system again, this refers to the gradle compilation tools in repository, version gradle not before,
my path in the/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle
classpath modification in the build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
}
Still does not work, add in the gradle
allprojects {
repositories {
google()
jcenter()
}
}
Met again build
The specified Android SDK Build Tools version (23.0.1) is ignored, as it is
roughly means build version 26.0.2 inappropriate tools currently used,
modifiedbuildToolsVersion
for the specific version (error there)
If I run across compile time metError:Failed to open zip file
, you can do the following
first delete the following files
macOS: ~ / .gradle / wrapper / dists
Linux: ~ / .gradle / wrapper / dists
Windows: C: \ the Users \ your-username.gradle \ wrapper \ dists
然后重启File Invalidate Caches / Restart
参考:https://stackoverflow.com/questions/44071080/could-not-find-com-android-tools-buildgradle3-0-0-alpha1-in-circle-ci