小编Mee*_*tel的帖子

Val 不能在 android buildTool 30.0.1 中重新分配

我对 kotlin 不熟悉。我有一个应用程序,它的构建工具版本为 29.0.3,以下代码运行良好。

init {
    // Make sure that the view finder reference is valid
    val viewFinder = viewFinderRef.get()
            ?: throw IllegalArgumentException("Invalid reference to view finder used")

    // Initialize the display and rotation from texture view information
    viewFinderRotation = getDisplaySurfaceRotation(viewFinder.display)

    // Initialize public use-case with the given config
    previewUseCase = Preview(config)

    // Every time the view finder is updated, recompute layout
    previewUseCase.setOnPreviewOutputUpdateListener { output ->
        val vFinder = viewFinderRef.get() ?: return@setOnPreviewOutputUpdateListener

        // To update the SurfaceTexture, we have to …
Run Code Online (Sandbox Code Playgroud)

android kotlin

3
推荐指数
1
解决办法
377
查看次数

标签 统计

android ×1

kotlin ×1