#lewisd_error

1 messages ยท Page 1 of 1 (latest)

glad cedarBOT
#

๐Ÿ‘‹ 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/1448326879265161247

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

trim shale
#

Hello
Jumping in to help out here
Give me a moment to take a quick look

#

Looks like an Engineer responded to the issue on Github already

#

they weren't able to reproduce this

astral thunder
trim shale
#

Are you sure the Places API key is valid?

#

and what if you change the allowedCountries list?

#

While the default is already set by the SDK, I wonder if an explicit value assignment makes a difference here

astral thunder
#

Thanks @trim shale - give me 5 minutes ill get these details for you

astral thunder
# trim shale Are you sure the Places API key is valid?

It is valid and even unrestricted at the moment, here's an example:

curl -X POST 'https://places.googleapis.com/v1/places:autocomplete' \ -H 'Content-Type: application/json' \ -H 'X-Goog-Api-Key: <REDACTED>' \ -d '{ "input": "10 Downing Street", "includedRegionCodes": ["gb"] }' { "suggestions": [ { "placePrediction": { "place": "places/ChIJx2E7b8UEdkgRtw6rLyLUl5w", "placeId": "ChIJx2E7b8UEdkgRtw6rLyLUl5w", "text": { "text": "10 Downing Street, London, UK", "matches": [ { "endOffset": 2 }, { "startOffset": 3, "endOffset": 17 } ] }, ...

trim shale
astral thunder
#

Ok one moment

astral thunder
# trim shale As per - https://stripe.dev/stripe-android/paymentsheet/com.stripe.android.payme...

Also here is the current list of countries, still does not work unfortunately:

    return remember(stripeLauncher, publishableKey) {
        object : AddressLauncher {
            override fun present() {
                val config = StripeAddressLauncher.Configuration.Builder()
                    .allowedCountries(setOf("GB"))
                    .autocompleteCountries(setOf("GB"))
                    .googlePlacesApiKey(BuildConfig.GOOGLE_PLACES_API_KEY)
                    .build()

                Log.d(
                    "AddressLauncher",
                    "Launching with Places API key: ${BuildConfig.GOOGLE_PLACES_API_KEY.take(10)}..."
                )
                Log.d("AddressLauncher", "Configuration: $config")

                stripeLauncher.present(
                    publishableKey = publishableKey,
                    configuration = config
                )
            }
        }
    }
glad cedarBOT
astral thunder
# trim shale Gotcha. Just to try different things, can you also try downgrading to an older v...

Ok so using 2.6.0 resulted in the app crashing:

java.lang.NoSuchMethodError: No virtual method setTypesFilter(Ljava/util/List;)Lcom/google/android/libraries/places/api/net/FindAutocompletePredictionsRequest$Builder; in class Lcom/google/android/libraries/places/api/net/FindAutocompletePredictionsRequest$Builder; or its super classes (declaration of 'com.google.android.libraries.places.api.net.FindAutocompletePredictionsRequest$Builder' appears in /data/app/~~Ob04YEhVv7Q0azyZIPrZmw==/com.shirtly.app.dev-9zF7F8pDk9KqP8w8VMCDTA==/base.apk!classes19.dex)
at com.stripe.android.ui.core.elements.autocomplete.DefaultPlacesClientProxy.findAutocompletePredictions-BWLJW6A(PlacesClientProxy.kt:107)at com.stripe.android.paymentsheet.addresselement.AutocompleteViewModel$1$1.invokeSuspend(AutocompleteViewModel.kt:71)
...
glad cedarBOT
astral thunder
#

I think the big difference between my implementation and yourselves is that my project is a KMP app. So although it should work fine, there could be some edge cases im not covering

trim shale
#

Maybe? I'm not very familiar with the differences but afaik, it should just work ๐Ÿค”

astral thunder
#

retain 2.6.0 or 5.1.1?

trim shale
#

on 2.6.0

#

Ah on second thought, the Stripe SDK may still try to invoke setTypesFilter which likely doesn't exist in 2.6.x version

#

Maybe try a minor bump to 3.5.x or 4.0.0

astral thunder
#

yeah same error. ill try one of those versions

#

4.0.0 results in no error but no suggestions either

#

๐Ÿค”

trim shale
#

hmm silly question but your app has internet permission configured?

#

What version of Google play services are you integrated with?

astral thunder
#

it does yes: <uses-permission android:name="android.permission.INTERNET"/>

#
  • play-services-base: 18.5.0
    • play-services-basement: 18.4.0
    • play-services-tasks: 18.2.0
    • play-services-maps: 18.0.2
    • play-services-location: 21.0.1
    • play-services-wallet: 19.4.0
    • play-services-auth: 21.1.1
trim shale
astral thunder
#

THanks @trim shale I will give that a try.

If I get nowhere, do you have capacity to retry this on a public repo to reproduce the issue if I create one for you? It's ok if that's not possible, just checking

trim shale
#

Sure thing but we might need to switch to email support for that.

astral thunder
#

Ok that's fine, ill keep you updated. thanks again @trim shale

trim shale
#

NP! Good luck

astral thunder
#

regenerating the api key worked....

#

thanks google

trim shale
#

Oh wow, damn

#

Shoutout to the random SO user

astral thunder
#

thank god they went back and answered their own question

#

thanks for all the help @trim shale