Skip to content

ProGuard Errors in Non-Android Platforms and Dialog Crashes on iOS #7

@Lyxot

Description

@Lyxot

I've encountered serious problems with the release build on non-Android platforms, specifically:

  • ProGuard produces multiple warningswhen building for non-Android platforms
  • The app crashes when attempting to open dialogs on iOS

proguard error logs:

Warning: com.michaelflisar.composedialogs.core.style.BottomSheetStyle$Show$5: can't find referenced method 'androidx.compose.foundation.layout.WindowInsets getNavigationBars(androidx.compose.foundation.layout.WindowInsets$Companion)' in program class androidx.compose.foundation.layout.WindowInsets_notMobileKt

Warning: com.michaelflisar.composedialogs.core.style.BottomSheetStyle$Show$5$2$2: can't find referenced method 'androidx.compose.foundation.layout.WindowInsets getNavigationBars(androidx.compose.foundation.layout.WindowInsets$Companion)' in program class androidx.compose.foundation.layout.WindowInsets_notMobileKt

Warning: com.michaelflisar.composedialogs.core.style.DialogStyleKt: can't find referenced method 'androidx.compose.ui.Modifier anchoredDraggable$default(androidx.compose.ui.Modifier,androidx.compose.foundation.gestures.AnchoredDraggableState,androidx.compose.foundation.gestures.Orientation,boolean,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.foundation.OverscrollEffect,boolean,int,java.lang.Object)' in program class androidx.compose.foundation.gestures.AnchoredDraggableKt

Warning: com.michaelflisar.composedialogs.core.style.DialogStyleKt: can't find referenced method 'AnchoredDraggableState(java.lang.Object,androidx.compose.foundation.gestures.DraggableAnchors,kotlin.jvm.functions.Function1,kotlin.jvm.functions.Function0,androidx.compose.animation.core.AnimationSpec,androidx.compose.animation.core.DecayAnimationSpec,kotlin.jvm.functions.Function1)' in program class androidx.compose.foundation.gestures.AnchoredDraggableState

I've attempted to add ProGuard rules to ignore these warnings:

-dontwarn androidx.compose.foundation.layout.WindowInsets$Companion
-dontwarn com.michaelflisar.composedialogs.core.style.DialogStyleKt
-dontwarn com.michaelflisar.composedialogs.core.style.BottomSheetStyle$Show$5
-dontwarn com.michaelflisar.composedialogs.core.style.BottomSheetStyle$Show$5$2$2

However, while this suppresses the warnings, it doesn't solve the underlying issue causing iOS crashes.

iOS crash logs:

kotlin.NotImplementedError: An operation is not implemented.
Uncaught Kotlin exception:     at 0   TimeFlow.debug.dylib                0x10787c567        kfun:kotlin.Throwable#<init>(kotlin.String?){} + 99 
    at 1   TimeFlow.debug.dylib                0x10787712f        kfun:kotlin.Error#<init>(kotlin.String?){} + 95 
    at 2   TimeFlow.debug.dylib                0x107992a3b        kfun:kotlin.NotImplementedError#<init>(kotlin.String){} + 95 
    at 3   TimeFlow.debug.dylib                0x107992b2f        kfun:kotlin.NotImplementedError#<init>(kotlin.String?;kotlin.Int;kotlin.native.internal.DefaultConstructorMarker?){} + 223 
    at 4   TimeFlow.debug.dylib                0x1087af9cf        kfun:com.michaelflisar.composedialogs.core#defaultDialogStyle__at__com.michaelflisar.composedialogs.core.DialogDefaults(androidx.compose.runtime.Composer?;kotlin.Int){}com.michaelflisar.composedialogs.core.ComposeDialogStyle + 331 
    at 5   TimeFlow.debug.dylib                0x10884a5f7        kfun:com.michaelflisar.composedialogs.dialogs.color#DialogColor(com.michaelflisar.composedialogs.core.DialogState;androidx.compose.runtime.MutableState<androidx.compose.ui.graphics.Color>;com.michaelflisar.composedialogs.dialogs.color.DialogColor.Texts?;kotlin.Boolean;androidx.compose.ui.graphics.Shape?;kotlin.Int;com.michaelflisar.composedialogs.dialogs.color.DialogColor.LabelStyle?;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;kotlin.Function2<androidx.compose.runtime.Compos + 6495 
    at 6   TimeFlow.debug.dylib                0x10886e707        kfun:com.michaelflisar.composepreferences.screen.color.PreferenceColorDefaults#dialog(com.michaelflisar.composedialogs.core.DialogState;androidx.compose.ui.graphics.Color;kotlin.Function1<androidx.compose.ui.graphics.Color,kotlin.Unit>;kotlin.Boolean;kotlin.String;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){} + 3215 
    at 7   TimeFlow.debug.dylib                0x1088725df        kfun:com.michaelflisar.composepreferences.screen.color.PreferenceColor$1.invoke#internal + 899 
    at 8   TimeFlow.debug.dylib                0x108872717        kfun:com.michaelflisar.composepreferences.screen.color.PreferenceColor$1.$<bridge-DNNNNU>invoke(com.michaelflisar.composedialogs.core.DialogState;androidx.compose.runtime.Composer;kotlin.Int){}#internal + 195 
    at 9   TimeFlow.debug.dylib                0x108bef0bf        kfun:kotlin.Function3#invoke(1:0;1:1;1:2){}1:3-trampoline + 123 
    at 10  TimeFlow.debug.dylib                0x107bd40cf        kfun:androidx.compose.runtime.internal.ComposableLambdaImpl#invoke(kotlin.Any?;androidx.compose.runtime.Composer;kotlin.Int){}kotlin.Any? + 651 
    at 11  TimeFlow.debug.dylib                0x107bdfb57        kfun:androidx.compose.runtime.internal.ComposableLambdaImpl#$<bridge-NNNNNU>invoke(kotlin.Any?;androidx.compose.runtime.Composer;kotlin.Int){}kotlin.Any?(kotlin.Any?;androidx.compose.runtime.Composer;kotlin.Any?){}kotlin.Any? + 199 
    at 12  TimeFlow.debug.dylib                0x108bef0bf        kfun:kotlin.Function3#invoke(1:0;1:1;1:2){}1:3-trampoline + 123 
    at 13  TimeFlow.debug.dylib                0x1087d949f        kfun:com.michaelflisar.composepreferences.core.composables#BasePreferenceDialog__at__com.michaelflisar.composepreferences.core.scopes.PreferenceScope(com.michaelflisar.composedialogs.core.DialogStateNoData;kotlin.Function3<com.michaelflisar.composedialogs.core.DialogStateNoData,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;kotlin.String;com.michaelflisar.composepreferences.core.classes.Dependency?;com.michaelflisar.composepreferences.core.classes.Dependency?;kotlin.String?;kotlin.Function2<andr + 6483 
    at 14  TimeFlow.debug.dylib                0x10886d5cf        kfun:com.michaelflisar.composepreferences.screen.color#PreferenceColor__at__com.michaelflisar.composepreferences.core.scopes.PreferenceScope(androidx.compose.ui.graphics.Color;kotlin.Function1<androidx.compose.ui.graphics.Color,kotlin.Unit>;kotlin.Boolean;kotlin.String;com.michaelflisar.composepreferences.core.classes.Dependency?;com.michaelflisar.composepreferences.core.classes.Dependency?;kotlin.String?;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;com.michaelflisar.composep + 7875 
    at 15  TimeFlow.debug.dylib                0x108873153        kfun:com.michaelflisar.composepreferences.screen.color.PreferenceColor$3.invoke#internal + 815 
    at 16  TimeFlow.debug.dylib                0x10887321f        kfun:com.michaelflisar.composepreferences.screen.color.PreferenceColor$3.$<bridge-DNNNU>invoke(androidx.compose.runtime.Composer?;kotlin.Int){}#internal + 159 
    at 17  TimeFlow.debug.dylib                0x108beefcb        kfun:kotlin.Function2#invoke(1:0;1:1){}1:2-trampoline + 115 
    at 18  TimeFlow.debug.dylib                0x107b1acb3        kfun:androidx.compose.runtime.RecomposeScopeImpl#compose(androidx.compose.runtime.Composer){} + 803 
    at 19  TimeFlow.debug.dylib                0x107ad871b        kfun:androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd#internal + 1539 
    at 20  TimeFlow.debug.dylib                0x107adb5bf        kfun:androidx.compose.runtime.ComposerImpl#skipCurrentGroup(){} + 2375 
...

Source code: https://github.com/Lyxot/TimeFlow
I will upload full logs if you need

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions