java.lang.AssertionError: CALL 'public final fun <get-currentComposer> [英] java.lang.AssertionError: CALL 'public final fun <get-currentComposer>

查看:29
本文介绍了java.lang.AssertionError: CALL 'public final fun <get-currentComposer>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 jetPack Compose 创建一个项目,我有所有必要的依赖项才能使其工作,但是当我运行我的应用程序时,它抛出一个错误,我找不到解决方案

  • 这是错误:

 java.lang.AssertionError: CALL 'public final fun <get-currentComposer>(): androidx.compose.runtime.Composer<*>在 androidx.compose.runtime.ComposerKt' type=androidx.compose.runtime.Composer<*> 中声明原点=FOR_LOOP_ITERATOR

  • 我添加的所有依赖项
<预><代码>def jetpackDef = "1.0.0-alpha09";//Jetpack 组合导航实现androidx.navigation:navigation-compose:1.0.0-alpha04"实现androidx.compose.ui:ui:$jetpackDef";//工具支持(预览等)实现androidx.compose.ui:ui-tooling:$jetpackDef"//基础(边框、背景、框、图像、滚动、形状、动画等)实现androidx.compose.foundation:foundation:$jetpackDef";//材料设计实现androidx.compose.material:material:$jetpackDef";//材料设计图标实现androidx.compose.material:material-icons-core:$jetpackDef";实现androidx.compose.material:material-icons-extended:$jetpackDef";//与可观察的集成实现androidx.compose.runtime:runtime-livedata:$jetpackDef";实现androidx.compose.runtime:runtime-rxjava2:$jetpackDef"实现androidx.compose.runtime:runtime:$jetpackDef"构建功能{//为此模块启用 Jetpack Compose写真}编译选项{sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8}科特林选项{jvmTarget = 1.8"useIR = 真}

任何帮助将不胜感激,谢谢.

解决方案

我通过设置 compose 选项使其工作,当我使用 kotlinCompilerExtensionVersion = "1.0.0-alpha08" 时出现此错误,而其余的库在alpha09.

 composeOptions {kotlinCompilerVersion = "1.4.21";kotlinCompilerExtensionVersion = "1.0.0-alpha09";}

I'm trying to make a project using jetPack Compose , i have all necessary dependencies for it to work but when i run my app , it throws an error that i couldn't find a solution for

  • This is the error :

 java.lang.AssertionError: CALL 'public final fun <get-currentComposer> (): androidx.compose.runtime.Composer<*> declared in androidx.compose.runtime.ComposerKt' type=androidx.compose.runtime.Composer<*> origin=FOR_LOOP_ITERATOR

  • All dependencies that i added


 def jetpackDef = "1.0.0-alpha09"


  // Jetpack compose navigation
        implementation "androidx.navigation:navigation-compose:1.0.0-alpha04"

implementation "androidx.compose.ui:ui:$jetpackDef"
        // Tooling support (Previews, etc.)
        implementation "androidx.compose.ui:ui-tooling:$jetpackDef"
        // Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
        implementation "androidx.compose.foundation:foundation:$jetpackDef"
        // Material Design
        implementation "androidx.compose.material:material:$jetpackDef"
        // Material design icons
        implementation "androidx.compose.material:material-icons-core:$jetpackDef"
        implementation "androidx.compose.material:material-icons-extended:$jetpackDef"
        // Integration with observables
        implementation "androidx.compose.runtime:runtime-livedata:$jetpackDef"
        implementation "androidx.compose.runtime:runtime-rxjava2:$jetpackDef"
        implementation "androidx.compose.runtime:runtime:$jetpackDef"


     buildFeatures {
        // Enables Jetpack Compose for this module
        compose true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }


    kotlinOptions {
        jvmTarget = "1.8"
        useIR = true
    }

Any Help would be appreciated guys , thank you .

解决方案

I got it working by settings the composeOptions, I got this error when I had kotlinCompilerExtensionVersion = "1.0.0-alpha08", whilst rest of the libraries where alpha09.

    composeOptions {
        kotlinCompilerVersion = "1.4.21"
        kotlinCompilerExtensionVersion = "1.0.0-alpha09"
    }

这篇关于java.lang.AssertionError: CALL 'public final fun &lt;get-currentComposer&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆