Adyen / adyen-android

Adyen Android Drop-in and Components
https://docs.adyen.com/checkout/android
MIT License
119 stars 66 forks source link

[v5.3.0] InflateException - AppCompatAutoCompleteTextView #1523

Closed acouhier-luna closed 3 weeks ago

acouhier-luna commented 1 month ago

Describe the bug When I want to pay with a new credit card, I crash

To Reproduce Steps to reproduce the behavior:

  1. Click on Credit Card

Expected behavior I would like to use a new credit card

Screenshots error what I expect
Crash when clicking on Credit card image image

Smartphone (please complete the following information):

Additional context

Logcat ``` FATAL EXCEPTION: main Process: XXX, PID: 2890 android.view.InflateException: Binary XML file line #166 in XXX:layout/card_view: Binary XML file line #166 in XXX:layout/card_view: Error inflating class androidx.appcompat.widget.AppCompatAutoCompleteTextView Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@e5b11a3, Dispatchers.Main.immediate] Caused by: android.view.InflateException: Binary XML file line #166 in XXX:layout/card_view: Error inflating class androidx.appcompat.widget.AppCompatAutoCompleteTextView Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at android.view.LayoutInflater.createView(LayoutInflater.java:852) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124) at android.view.LayoutInflater.inflate(LayoutInflater.java:654) at android.view.LayoutInflater.inflate(LayoutInflater.java:532) at android.view.LayoutInflater.inflate(LayoutInflater.java:479) at com.adyen.checkout.card.databinding.CardViewBinding.inflate(CardViewBinding.java:185) at com.adyen.checkout.card.internal.ui.view.CardView.(CardView.kt:74) at com.adyen.checkout.card.internal.ui.view.CardView.(CardView.kt:62) at com.adyen.checkout.card.internal.ui.CardViewProvider.getView(CardViewProvider.kt:28) at com.adyen.checkout.ui.core.AdyenComponentView.loadView(AdyenComponentView.kt:121) at com.adyen.checkout.ui.core.AdyenComponentView.access$loadView(AdyenComponentView.kt:48) at com.adyen.checkout.ui.core.AdyenComponentView$attach$1.invokeSuspend(AdyenComponentView.kt:104) at com.adyen.checkout.ui.core.AdyenComponentView$attach$1.invoke(Unknown Source:8) at com.adyen.checkout.ui.core.AdyenComponentView$attach$1.invoke(Unknown Source:4) at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Emitters.kt:219) at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:392) at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:65) at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:371) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:21) at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:88) at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:123) at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:52) at kotlinx.coroutines.BuildersKt.launch(Unknown Source:1) at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:43) at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source:1) at kotlinx.coroutines.flow.FlowKt__CollectKt.launchIn(Collect.kt:45) at kotlinx.coroutines.flow.FlowKt.launchIn(Unknown Source:1) at com.adyen.checkout.ui.core.AdyenComponentView.attach(AdyenComponentView.kt:111) at com.adyen.checkout.dropin.internal.ui.CardComponentDialogFragment.onViewCreated(CardComponentDialogFragment.kt:52) at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3147) at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:588) 10:40:46.835 AndroidRuntime E at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272) at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1845) at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782) at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:565) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 11: TypedValue{t=0x2/d=0x1010098 a=6} at android.content.res.TypedArray.getColorStateList(TypedArray.java:597) at androidx.appcompat.widget.TintTypedArray.getColorStateList(TintTypedArray.java:185) at androidx.appcompat.widget.AppCompatTextHelper.loadFromAttributes(AppCompatTextHelper.java:315) at androidx.appcompat.widget.AppCompatAutoCompleteTextView.(AppCompatAutoCompleteTextView.java:99) at androidx.appcompat.widget.AppCompatAutoCompleteTextView.(AppCompatAutoCompleteTextView.java:79) ... 53 more ```
qmetzler-luna commented 1 month ago

Crash is in version v5.3.0 but not in v5.2.0

jreij commented 1 month ago

Hi @acouhier-luna, thanks for reaching out. It seems to me that this issue is coming from the AppCompat library.

Can you check our theming guide to see whether you have the correct setup on your side?

And since @qmetzler-luna mentioned that you see this issue with 5.3.0 but not in 5.2.0 then it could be related to a dependency update. Can you also update your dependencies and try again? You can check which dependencies we updated in the bottom of our release notes and try to update to the same versions.

markosopcic commented 1 month ago

Hey! I've got the same issue like @acouhier-luna, down to the line in the xml where it crashes. This is my first time integrating this SDK on version 5.3.0 so can't say i had it working on previous verisons.

I tried updating app dependencies to the latest values in the release notes you mentioned, but it didn't help.

Setting the style to the default works: <style name="AdyenCheckout" parent="Adyen" />

If, for example, i set the color primary in the theme to an attribute of my app theme, e.g.:

`