Adyen / adyen-android

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

Getting Theme conflict issue #515

Closed Abhi12Rathore closed 2 years ago

Abhi12Rathore commented 2 years ago

We are using Adyen Android drop-in dependency in one of our clients, but while using it we are getting theme conflicting issues. We are using a material component theme in our project, please find attached the image for the issue.

Please fix this issue and provide us the updated SDK so we can proceed or provide us the normal SDK so we can fix the theme issue and use it in our project. 137435002-403e8278-c70e-4410-b2c0-e368771b04d0

jreij commented 2 years ago

hi @Abhi12Rathore , thanks for opening this! What theme is your app using? And are you using AndroidX?

Abhi12Rathore commented 2 years ago

hi @jreij I am using the MaterialDesign Component theme in our application. Yes we are using AndroidX

jreij commented 2 years ago

Hi, thanks for your reply. I will need a bit more information to investigate this:

Abhi12Rathore commented 2 years ago
  1. We are using the following theme in our project

Theme.MaterialComponents.DayNight.DarkActionBar

  1. No we are not overriding AdyenCheckout.TextInputLayout anywhere in our styles file

  2. Issue causing card view is defined in the Adyen module

jreij commented 2 years ago

Thanks for the info. Which version of drop-in are you using? And can you reproduce this every time or is there certain devices/ scenarios that cause the issue?

Abhi12Rathore commented 2 years ago

@jreij Thanks for reaching out again, we are using the mentioned version

com.adyen.checkout:drop-in:4.1.1

And this issue arise every time

jreij commented 2 years ago

I'm afraid I cannot figure out much without the full stack trace. Can you try to share the whole stack trace, especially the root cause of it?

Abhi12Rathore commented 2 years ago

@jreij Please find the whole stack trace of issue

2021-11-08 19:14:31.882 25704-25704/com.autoservice.android E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.autoservice.android, PID: 25704
    android.view.InflateException: Binary XML file line #67 in com.autoservice.android:layout/fragment_card_component: Binary XML file line #67 in com.autoservice.android:layout/fragment_card_component: Error inflating class com.adyen.checkout.card.CardView
    Caused by: android.view.InflateException: Binary XML file line #67 in com.autoservice.android:layout/fragment_card_component: Error inflating class com.adyen.checkout.card.CardView
    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.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
        at com.adyen.checkout.dropin.databinding.FragmentCardComponentBinding.inflate(FragmentCardComponentBinding.java:65)
        at com.adyen.checkout.dropin.ui.component.CardComponentDialogFragment.onCreateView(CardComponentDialogFragment.kt:43)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
        at androidx.fragment.app.DialogFragment.performCreateView(DialogFragment.java:489)
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
        at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
        at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
        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:8587)
        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: android.view.InflateException: Binary XML file line #25 in com.autoservice.android:layout/card_view: Binary XML file line #25 in com.autoservice.android:layout/card_view: Error inflating class com.google.android.material.textfield.TextInputLayout
     Caused by: android.view.InflateException: Binary XML file line #25 in com.autoservice.android:layout/card_view: Error inflating class com.google.android.material.textfield.TextInputLayout
     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)
2021-11-08 19:14:31.885 25704-25704/com.autoservice.android E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
        at com.adyen.checkout.card.databinding.CardViewBinding.inflate(CardViewBinding.java:131)
        at com.adyen.checkout.card.CardView.<init>(CardView.kt:44)
        at com.adyen.checkout.card.CardView.<init>(CardView.kt:40)
        at com.adyen.checkout.card.CardView.<init>(Unknown Source:11)
        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.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
        at com.adyen.checkout.dropin.databinding.FragmentCardComponentBinding.inflate(FragmentCardComponentBinding.java:65)
        at com.adyen.checkout.dropin.ui.component.CardComponentDialogFragment.onCreateView(CardComponentDialogFragment.kt:43)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
        at androidx.fragment.app.DialogFragment.performCreateView(DialogFragment.java:489)
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
        at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
        at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
        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:8587)
        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.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
        at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
        at com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:217)
        at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:145)
        at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:469)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:428)
            ... 45 more
2021-11-08 19:14:31.912 25704-25704/com.autoservice.android E/UncaughtException: android.view.InflateException: Binary XML file line #67 in com.autoservice.android:layout/fragment_card_component: Binary XML file line #67 in com.autoservice.android:layout/fragment_card_component: Error inflating class com.adyen.checkout.card.CardView
    Caused by: android.view.InflateException: Binary XML file line #67 in com.autoservice.android:layout/fragment_card_component: Error inflating class com.adyen.checkout.card.CardView
    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.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
        at com.adyen.checkout.dropin.databinding.FragmentCardComponentBinding.inflate(FragmentCardComponentBinding.java:65)
        at com.adyen.checkout.dropin.ui.component.CardComponentDialogFragment.onCreateView(CardComponentDialogFragment.kt:43)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
        at androidx.fragment.app.DialogFragment.performCreateView(DialogFragment.java:489)
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
        at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
        at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
        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:8587)
        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: android.view.InflateException: Binary XML file line #25 in com.autoservice.android:layout/card_view: Binary XML file line #25 in com.autoservice.android:layout/card_view: Error inflating class com.google.android.material.textfield.TextInputLayout
     Caused by: android.view.InflateException: Binary XML file line #25 in com.autoservice.android:layout/card_view: Error inflating class com.google.android.material.textfield.TextInputLayout
     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)
2021-11-08 19:14:31.913 25704-25704/com.autoservice.android E/UncaughtException:     at com.adyen.checkout.card.databinding.CardViewBinding.inflate(CardViewBinding.java:131)
        at com.adyen.checkout.card.CardView.<init>(CardView.kt:44)
        at com.adyen.checkout.card.CardView.<init>(CardView.kt:40)
        at com.adyen.checkout.card.CardView.<init>(Unknown Source:11)
        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.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
        at com.adyen.checkout.dropin.databinding.FragmentCardComponentBinding.inflate(FragmentCardComponentBinding.java:65)
        at com.adyen.checkout.dropin.ui.component.CardComponentDialogFragment.onCreateView(CardComponentDialogFragment.kt:43)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
        at androidx.fragment.app.DialogFragment.performCreateView(DialogFragment.java:489)
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
        at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
        at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
        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:8587)
        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.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
        at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
        at com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:217)
        at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:145)
        at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:469)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:428)
            ... 45 more
2021-11-08 19:14:31.991 25704-25888/com.autoservice.android V/FA: Recording user engagement, ms: 1422
2021-11-08 19:14:32.215 25704-25858/com.autoservice.android E/FirebaseCrash: Failed to report uncaught exception
    java.lang.SecurityException: getDataNetworkTypeForSubscriber: uid 10802 does not have android.permission.READ_PHONE_STATE.
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2385)
        at android.os.Parcel.createException(Parcel.java:2369)
        at android.os.Parcel.readException(Parcel.java:2352)
        at android.os.Parcel.readException(Parcel.java:2294)
        at com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(ITelephony.java:8762)
        at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3706)
        at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3670)
        at apw.a(:com.google.android.gms.dynamite_dynamitemodulesc@213917093@21.39.17 (150300-0):120)
        at com.google.firebase.crash.internal.api.FirebaseCrashApiImpl.b(:com.google.android.gms.dynamite_dynamitemodulesc@213917093@21.39.17 (150300-0):2)
        at com.google.firebase.crash.internal.api.FirebaseCrashApiImpl.reportUncaughtException(:com.google.android.gms.dynamite_dynamitemodulesc@213917093@21.39.17 (150300-0):2)
        at apj.a(:com.google.android.gms.dynamite_dynamitemodulesc@213917093@21.39.17 (150300-0):10)
        at mf.onTransact(:com.google.android.gms.dynamite_dynamitemodulesc@213917093@21.39.17 (150300-0):4)
        at android.os.Binder.transact(Binder.java:1079)
        at com.google.android.gms.internal.crash.zza.transactAndReadExceptionReturnVoid(Unknown Source:20)
        at com.google.android.gms.internal.crash.zzn.zzb(Unknown Source:18)
        at com.google.android.gms.internal.crash.zzg.zzd(Unknown Source:13)
        at com.google.android.gms.internal.crash.zzc.run(Unknown Source:12)
        at com.google.android.gms.internal.crash.zzg.run(Unknown Source:15)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
jreij commented 2 years ago

Hi again, thanks for the stack trace. Although you mentioned that your app them inherits from Theme.MaterialComponents.DayNight.DarkActionBar, I can see this root cause in the logs which is weird:

Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).

What version of the material library are you using? And do you still use AppCompat anywhere?

Abhi12Rathore commented 2 years ago

@jreij We are using the following version of the Material design

com.google.android.material:material:1.4.0

no we are not using the AppCompat anywhere in the application

jreij commented 2 years ago

Hmmm we are also using 1.4.0 in drop-in 4.1.1 🤔

I will investigate this more. Meanwhile can you check your themes and styles again, in case you can find anything weird happening? I think there might be some theming conflict issue because with the theme and material version you are using, there really shouldn't be any problems.

Abhi12Rathore commented 2 years ago

@jreij As I have checked in the drop-in module you are using the App component button or theme instead of the Material design, this might be causing the issue. Please check it once.

jreij commented 2 years ago

According to the logs, the error is occurring when inflating a TextInputLayout: layout/card_view: Error inflating class com.google.android.material.textfield.TextInputLayout

The style we use for that layout is causing the conflict it seems, but it shouldn't according to your app theme:

    <style name="AdyenCheckout.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
        <item name="boxStrokeColor">@color/primaryColor</item>
        <item name="hintTextColor">@color/primaryColor</item>
        <item name="android:minHeight">@dimen/input_layout_height</item>
    </style>

We don't have a button inside card_view anyway. Can you link the style/theme that you suspected?

Abhi12Rathore commented 2 years ago

@jreij Please check this link

https://github.com/Adyen/adyen-android/blob/develop/drop-in/src/main/res/layout/fragment_card_component.xml

jreij commented 2 years ago

Yes this is the class where the crash is happening, but the issue is in the CardView not the button. As the stack trace indicates:

android.view.InflateException: Binary XML file line #67 in com.autoservice.android:layout/fragment_card_component:
Binary XML file line #67 in com.autoservice.android:layout/fragment_card_component:
Error inflating class com.adyen.checkout.card.CardView
...
layout/card_view: Error inflating class com.google.android.material.textfield.TextInputLayout
Abhi12Rathore commented 2 years ago

@jreij Okay, Please help us to figure out the solution to this so we can deliver the application to our client

jreij commented 2 years ago

Does switching your theme to Theme.MaterialComponents.DayNight.DarkActionBar.Bridge change anything?

Abhi12Rathore commented 2 years ago

@jreij I have checked by switching the theme to DarkActionbar.Bridge but it is giving the same error

jreij commented 2 years ago

Can you try to put this is a new activity or fragment in your app and see if you get the crash or if the text field renders normally?

        <com.google.android.material.textfield.TextInputLayout
            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
        </com.google.android.material.textfield.TextInputLayout>
Abhi12Rathore commented 2 years ago

@jreij This is working fine, but still getting the crash error in the application.

Abhi12Rathore commented 2 years ago

@jreij ANy update regarding the crash issue?

caiofaustino commented 2 years ago

Hi @Abhi12Rathore, can you share the part of the Manifest of your app with that activity?

Abhi12Rathore commented 2 years ago

@caiofaustino We are using the SDK view not customized view in our application. The crash is happening due to theme conflict.

caiofaustino commented 2 years ago

Yes but as the error states the theme of your app is expected to be Material, and the Manifest from the SDK gets merged with the Manifest of your app at the end when you build it.

You can see the resulting merged Manifest if you unzip the final APK when you build it.

Abhi12Rathore commented 2 years ago

@caiofaustino We are also using the material theme in our application, can you help us to figure out the proper solution, so we can deliver the application to the client

jreij commented 2 years ago

@Abhi12Rathore you are on version 4.1.1, is that correct? Does the issue persist if you update to 4.2.0 or 4.3.0?

Abhi12Rathore commented 2 years ago

@jreij We have tried to use the updated dependency (4.3.0 & 4.2.0), but still getting the same issue. Please help us to figure out the proper solution, so we can deliver the application to the client

caiofaustino commented 2 years ago

We can't help you without more information to debug. If you prefer, you can contact Adyen Support and share more details there in private so we can try to help.

Abhi12Rathore commented 2 years ago

@caiofaustino Please us know what information you need to debug the issue, so we can share it with you.

caiofaustino commented 2 years ago

Your manifest file, or better yet, the final merged manifest of your app would be nice.

Abhi12Rathore commented 2 years ago

@caiofaustino Please find the manifest file details

Manifest File

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.webkul.mobikul_cs_cart">

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />

    <application
        android:name=".analytics.MobikulApplication"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:requestLegacyExternalStorage="true"
        android:supportsRtl="true"
        android:theme="@style/AppTheme1"
        android:usesCleartextTraffic="true"
        tools:replace="android:icon, android:allowBackup">
        <activity android:name=".activity.SubcategoryActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar"
            android:windowSoftInputMode="adjustResize"
            />

        <uses-library
            android:name="org.apache.http.legacy"
            android:required="false" />

        <receiver
            android:name=".receiver.InternetConnector_Receiver"
            android:enabled="true">
            <intent-filter>

                <!-- Intent filters for broadcast receiver -->
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
                <action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
                <action android:name="android.net.wifi.STATE_CHANGE" />
            </intent-filter>
        </receiver>

        <meta-data
            android:name="android.app.default_searchable"
            android:value="com.webkul.mobikul_cs_cart.CategoryActivity" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/ic_notification" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/colorAccent" />
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="GOOGLE_API_KEY" /> <!-- Required after latest Google Play Services update -->
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <receiver android:name=".receiver.AlarmReceiver" />

        <service
            android:name=".Services.AbandonedCartService"
            android:exported="false"
            android:permission="android.permission.BIND_JOB_SERVICE" />
        <service
            android:name=".gcm.MyFcmListenerService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service> <!-- <service -->
        <!-- android:name=".gcm.MyInstanceIDListenerService" -->
        <!-- android:exported="false"> -->
        <!-- <intent-filter> -->
        <!-- <action android:name="com.google.firebase.INSTANCE_ID_EVENT" /> -->
        <!-- </intent-filter> -->
        <!-- </service> -->
        <activity
            android:name=".activity.SplashScreen"
            android:label="@string/app_name"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activity.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="testcscart.webkul.com"
                    android:pathPrefix="/cscartcustomisation/mobikul_mve"
                    android:scheme="https" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activity.ActivityGetHelp"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name=".activity.Subcategory"
            android:label="@string/title_activity_sub_category"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".mlkit.activities.CameraSearchActivity"
            android:label="@string/title_activity_sub_category"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activity.SearchActivity"
            android:label="@string/title_activity_sub_category"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.ViewProductSimple1"
            android:label="@string/title_activity_product"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.Cart"
            android:label="@string/title_activity_Cart"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.LoginSignupActivity"
            android:label="@string/title_activity_Cart"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.CategoryActivity"
            android:label="@string/title_activity_category"
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />
        </activity>
        <activity
            android:name=".activity.ViewPagerExampleActivity"
            android:label="ViewPagerExampleActivity"
            android:noHistory="true"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.Sorter"
            android:label="@string/sort"
            android:noHistory="true"
            android:screenOrientation="unspecified"
            android:theme="@style/Transparent" />
        <activity
            android:name=".activity.FilterNavigation"
            android:label="@string/filter_heading"
            android:noHistory="true"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.Checkout"
            android:label="@string/checkout"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.NotificationActivity"
            android:label="@string/title_activity_Notification"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.CustomerActivity"
            android:label="@string/my_account"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity android:name=".activity.PaymentWebViewActivity" />
        <activity
            android:name=".activity.AllReviews"
            android:label="@string/title_activity_all_reviews"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.ShipmentActivity"
            android:label="Shipment"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity android:name=".activity.ViewAllProducts" />
        <activity
            android:name=".activity.BrandsActivity"
            android:label="@string/our_brands"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.CustomerDashbordActivity"
            android:label="@string/my_account"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.NewLoginActivity"
            android:label="@string/login_action_title"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.WalletActivity"
            android:label="@string/my_wallet_title"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.PageActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />
        <activity
            android:name=".activity.TrackOrder"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme1.NoActionBar" />

        <service android:name=".Services.GetHomepageDataService" />
    </application>

</manifest>
caiofaustino commented 2 years ago

Hi, sorry for the delay. Can you please try to define this style in your project and see if it makes any difference? <style name="AdyenCheckout" parent="AppTheme1" />

Abhi12Rathore commented 2 years ago

@caiofaustino Okay, we will check and update you

abhirth75 commented 2 years ago

@caiofaustino @jreij Theme issue has been fixed, but now getting another crash regarding the payment response from the SDK after entering the card details

com.adyen.checkout.core.exception.CheckoutException: Action type not found at com.adyen.checkout.components.model.payments.response.Action$1.deserialize(Action.java:52) at com.adyen.checkout.components.model.payments.response.Action$1.deserialize(Action.java:33) at com.adyen.checkout.dropin.service.DropInServiceResult$Action.(DropInServiceResult.kt:60) at com.webkul.mobikul_cs_cart.Services.PaymentService.makePaymentsCall(PaymentService.kt:113) at com.adyen.checkout.dropin.service.DropInService$onPaymentsCallRequested$1.invokeSuspend(DropInService.kt:135)

abhirth75 commented 2 years ago

@caiofaustino @jreij Please check this issue and try to update ASAP

jreij commented 2 years ago

@Abhi12Rathore good to know the theme issue was solved, could you share what was the solution?

As for the other error, make sure you are passing the action json only inside DropInServiceResult.Action and not the whole response, it should look something like this:

{
    "type": "...",
    "paymentData": "...",
    "paymentMethodType": "...",
    "OTHER_KEYS": "..."
}
abhirth75 commented 2 years ago

@jreij

For the theme issue, following line of code works

<style name="AdyenCheckout" parent="AppTheme1" />

I am not getting these JSON values on the response, Response that I have received is as follows

{
  "amount": {
    "currency": "EUR",
    "value": 69
  },
  "reference": "8885",
 "paymentMethod": {
    "type": "scheme",
    "encryptedCardNumber": "adyenan0_1_1$gbkWqLOzl0CNHvgaJxzAqC5teddFwt3zTFDnVDTFOTEJEDSaovEk1uEG2B4bAkkkja+X+XX0KL2z1KxU4fkT+VsqbIX8k16Gc3IIycUlgmbaNKmkitty5GptsSTO4ugL2Ka9DEAfYqDSxOdyfezZtkGB532uqocLo3aDciYRdzmCZaT+pdpiGXbIxOiK2Tp1yW2fohbrBzjNAtMUVp6e60+b4Ek8NIRrr3LLxdfWjTFipFe4oE+D\/PVE+SeaZ7GGzHYebtyKEGPteqTMnEmaejY\/awU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FE2zyD2\/WpkRlOse\/2nLM2TawhFVqHD5OLUAwTGBOcFRt3xgWK8oQJfprMLbOGZrw5m2YiI9Gg\/f466gal\/D0g==",
    "encryptedSecurityCode": "adyenan0_1_1$pwFMAeTYzr3igmMulJKi3ZvnbNkjETUcbJCTzosKeX7uVh3+gXWFKIV43l0qyiUZYs430UrVK8OcPo7nJhcK7WTGKOVv3l6a1xJzzakD7kKJFbmDzIeCCLUVArakmAH1c4NNH9G+w45Tmsfrcy+GD7WbtWiK9nrhbc\/yucFA\/+GJXpZLp529wZh3AqBiZgMYOtLZpnQAWl2sbGVw8g9V8X34Y5maks1ZzwlXFI+SYKlkoI5Sfthh2+YGjr1funi4RpNAbUtb7xI1Gl+KjGOMBsRTXp6DEbfPKB\/5KQniR2Gv+zDW8wZ\/seOnYJiE8meIqvhERImUN+EEKqahpoo58g==$qBP9jVi+NySYvQ75sVbTa2sn5yzQnHMwkEyg0X2AN1M6ba1j7qASQ3loK\/pr5mmUSuBdmWkVgDeDa+lnCEFvs5XCX6nOBXzF+FbPP2PX"
  },
  "returnUrl": "client URL",
  "merchantAccount": "merchant account"
}
jreij commented 2 years ago

The json you shared is not a response from Adyen's API, what I meant is the response from the /payments or /payments/details.

From the logs you shared I can see that you are returning DropInServiceResult.Action inside makePaymentsCall with a json that is not actually an Action, which is the cause of the issue. Make sure that this json is the right one.

abhirth75 commented 2 years ago

@jreij We are not getting any action key in the JSON that we have received from the Adyen SDK response, as well as from the Payment API

ADYEN SDK RESPONSE

{
  "paymentMethod": {
    "type": "scheme",
    "encryptedCardNumber": "adyenan0_1_1$ZerFhpaQ1q0vFPz+vf6bTTP6mD0nIkzpCl8Aie8+62d\/3+LroNeO3yQXEnXmyZMo3qzYP8FIF6uNfZD1yc0IhupMiSgsN1wcxykxsQ8AN9OV1v9DGBRwPceAaXIhXCUByzNBeu+s8qzMaQ7ygOMV2DKtMpH7tJ4aL38ZTKFaU4iljZjvdPYIK0C4i+nZ0b71MSTYeaOfr\/grfnk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N\/rreUbvsyJn24YDhSU17KNtJlaZx17ApI1mUNEExbjk1wfOLCF+5RQ==$81j0+td1nRuGBiuw9kOPy\/HZ5tSEcWLiNmcmpjolYBa8Jpi+ht9WWou7bIjakrMX46etLhYwfqzlHQNwyQ4KKcGlLlyqxCZzoyHIZz0aB+dglXGu1A==",
    "encryptedSecurityCode": "adyenan0_1_1$ZUJ2HXpAQvJT6lu85jt6nHBJoPQJI3wllBnA+vfPq2QUaUfP69qNM4Hspja8Ax3IxO77K8hPS9awdwgLiEaUHHiRFzQN6+t8AD2QxVly+\/SNPL0ip80akNynYlCil1ly48c5jtBlVEPlFDx5\/C6B3GUfCYm46iihmtTtZnG+\/GqPHgRZfeuRhsNfYAaBo\/IV336\/v5dkfelp+Z7NbUlBSfUm9cIssbyTw45LHSdRfneqwFysOggevUsEjqV4Na1kYKHo3AAab3d1JqMwZfsFcYaQuh0M1n1GmMQ+8axJv5vEdJFN0l6HF5CZasWC+gQ+kVcTp8jK9rdwpMbMjcQ8fA==$pBA3Sdx2OEtxwA+9T+iLHw8uJgYdFfHj\/re5txeP6avC3nFt+zWpaJ7QwSeBmML2iL\/TAT6+MD8rpXy\/R1eDncIuxxTLR5LvUDk3Tfjj",
    "threeDS2SdkVersion": "2.2.5"
  },
  "storePaymentMethod": false,
  "amount": {
    "currency": "EUR",
    "value": 69
  }
}

RESPONSE FROM PAYMENT API:

{
    "pspReference": "883641475415274K",
    "resultCode": "Authorised",
    "amount": {
        "currency": "EUR",
        "value": 69
    },
    "merchantReference": "99898"
}
jreij commented 2 years ago

Well then you shouldn't return DropInServiceResult.Action, but DropInServiceResult.Finished instead 🙂

abhirth75 commented 2 years ago

@jreij Thanks a lot for your help, I have successfully implemented the Adyen payment gateway

abhirth75 commented 2 years ago

Hello, @caiofaustino @jreij I am facing a little issue while processing Adyen payment, I am sending the amount value to SDK

{"currency":"EUR","value":72} but on the payment button of Adyen SDK page it is 0.72 Euro and processing 72 which is correct

caiofaustino commented 2 years ago

You need to meet the decimal count for each currency. https://docs.adyen.com/development-resources/currency-codes#page-introduction So for 72 EUR, you need to pass 7200.

abhirth75 commented 2 years ago

@caiofaustino Okay I will pass but can you please let me know how much amount it will process 72 Euro or 7200 Euro?

caiofaustino commented 2 years ago

It will process 72 euro, make a test on the TEST environment and you can check the transaction in your Customer Area.

abhirth75 commented 2 years ago

@caiofaustino Okay I will check this solution

janw-ttc commented 7 months ago

@caiofaustino @Abhi12Rathore @abhirth75 where to add this line <style name="AdyenCheckout" parent="AppTheme1" />

for the xml crash ?

Abhi12Rathore commented 7 months ago

@janw-ttc

You need to add this line in the styles floder inside values folder

wahdatjan commented 7 months ago

Can you add the AppTheme1 as well here what is in that

wahdatjan commented 7 months ago

@Abhi12Rathore

Process:  PID: 16735
    android.view.InflateException: Binary XML file line #67 in com.kayana.staging:layout/fragment_card_component: Binary XML file line #67 in/fragment_card_component: Error inflating class com.adyen.checkout.card.CardView
    Caused by: android.view.InflateException: Binary XML file line #67 in com.kayana.staging:layout/fragment_card_component: Error inflating class com.adyen.checkout.card.CardView

getting this crash still