小编8hu*_*ham的帖子

Android/Kotlin:未解决的参考:木材

我正在尝试为 Android 编写 kotlin 库,但不能包含木材。我总是收到以下错误:

Error:error: unresolved reference: timber
Run Code Online (Sandbox Code Playgroud)

我的 build.gradle 中有这个:

apply plugin: 'java-library'
apply plugin: 'kotlin'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"

buildscript {
    ext.kotlin_version = '1.1.2-4'
    repositories {
        maven {url "https://maven.google.com"}
        mavenCentral()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    compile 'com.jakewharton.timber:timber:4.5.1'
    testCompile 'junit:junit:4.12'
}
Run Code Online (Sandbox Code Playgroud)

我的源文件目前非常简单:

package net.mbonnin.test

import timber.log.Timber

class Main() {

    fun main() {
        Timber.d("hello world")
    }
} …
Run Code Online (Sandbox Code Playgroud)

android kotlin timber-android

4
推荐指数
1
解决办法
1966
查看次数

如何使用Kotlin在Android中动态添加按钮

如何使用Kotlin在Android中动态添加按钮?

我是Kotlin的新手,请帮忙.

android kotlin

0
推荐指数
1
解决办法
1019
查看次数

标签 统计

android ×2

kotlin ×2

timber-android ×1