Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoSuchMethodError: No static method weight$default(Landroidx/compose/foundation/layout/RowScope;Landroidx/compose/ui/Modifier;FZILjava/l

I am getting the below error logs in the sign debug build. but it is working fine in a sign release build and normal debug build. I am using third-party library to display the header component. in third-party library I am facing the below issue java.lang.NoSuchMethodError: No static method weight$default(Landroidx/compose/foundation/layout/RowScope;Landroidx/compose/ui/Modifier;FZILjava/lang/Object;)Landroidx/compose/ui/Modifier; in class Landroidx/compose/foundation/layout/RowScope; or its super classes (declaration of 'androidx.compose.foundation.layout.RowScope' appears in /data/app/com.xxx.xxxxx-YA6SxY30QsTUjhr6DzpFHg==/base.apk) at com.ads.ds.compose.header.HeaderKt.JDSHeader(Header.kt:205) Any help will be thankful.

2022-10-06 12:18:45.105 28649-28649/com.xxx.xxxxx E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.xxx.xxxxx, PID: 28649
    java.lang.NoSuchMethodError: No static method weight$default(Landroidx/compose/foundation/layout/RowScope;Landroidx/compose/ui/Modifier;FZILjava/lang/Object;)Landroidx/compose/ui/Modifier; in class Landroidx/compose/foundation/layout/RowScope; or its super classes (declaration of 'androidx.compose.foundation.layout.RowScope' appears in /data/app/com.xxx.xxxxx-YA6SxY30QsTUjhr6DzpFHg==/base.apk)
        at com.ads.ds.compose.header.HeaderKt.JDSHeader(Header.kt:205)
        at com.xxx.xxxxx.header.MyAppJDSHeader.SetJDSHeader(MyAppJDSHeader.kt:59)
        at com.xxx.xxxxx.header.MyAppJDSHeader.MyAppJdsHeader(MyAppJDSHeader.kt:49)
        at com.xxx.xxxxx.dashboard.activities.DashboardActivity$setComposeHeader$1$invoke$$inlined$MyAppJdsTheme$1.invoke(MyAppJdsTheme.kt:57)
        at com.xxx.xxxxx.dashboard.activities.DashboardActivity$setComposeHeader$1$invoke$$inlined$MyAppJdsTheme$1.invoke(MyAppJdsTheme.kt:32)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.material.MaterialTheme_androidKt.PlatformMaterialTheme(MaterialTheme.android.kt:23)
        at androidx.compose.material.MaterialThemeKt$MaterialTheme$1$1.invoke(MaterialTheme.kt:82)
        at androidx.compose.material.MaterialThemeKt$MaterialTheme$1$1.invoke(MaterialTheme.kt:81)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
        at androidx.compose.material.TextKt.ProvideTextStyle(Text.kt:265)
        at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:81)
        at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:80)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
        at androidx.compose.material.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:72)
        at com.ads.ds.compose.themes.JdsThemeKt$JdsTheme$1.invoke(JdsTheme.kt:11)
        at com.ads.ds.compose.themes.JdsThemeKt$JdsTheme$1.invoke(JdsTheme.kt:10)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
        at com.ads.ds.compose.themes.JdsThemeKt.ProvideJdsThemeColors(JdsTheme.kt:29)
        at com.ads.ds.compose.themes.JdsThemeKt.JdsTheme(JdsTheme.kt:10)
        at com.xxx.xxxxx.dashboard.activities.DashboardActivity$setComposeHeader$1.invoke(DashboardActivity.kt:8286)
        at com.xxx.xxxxx.dashboard.activities.DashboardActivity$setComposeHeader$1.invoke(DashboardActivity.kt:1230)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:402)
        at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:248)
        at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:247)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
2022-10-06 12:18:45.114 28649-28649/com.xxx.xxxxx E/AndroidRuntime:     at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:177)
        at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:123)
        at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:122)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
        at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:114)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:157)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:156)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:156)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:140)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:74)
        at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3193)
        at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3183)
        at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:252)
        at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
        at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3183)
        at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3119)
        at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:584)
        at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:811)
        at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:519)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:140)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
        at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:1015)
        at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:131)
        at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:182)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
        at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:202)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:138)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
        at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:1102)
        at android.view.View.dispatchAttachedToWindow(View.java:19678)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3455)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
2022-10-06 12:18:45.114 28649-28649/com.xxx.xxxxx E/AndroidRuntime:     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3462)
like image 946
Ankush Avatar asked Nov 03 '25 22:11

Ankush


1 Answers

For me helped to add default value fill to weight parameter:

Text(
    modifier = Modifier
        .weight(1f, false)
    text = "",
)
like image 59
Евгений Павлов Avatar answered Nov 06 '25 22:11

Евгений Павлов



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!