PaystackHQ / paystack-android

Paystack SDK for Android. Accept payments on Android
Apache License 2.0
126 stars 101 forks source link

Support Library Incompatibility Issue #117

Closed claucookie closed 3 years ago

claucookie commented 3 years ago

Problem/Motivation

I am trying to integrate Paystack library into my company project to start processing payments. In this project we are using AndroidX library because the Support library is not maintained anymore https://developer.android.com/jetpack/androidx .

I noticed Paystack relies on the Support Library and that is causing dependency conflicts with androidx dependencies, showing the following error when building the project:

Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.5.0-beta02] AndroidManifest.xml:24:18-86
    is also present at [:features:customerRegistrationPaymentDynamic] AndroidManifest.xml:24:9-82 value=(android.support.v4.app.CoreComponentFactory).

I tried the following suggestion:

Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:13:5-72:19 to override.

But it causes the following build error:

Android resource linking failed
AndroidManifest.xml:36:9-39:63: AAPT: error: resource style/Paystack.Dialog.PinEntry (aka com.mkopa.app:style/Paystack.Dialog.PinEntry) not found.

AndroidManifest.xml:40:9-43:63: AAPT: error: resource style/Paystack.Dialog.OtpEntry (aka com.mkopa.app:style/Paystack.Dialog.OtpEntry) not found.

AndroidManifest.xml:44:9-47:63: AAPT: error: resource style/Paystack.Dialog.OtpEntry (aka com.mkopa.app:style/Paystack.Dialog.OtpEntry) not found.

AndroidManifest.xml:48:9-51:64: AAPT: error: resource style/Paystack.Dialog.CardEntry (aka com.mkopa.app:style/Paystack.Dialog.CardEntry) not found.

AndroidManifest.xml:52:9-55:54: AAPT: error: resource style/Paystack.Dialog (aka com.mkopa.app:style/Paystack.Dialog) not found.

As a last resource I tried enabling Jetifier but the folliwing build error comes up:

AAPT: error: resource style/Paystack.Dialog.PinEntry not found.

Proposed resolution

Migrate to AndroidX

claucookie commented 3 years ago

Some updates on this. I copied the styles manually from this repository into my project and I don't have this error when I build the app.

However, when running Android Tests gradle task processDebugAndroidTestManifest the error still persists, failing my tests execution.

Is there any idea of how to work around it or what's the plan regarding migrating Paystack SDK to AndroidX?

blundell commented 3 years ago

Androix X migration is here:

https://github.com/PaystackHQ/library-android-pinpad/pull/6

https://github.com/PaystackHQ/paystack-android/pull/118

pinpad needs updating and releasing before the main android library.

michael-paystack commented 3 years ago

Hi @claucookie and @blundell, Sorry it's taken so long to review and push a fix for this. We'll do our best to get this out ASAP.