Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputTextField NoSuchMethodError Crash #32

Closed
Gil2599 opened this issue Mar 2, 2023 · 13 comments
Closed

InputTextField NoSuchMethodError Crash #32

Gil2599 opened this issue Mar 2, 2023 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@Gil2599
Copy link

Gil2599 commented Mar 2, 2023

Seems like using InputTextField as one of the input options for Input Dialog throws NoSuchMethodError.

java.lang.NoSuchMethodError: No static method TextField(Ljava/lang/String;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;ZZLandroidx/compose/ui/text/TextStyle;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;ZLandroidx/compose/ui/text/input/VisualTransformation;Landroidx/compose/foundation/text/KeyboardOptions;Landroidx/compose/foundation/text/KeyboardActions;ZILandroidx/compose/foundation/interaction/MutableInteractionSource;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/material3/TextFieldColors;Landroidx/compose/runtime/Composer;III)V in class Landroidx/compose/material3/TextFieldKt; or its super classes (declaration of 'androidx.compose.material3.TextFieldKt' appears in /data/app/~~hWNpS5NQIa0cv5wDFM3ITw==/com.<package-name>-IlNA4GFNg4kloexJLTKSXw==/base.apk)

Current versions:
Compose: 1.3.1
Compose Compiler: 1.4.3
Kotlin: 1.8.10
Dialogs Library: 1.1.0

@maxkeppeler
Copy link
Owner

Sheets-Compose-Dialogs is currently using Compose 1.3.0. Try downgrading to the equal version 1.3.0 until Sheets-Compose-Dialogs is updated.

@Gil2599
Copy link
Author

Gil2599 commented Mar 15, 2023

Error seems to be happening on Compose version 1.3.0 also.

@maxkeppeler
Copy link
Owner

The current version supports: 1.3.0 Compose & Compiler | 1.7.10 Kotlin
1.1.1 will use:

 const val KOTLIN = "1.8.10"

 const val COMPOSE_BOM = "2023.01.00"
 const val COMPOSE = "1.3.3"
 const val COMPOSE_COMPILER = "1.4.3"

@Gil2599
Copy link
Author

Gil2599 commented Mar 20, 2023

Error keeps happening after updating to version 1.1.1. I am using InputDialog with InputTextField() input option. Is there anything else I am missing or other dependencies that I need? Thank you.

@maxkeppeler maxkeppeler reopened this Mar 20, 2023
@maxkeppeler
Copy link
Owner

I can not replicate this problem from my own two android projects using InputDialog & InputTextField() with Version 1.1.1. Also, I used the dependencies of the 1.1.1 for the sample app instead of the modules, and it's working fine too.
Is the project you are working on Open Source?

@Gil2599
Copy link
Author

Gil2599 commented Mar 24, 2023

I'm sorry it is not, but I would be happy to provide any information necessary to fix this.

@maxkeppeler
Copy link
Owner

Unfortunately, I don't know where to get started. Or what else could be relevant for this error. I was certain the correct compose versions would fix this issue, as it is common with those kinds of errors. I can't reproduce it in my apps or in the sample. Did you double-check that all the version (Kotlin, Compose and Build Gradle) are the same or compatible as in 1.1.1?

@maxkeppeler maxkeppeler added the help wanted Extra attention is needed label Mar 24, 2023
@Gil2599
Copy link
Author

Gil2599 commented Mar 24, 2023

I am using the same Compose BOM version as in 1.1.1 with Kotlin 1.8.10. Everything should be compatible. Only difference I could find is that I am using a higher Compose Navigation version, but I am not sure why that would cause this issue.

@maxkeppeler
Copy link
Owner

It's highly unlikely in my opinion that the different compose navigation version would cause this. Did you try to Invalidate Caches etc.? I have unfortunately no further ideas, what could cause that as you are also the first one experiencing it so far.

@PeterKastner
Copy link

PeterKastner commented Apr 7, 2023

Hi, I was just experiencing the same crash when using InputTextField as one of the input options for Input Dialog

@Gil2599 Are you by any chance using a specific version of

androidx.compose.material3:material3 or
androidx.compose.material3:material3-window-size-class

meaning not specified by the Compose BOM?

What fixed it for me was reverting back to not declare the specific version of material3 - androidx.compose.material3:material3:1.1.0-beta01 in my build.gradle file.

Am using
composeBom = platform("androidx.compose:compose-bom:2023.01.00")
kotlinCompilerExtensionVersion '1.4.3' and
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
currently to work around the crash.

Regards, happy easter and let me know what you think.

Current versions:
Compose: 1.3.3
Compose Compiler: 1.4.3
Kotlin: 1.8.10
Dialogs Library: 1.1.1

@russellbanks
Copy link

russellbanks commented May 3, 2023

JetBrains/compose-multiplatform#2673 (comment)

As @PeterKastner said this seems to occur when using a pre-release Material3 version because it breaks backwards compatibility.

Unless there's a workaround, I'll have to avoid using InputTextField as the current pre-release Material3 versions have bottom sheets that I need in my app.

@russellbanks
Copy link

Material3 has reached 1.1.0. This should hopefully be fixed once sheets updates to that too.

@maxkeppeler
Copy link
Owner

I will update the BOM dependency to 2023.04.01 which includes the Material3 1.1.0 dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants