I'm currently using byte-buddy, byte-buddy-android and Android's dx_1.7 library. The dx_1.7.jar is out of date (2012) and I wonder if someone has already built a new byte-buddy-android.jar that works with a current dx.jar (not dx_1.7.jar) provided by a more current Android SDK. How would I achieve something like this?
Asked
Active
Viewed 222 times
0
-
What have you tried so far? Where are you actually stuck? What's the actual problem? – Shark Feb 03 '16 at 13:52
-
I have tried to rebuild byte-buddy-android with the new dx and it failed because of static method translate() not found. I saw that the translate method between the 2 dx versions are taking in different parameters. I thought of modifying the AndroidClassLoadingStrategy.java with the new register method but not sure how to get the DirectClassFile and DexFile parameters. – Key Feb 03 '16 at 14:54
-
I will try to get the DirectClassFile from the String file name and the DexFile from the DexOption. I'm new to byte-buddy, if you have any suggestions, please advice me. – Key Feb 03 '16 at 15:05
-
A `DirectClassFile` instance can be created by instantiating it, the file path needs to be set to some dummy value and strict parse can be any value. A `DexFile` instance can be created by passing the `DexOption` instance to it. – Rafael Winterhalter Feb 24 '16 at 12:59
1 Answers
2
The reason for the outdated dependency is that Google does not distribute newer versions of their compiler via Maven Central or any other central repository. Therefore, it is outdated.
However, this should not cause any trouble as the dex compilation should be able to process any Java code even if it depends on newer Android APIs. If you, for some reason, require to use a newer version of the DX compiler, you need to recompile the module using the newer DX compiler API.

Rafael Winterhalter
- 42,759
- 13
- 108
- 192