-
Notifications
You must be signed in to change notification settings - Fork 47
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
TCStringDecoder base64 encoding failed on android api level <=25 #140
Comments
Any update on this issue? |
Ideally, we would vendorize the Base64 class and include it in the project. Are you familiar with any other android issues? |
I am not familiar with 'vendorize the Base64 class and include it' Can you please share an example? |
it means to include the code in the project so both android and non-android platforms can be supported. we essentially remove the dependency from the standard library. however, this approach only makes sense if all android dependencies are identified. if this is not possible other tactics would be required like creating two builds, one for each platform. |
So you want us to include the lib code in the project replacing the Base64 import. Replacing the library reference. |
correct, but again, all dependencies must be identified since some may be more feasible to include than others. in the event that a dependency cannot be easily included, this approach would not be successful. |
If java.util.Base64 is the only one issue, then the reflection would make a workaround for Android. Just try and fallback with the android.util.Base64 instead in a helper class and use it for all cases. |
@laktech I downloaded your project, converted it to an Android Studio project and executed all unit tests as instrumentation tests on an Android device. Currently, there are 2 hidden dependencies that result in crashes at runtime, on versions older than API 26:
I replaced java.util.Base64 with android.util.Base64 equivalent methods, and all your unit tests complete successfully. |
Version
2.0.10
Module (core, cmpapi, cli, stub, or testing)
iabtcf-decoder
Error
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/util/Base64; at com.iabtcf.decoder.TCStringDecoder.vectorFromString(TCStringDecoder.java:37) at com.iabtcf.decoder.TCStringDecoder.decode(TCStringDecoder.java:57) at com.iabtcf.decoder.TCString.decode(TCString.java:43)
Describe with reproduction steps – What is the expected behavior?
TCString decoding failed with an exception.
On andorid api level 25 and below,
java.util.Base64
is not available. it should be replaced withandroid.util.Base64
see: https://stackoverflow.com/questions/48697766/android-studio-noclassdeffounderror-with-java-util-base64
is it possible to support an android/kotlin lib on maven as well?
The text was updated successfully, but these errors were encountered: