I know this might seems a duplication of "how to have multiple application classes in separated jars in one application in android" but I'm experiencing this problem with AAR files and I don't know how to get a solution.
The scenario is as follows:
I have an ECR application that should be able to integrate with different payment devices. Each manufacturer has its own SDK in compiled AAR files. Each AAR file comes with an application class.
So, when I join them in my project I get a manifest merger error because each manifest's AAR comes with an "android:name" under the application tag for their application classes. So, I have to use "tools:replace" to avoid such conflict. Now, the problem is: How to load these classes?
In the post I mentioned the solution was to create a chain of extends. So let's say I have manufacturers X, Y and Z and I create my own application class A. So X would extend Y; Y would extend Z, Z would extend A and finally A extends Application.
However, I just can't change the code from these AAR files! They are already compiled from the manufacturer.
Is there any way to work around this and make sure all application classes could be loaded? Maybe by using a class loader os something?
Thank you in advance. Carlos Santos