gpt4 book ai didi

android - 无法在 Anko 中预览

转载 作者:行者123 更新时间:2023-11-29 18:35:51 25 4
gpt4 key购买 nike

我有这个问题:

错误:

C:\Users\avi12\OneDrive\Documents\AndroidApps\WhatsApp Easy Sticker Maker\app\src\main\java\com\avi12\whatsappeasystickermaker\MainActivity.kt: (20, 13): Overload resolution ambiguity:
public inline fun ViewManager.textView(init: (@AnkoViewDslMarker TextView).() -> Unit): TextView defined in org.jetbrains.anko
public inline fun ViewManager.textView(init: (@AnkoViewDslMarker TextView).() -> Unit): TextView defined in org.jetbrains.anko

我的代码,因为我刚刚开始发现 Anko:

package com.avi12.whatsappeasystickermaker

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import org.jetbrains.anko.design.*
import org.jetbrains.anko.*

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

coordinatorLayout {
textView {
text = "Begin by tapping the + button"
}
floatingActionButton {

}
}
}
}

Anko 版本:0.10.8
Android Studio 版本:3.3

最佳答案

问题似乎在于,在 build.gradle 中我有:

dependencies {
...
implementation "org.jetbrains.anko:anko-sdk25:$anko_version" // sdk15, sdk19, sdk21, sdk23 are also available
implementation "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
}

出于某种原因,这部分解决了问题(就成功构建而言,但仍然没有预览):

dependencies {
...
// implementation "org.jetbrains.anko:anko-sdk25:$anko_version" // sdk15, sdk19, sdk21, sdk23 are also available
implementation "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
}

关于android - 无法在 Anko 中预览,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54411754/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com