Error:(6, 0) Gradle DSL method not found: #39;google()#39;(错误:(6, 0) 未找到 Gradle DSL 方法:“google())
问题描述
/Users/Ren/Desktop/RecylerViewBaseAdapter/build.gradle
Error:(6, 0) Gradle DSL method not found: 'google()'
Possible causes:
The project 'RecylerViewBaseAdapter' may be using a version of Gradle that does not contain the method.
Gradle settings
The build file may be missing a Gradle plugin.
Apply Gradle plugin
推荐答案
google() 存储库是在 Google 的 Maven 存储库中查找依赖项的快捷方式.它是通过 gradle v 引入的.4.0.
The google() repo is a shortcut to look in Google's Maven repository for dependencies. It was introduced with gradle v.4.0.
它需要(当前)
- Gradle v.4
- Android Studio 3.x.
- 适用于 Android 3.x 的 Gradle 插件
尝试在gradle-wrapper.properties中使用:
distributionUrl=
https://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
作为 Android 的 gradle 插件使用:
As gradle plugin for Android use:
classpath 'com.android.tools.build:gradle:3.0.0-beta1'
在任何情况下(也适用于 Android Studio 2.3、gradle plugin 2.3.3 和 gradle v3.3),您可以使用 { url 'https://maven.google.com'}代码>.是一样的.
In any case (also with Android Studio 2.3, gradle plugin 2.3.3 and gradle v3.3) you can use the same maven repo using { url 'https://maven.google.com'}. It is the same.
仅使用示例:
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
//
}
这篇关于错误:(6, 0) 未找到 Gradle DSL 方法:“google()"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误:(6, 0) 未找到 Gradle DSL 方法:“google()"
基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iOS4 创建后台定时器 2022-01-01
