【发布时间】:2019-04-30 02:59:58
【问题描述】:
我正在尝试以编程方式将存储库添加到我的build.gradle 文件中。
根据Cordova docs,可以通过与build.gradle 目录相同的build-extras.gradle 文件扩展build.gradle。
问题是因为 gradle 同步仍然失败,所以没有添加/链接 repo。
这是我的 build-extras.gradle 文件:
buildscript {
repositories {
google()
}
}
我需要将google() repo 添加到我的build.gradle 中,例如:
buildscript {
repositories {
//google() <-- here
jcenter()
maven {
url "https://maven.google.com"
}
}
// Switch the Android Gradle plugin version requirement depending on the
// installed version of Gradle. This dependency is documented at
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
但我创建了 cordova docs info 来扩展而不是编辑 build.gradle
有可能吗?我的 build-extras.gradle 有什么问题?
【问题讨论】:
-
你找到答案了吗?
标签: cordova ionic-framework gradle build.gradle