You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When enable StrictMode Stripe SDK internally is Violating Network operations on Main Thread
Code to reproduce
Wrapping the CustomerAdapter and provides ephemeral key, customer id, and client secret after initialize with PaymentConfiguration.init(context, publishableKey)
StrictMode D
StrictMode policy violation: android.os.strictmode.NetworkViolation (Ask Gemini)
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1672)
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:115)
at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
at java.net.InetAddress.getAllByName(InetAddress.java:1152)
at com.android.okhttp.Dns$1.lookup(Dns.java:41)
at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:176)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
at com.stripe.android.core.networking.StripeConnection$AbstractConnection.getResponseCode(StripeConnection.kt:31)
at com.stripe.android.core.networking.StripeConnection$AbstractConnection.getResponse(StripeConnection.kt:39)
at com.stripe.android.core.networking.DefaultStripeNetworkClient.parseResponse(DefaultStripeNetworkClient.kt:80)
at com.stripe.android.core.networking.DefaultStripeNetworkClient.makeRequest(DefaultStripeNetworkClient.kt:65)
at com.stripe.android.core.networking.DefaultStripeNetworkClient.access$makeRequest(DefaultStripeNetworkClient.kt:14)
at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeRequest$2.invoke(DefaultStripeNetworkClient.kt:24)
at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeRequest$2.invoke(DefaultStripeNetworkClient.kt:23)
at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeInternal$2.invokeSuspend(DefaultStripeNetworkClient.kt:43)
at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeInternal$2.invoke(Unknown Source:8)
at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeInternal$2.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:61)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
at com.stripe.android.core.networking.DefaultStripeNetworkClient.executeInternal$stripe_core_release(DefaultStripeNetworkClient.kt:42)
at com.stripe.android.core.networking.DefaultStripeNetworkClient.executeRequest(DefaultStripeNetworkClient.kt:23)
at com.stripe.android.networking.StripeApiRepository.makeApiRequest$payments_core_release(StripeApiRepository.kt:1547)
at com.stripe.android.networking.StripeApiRepository.fetchStripeModelResult-BWLJW6A(StripeApiRepository.kt:1525)
at com.stripe.android.networking.StripeApiRepository.retrieveElementsSession-BWLJW6A(StripeApiRepository.kt:1465)
at com.stripe.android.networking.StripeApiRepository.retrieveElementsSession-0E7RQCE(StripeApiRepository.kt:1385)
at com.stripe.android.paymentsheet.repositories.RealElementsSessionRepository.get-yxL6bBk(ElementsSessionRepository.kt:58)
StrictMode D
at com.stripe.android.customersheet.DefaultCustomerSheetLoader.retrieveElementsSession-gIAlu-s(CustomerSheetLoader.kt:121) (Ask Gemini)
at com.stripe.android.customersheet.DefaultCustomerSheetLoader.load-gIAlu-s(CustomerSheetLoader.kt:72)
at com.stripe.android.customersheet.CustomerSheetViewModel$loadCustomerSheetState$result$1.invokeSuspend(CustomerSheetViewModel.kt:234)
at com.stripe.android.customersheet.CustomerSheetViewModel$loadCustomerSheetState$result$1.invoke(Unknown Source:8)
at com.stripe.android.customersheet.CustomerSheetViewModel$loadCustomerSheetState$result$1.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:61)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
at com.stripe.android.customersheet.CustomerSheetViewModel.loadCustomerSheetState(CustomerSheetViewModel.kt:233)
at com.stripe.android.customersheet.CustomerSheetViewModel.access$loadCustomerSheetState(CustomerSheetViewModel.kt:75)
at com.stripe.android.customersheet.CustomerSheetViewModel$1.invokeSuspend(CustomerSheetViewModel.kt:157)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
The text was updated successfully, but these errors were encountered:
Summary
When enable StrictMode Stripe SDK internally is Violating Network operations on Main Thread
Code to reproduce
Wrapping the
CustomerAdapter
and providesephemeral key
,customer id
, andclient secret
after initialize withPaymentConfiguration.init(context, publishableKey)
Android version
All
Impacted devices
Emulator with SDK 33
Installation method
via Gradle dependency
Dependency Versions
kotlin: 1.9.22
stripe-android: "20.48.5"
Android Gradle Plugin: 8.3.0
Gradle: Gradle 8.4
SDK classes
Other information
Logcat attached:
The text was updated successfully, but these errors were encountered: