Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android support below Android 8 #1281

Open
jnischler opened this issue Apr 26, 2024 · 7 comments
Open

Android support below Android 8 #1281

jnischler opened this issue Apr 26, 2024 · 7 comments
Labels
Bug report Indicates that issue has been marked as a possible bug by its creator

Comments

@jnischler
Copy link

Hey,

we are using your library in one of our payment applications.
As we need local communication with your terminals, we need to use this library or at least the models locally.

In the past you made several changes preventing us from using newer versions of your library, as the used functions are not available on android.

So far, we identified at least two problems.
The Jackson version is too high.
See issue: FasterXML/jackson-databind#3658
2.14+ is no longer supported by Android Versions below 8.
We tried the library with an older Jackson version, and everything works just fine.
See: https://github.com/FasterXML/jackson-databind?tab=readme-ov-file#compatibility

As we have a lot of payment devices with android 7 we need to use at max Jackson 2.13.X.

Using gradle “resolutionStrategy.force” we can force the Jackson version to an older version.

We also identified another problem caused by the base64 functions used.

A wile ago you replaced the apache base64 library with java.utils.Base64.
891748f
java.utils.Base64 is only available from API Level 26+ (Android 8)

I fully understand that using older Version of a library might not be that modern but it also breaks support for older devices. Especially payment devices trend to not feature the latest android versions and therefore a lot of devices are still using Android 7 or even Android 5.

Just have a look at your own devices https://docs.adyen.com/point-of-sale/android-terminals/.

What is the recommended way to go?

Thanks and best regards
Julian

@jillingk
Copy link
Contributor

Hi @jnischler,

Thanks for reaching out to us with this issue. We were not aware of these version issues with Android, but I fully agree with you that it would make sense to be compatible with our own devices and their respective android versions. I created an internal ticket to review our dependencies and see whether we are able to downgrade some of them. We will keep you posted!

Best, Jilling
Adyen

@jnischler
Copy link
Author

Hi @jillingk.

Thanks for the update,
In the prerequisites you also mention Java 11.
https://github.com/Adyen/adyen-java-api-library?tab=readme-ov-file#prerequisites

Android does support Java 11 features through desugaring but only a subset:
https://developer.android.com/studio/write/java11-default-support-table

As of now we only noticed the 2 already mentioned problems.

As an alternative to Jackson you could have a look at google gson:
https://github.com/google/gson

Or if you would like to boost performance then you could consider dsl-json:
https://github.com/ngs-doo/dsl-json

Another idea would be to consider creating a plain Kotlin library.
With Kotlin "kotlinx.serialization".

If we can help in any way, feel free to reach out.

Regards
Julian

@jillingk
Copy link
Contributor

jillingk commented May 3, 2024

Hi @jnischler,

Actually even though we mention java 11 on the readme, technically the library is still compatible with java 8 so that you don't have that to worry about!

As for the serialization library, we actually specifically migrated away from GSON to Jackson as this was in our opinion the industry standard (by a small margin). What I would like to do however is see if I can downgrade our jackson dependencies so we're compatible with older android versions. We will try to pick this up asap.

Kotlin library we've been thinking about for a while now. I will poke around and see if this is something we can build, however don't hold any hope as we might have other priorities for now :)

I'll come back to you once I've managed to downgrade above mentioned dependencies!

Best, Jilling
Adyen

@jnischler
Copy link
Author

Hi Jilling,

Of course I understand just wanted to give you some hints :)

We did test the library with an older Version of Jackson and everything worked for us.
But we didn't to a lot of testing.
We are using: 2.13.5

Regards
Julian

@runemart
Copy link

runemart commented May 24, 2024

Struggeling with the same issue.

Managed to bypass the Jackson issue by excluding Jackson dependency from adyen-java-api lib, and including a version lower than 2.14 in app build file.

However, the missing java.util.Base64 is still unsolved.

Hoping for a fix soon.

Edit: using Adyen S1E devices, running Android 7.

@jnischler
Copy link
Author

Struggeling with the same issue.

Managed to bypass the Jackson issue by excluding Jackson dependency from adyen-java-api lib, and including a version lower than 2.14 in app build file.

However, the missing java.util.Base64 is still unsolved.

Hoping for a fix soon.

Edit: using Adyen S1E devices, running Android 7.

to force gradle to always use a specific version of jackson we use this snipet:

resolutionStrategy.force(
		// jackson version 2.14+ Android SDK 26+ as we need to target lower SDK versions
		// we need to prevent libs to increase the jackson version
		// for example adyen did increase the jackson version and this caused a failure on some devices
		// see https://github.com/FasterXML/jackson-databind?tab=readme-ov-file#jdk
		"com.fasterxml.jackson.core:jackson-core:$jacksonVersion",
		"com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion",
		"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
		"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion",
		"com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion"
	)

@DjoykeAbyah DjoykeAbyah changed the title Android support below Android 8 ECP-9233: Android support below Android 8 Jun 6, 2024
@DjoykeAbyah DjoykeAbyah added the Bug report Indicates that issue has been marked as a possible bug by its creator label Jun 6, 2024
@DjoykeAbyah DjoykeAbyah changed the title ECP-9233: Android support below Android 8 Android support below Android 8 Jun 7, 2024
@jnischler
Copy link
Author

Hey @DjoykeAbyah , @jillingk.

Sorry for bother you again.
But we would really need to know if you are working on a fix for this issue or if we need to find a workaround on our side.

Thanks, you very much.
Beste regards
Julian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Indicates that issue has been marked as a possible bug by its creator
Projects
None yet
Development

No branches or pull requests

4 participants