【发布时间】:2018-05-22 18:39:45
【问题描述】:
我是 Android 开发的新手。我已经使用 Android Studio 创建了一个新项目,需要将 jetbrains 公开库导入到我现有的项目中。当我尝试按照公开的入门指南将以下内容添加到 build.grade 文件中时:
repositories {
maven {
url "https://dl.bintray.com/kotlin/exposed"
}
}
dependencies {
compile 'org.jetbrains.exposed:exposed:0.10.2'
}
我收到以下错误:
Could not find method compile() for arguments [org.jetbrains.exposed:exposed:0.10.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
我已经在互联网上搜索了几天,但仍然无法找出问题所在。
这是 build.gradle 文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.40'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
repositories {
maven {
url "https://dl.bintray.com/kotlin/exposed"
}
}
dependencies {
compile 'org.jetbrains.exposed:exposed:0.10.2'
}
task clean(type: Delete) {
delete rootProject.buildDir
}
希望有人可以帮助我。
提前致谢。
【问题讨论】: