#lewisd_error
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/1448326879265161247
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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
Hi @trim shale - yes unfortunately they couldn't reproduce it. I'll try and give you more information in case something jumps out
Are you sure the Places API key is valid?
and what if you change the allowedCountries list?
there's also this autocompleteCountries parameter
what happens if you set that as well?
While the default is already set by the SDK, I wonder if an explicit value assignment makes a difference here
Thanks @trim shale - give me 5 minutes ill get these details for you
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 } ] }, ...
Gotcha. Just to try different things, can you also try downgrading to an older version of the Places SDK to see if it changes the behavior? 2.6.0 is the one we document, quite old I know but doesn't hurt to try
https://docs.stripe.com/payments/mobile/collect-addresses?payment-ui=mobile&platform=android#set-up-address-autocomplete
Ok one moment
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
)
}
}
}
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)
...
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
Maybe? I'm not very familiar with the differences but afaik, it should just work ๐ค
What happens if you take out allowedCountries and autocompleteCountries ?
retain 2.6.0 or 5.1.1?
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
yeah same error. ill try one of those versions
4.0.0 results in no error but no suggestions either
๐ค
hmm silly question but your app has internet permission configured?
What version of Google play services are you integrated with?
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
Gotcha. Hmm running out of ideas. This SO suggest regenerating the API key for a similar issue - https://stackoverflow.com/questions/44163797/google-places-api-cant-found-results
Last thing I can think of is instead of integrating Stripe, you do a native Google Places integration following google's docs and see if that works. If not, you may need to talk to Google about this
This SO says there's application type restrictions on the API key - https://stackoverflow.com/questions/44165012/google-places-autocomplete-on-ios-cant-load-search-results-try-again
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
Sure thing but we might need to switch to email support for that.
Ok that's fine, ill keep you updated. thanks again @trim shale
NP! Good luck