错误:(6, 0) 未找到 Gradle DSL 方法:“google()"
- 作者: 联合国灭狗灭猫特种战士
- 来源: 51数据库
- 2022-10-26
问题描述
/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= http://www.51sjk.com/Upload/Articles/1/0/334/334399_20221026111140448.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' }
}
//
}
推荐阅读
热点文章
检查拆分键盘
0
带有“上一个"的工具栏和“下一个"用于键盘输入AccessoryView
0
Activity 启动时显示软键盘
0
UIWebView 键盘 - 摆脱“上一个/下一个/完成"酒吧
0
在 iOS7 中边缘滑动时,使键盘与 UIView 同步动画
0
我的 iOS 应用程序中的键盘在 iPhone 6 上太高了.如何在 XCode 中调整键盘的分辨率?
0
android:inputType="textEmailAddress";- '@' 键和 '.com' 键?
0
禁用 iPhone 中键盘的方向
0
Android 2.3 模拟器上的印地语键盘问题
0
keyDown 没有被调用
0
