Jetpack作曲发布版本: 1.0.0-alpha06 Android Studio Build: 4.2 1Canery 15
我的活动
class MainActivityA : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Text(text = "hello", modifier = Modifier.padding(12.dp))
}
}
以上运行时编译此错误:
java.lang.NoSuchMethodError: No static method setContent$default(Landroidx/activity/ComponentActivity;Landroidx/compose/runtime/Recomposer;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Landroidx/compose/runtime/Composition; in class Landroidx/compose/ui/platform/WrapperKt; or its super classes (declaration of 'androidx.compose.ui.platform.WrapperKt' appears in /data/app/com.jonathan-_j03c44RbBo00Hn7DeOjeA==/base.apk)
我的一些gradle设置
def jetpack_compose=“1.0.0-alpha06”
kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
composeOptions {
kotlinCompilerVersion '1.4.0'
kotlinCompilerExtensionVersion "$jetpack_compose"
}
//JetPack Compose stuff
implementation "androidx.compose.ui:ui:$jetpack_compose"
// Tooling support (Previews, etc.)
implementation "androidx.ui:ui-tooling:$jetpack_compose"
// Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
implementation "androidx.compose.foundation:foundation:$jetpack_compose"
// Material Design
implementation "androidx.compose.material:material:$jetpack_compose"
// Material design icons
implementation "androidx.compose.material:material-icons-core:$jetpack_compose"
implementation "androidx.compose.material:material-icons-extended:$jetpack_compose"
// Integration with observables
implementation "androidx.compose.runtime:runtime-livedata:$jetpack_compose"
implementation "androidx.compose.runtime:runtime-rxjava2:$jetpack_compose"
顶级构建脚本
/ Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.10"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.0-alpha15"
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我必须删除androidx.navigation:导航-撰写依赖,以及,这是我的问题。
我遇到了同样的问题。在appgradle文件中添加以下行后,它对我起了作用
buildFeatures {
compose true
}
我的应用程序运行正常,但突然我开始出现这个错误 java.lang.NoSuch方法错误:没有静态方法是AtLeastR()Z类Landroidx/core/os/BuildCompat;或其超级类(声明'androidx.core.os.BuildCompat'出现在 /data/app/com.app.goflatmates-RZKwS2h6hav==/base.apk)在com.google
我正在尝试从下面的git链接运行代码 但我有个错误 nosuchMethodError:没有静态方法getFont(landroid/content/context;ilandroid/util/typedvalue;ilandroid/widget/textview;)landroid/graphics/typeface;在Landroid/Support/V4/Content/Res/Reso
使用RAD v7和WebSphere AS v6.1,我收到了以下消息:; Java . lang . nosuchmethod error:org/Apache/axiom/om/omabstracfactory . getmetafactory()Lorg/Apache/axiom/om/OMMetaFactory; 其他答案(这里和这里)表明这是由于冲突的罐子。我已经安装了最新的RAD/WS
我在学习,我是新手,但我想知道我做什么来“运行”它。这是一个错误:
我有一个扩展方法: 应用程序安装时没有任何错误;但是当在运行时调用该方法时,它会给我以下错误: java.lang.NoSuch方法错误:没有静态方法onClickButtonBack(Lcom/app/common_client/ui/片段 /stores/StoresClientFragment;)V类Lcom/app/common_client/公共资源/公共资源AppTypeGroupKt
我试图在Android Studio中运行一个测试,测试设置抛出一个java.lang.NoSuchMethodError 测试: 有人知道正在发生什么,或者能给我指路? 编辑:当我在其他测试中创建一个实体的新实例时再次出现此错误,该实体在测试中是静态属性。