#thiagomacauba88_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1367217373991665805
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐ I'm going to need more context on your situation. What code are you calling when this is encountered?
This is for Android right? Is that using Java, Kotlin, or React Native?
Android java
I'm trying to display the payment sheet
GooglePay support team, said that i need to upgrade to 20.24
I was using 19.1 and i didnt have this
can you help me?
Quite possibly, but I'm going to need more context. I can't tell from an error about no class definition alone what class you're trying to call that isn't being found.
can i send to you the whole log?
the payment sheet after some version is probably using the compose.. as i dont have the compose for our project, one of the suggestion was add the libraries:
implementation "androidx.compose.ui:ui:1.5.1"
implementation "androidx.compose.material:material:1.5.1"
implementation "androidx.compose.ui:ui-tooling-preview:1.5.1"
implementation "androidx.activity:activity-compose:1.7.2"
but i'm still have the issue
Can we start by getting an understanding of what function you're calling when this error is encountered?
sure
paymentSheet.presentWithPaymentIntent(data.getClientSecret(), data.getConfiguration());
do you have any ideas?
Not yet, I'm still trying to understand what function could be missing. I'm wondering if there is an import that is missing here.
OK, thanks
I'm also checking with a teammate of mine who is more familiar with android environments.
sounds good ๐
If you hardcode the client secret and configuration values here (rather than calling a function to read them from somewhere) does the error subside?
let me check
i dont think this is related to the client secret, because if i move back to version 19.1 works
To clarify, you're talking about changing the version of stripe-android that you're using in your project?
correct: com.stripe:stripe-android:
Which subversion of 20.24 are you trying to use?
what do you mean about subversion?
We released v20.24.0: https://github.com/stripe/stripe-android/releases/tag/v20.24.0
v20.24.1: https://github.com/stripe/stripe-android/releases/tag/v20.24.1
and v20.24.2: https://github.com/stripe/stripe-android/releases/tag/v20.24.2
๐ stepping in as toby needs to step away
Okay https://github.com/stripe/stripe-android/issues/7184 looks to be related to your issue here where LocalSoftwareKeyboardController is removed in a newer version of Compose.
The suggestion in that issue seems to be to downgrade to a non-alpha version of Compose Material3... 1.1.1 seems referenced: https://github.com/stripe/stripe-android/issues/7184#issuecomment-1688281897
let me check
so, do i need to use: implementation 'androidx.compose.ui:ui-android:1.5.4'?
The recommended version in that issue seems to be 1.1.1
ok let me try to remove these:
implementation "androidx.compose.ui:ui:1.5.1"
implementation "androidx.compose.material:material:1.5.1"
implementation "androidx.compose.ui:ui-tooling-preview:1.5.1"
implementation "androidx.activity:activity-compose:1.7.2"
and add this: androidx.compose.ui:ui-android:1.1.1"
give me 1 min
I added: implementation "androidx.compose.ui:ui:1.1.1"
implementation "androidx.compose.material:material:1.1.1"
implementation "androidx.compose.ui:ui-tooling-preview:1.1.1"
implementation "androidx.activity:activity-compose:1.1.1"
log:
Hmm okay well maybe that version doesn't actually work then, sorry.
After reading through the whole github issue it seems that this may be a better fix based on the amount of people indicating a thumbs up: https://github.com/stripe/stripe-android/issues/7184#issuecomment-1776245431
You could also try compose 1.5.4 first and see if that works
Alright well in that case I'd revert back to whatever you had when seeing the original error and then add the bridge as referenced in the issue.
Sorry that this is such a hassle ๐ฆ
but GooglePay requires me to use the 20.24
Right you originally hit the java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/ui/platform/LocalSoftwareKeyboardController; error when you upgraded
So reset back to whatever version of Compose that used
Where you triggered that error
ok
Then add the bridge
i'll remove everything related to compose, i'll keep only the stripe library
what's your next idea?
You added the bridge code?
witch one? because we have a couple
The code mentioned in https://github.com/stripe/stripe-android/issues/7184#issuecomment-1776245431
Hi there. I'll be taking over for bismarck, who needed to step away.
Command+f for the text "put this bridge" in the comment that bismarck linked; that's what he is referring to
i don't have this code
The suggestion is that you add similar code as a workaround to the issue that you're facing. Can you try implementing the workaround?
Create that class in kotlin?
So sorry, I was working with someone else and missed your message here
I have less familiarity with Kotlin than bismarck, but this is the code they were suggesting:
object LocalSoftwareKeyboardController {
val current
@Composable
get() = LocalSoftwareKeyboardController.current
}```
ok, my project is java, so ineed to create this class then?
Hi hi! Iโm going to be taking over for my colleague here. Give me a minute to read back and understand things.