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

Use r8 for dexing and backporting (MOE 1.x) #11

Open
wants to merge 1 commit into
base: moe-master
Choose a base branch
from

Conversation

Berstanio
Copy link
Contributor

@Berstanio Berstanio commented Apr 6, 2022

I reordered r8 task and validator task so that the validator runs first.
For the moment I didn't changes variable/task names, because it was just a POC. I will do this later.
This currently uses d8, to try to use r8 just replace here and in the sdk publisher all occurence of "d8.jar" with "r8.jar" and adjust line 266 in Proguard.java to use the proguard config. In the moe-core the proguard configs needs to be adjusted that 1. "-ignorewarn" isn't used and 2. "-keepcompanionclasses" needs to be removed.
But r8 will currently fail with a NPE. It seems to be because of the processing of the moe-core.jar, but I don't know why nor have I found some way yet to print debug infos.

Related pr's are: multi-os-engine/moe-sdk-publisher#4, multi-os-engine/moe-tools-classvalidator#2, multi-os-engine/moe-core#4, multi-os-engine/moe-tools_master#3 and multi-os-engine/manifest#2
This fixes multi-os-engine/multi-os-engine#171

@Berstanio
Copy link
Contributor Author

Berstanio commented Apr 7, 2022

r8 fails when the resolve of the super class of "java.lang.Object" returns null. Adding three simple null checks to r8 solves the issue.
https://github.com/Berstanio/r8/commits/main
Currently r8 strips to much, but this should be fixable.
However when I disable shrinking, the App just doesn't start correctly.
//EDIT: Okay, for some reason "-dontoptimize" and "-dontshrink" still strips attributes. Now that I have fixed it, a test app runs fine!

@Berstanio Berstanio changed the title POC use d8 for dexing and backporting Use r8 for dexing and backporting (MOE 1.x) May 23, 2022
@Berstanio Berstanio changed the base branch from moe-1.9.1 to moe-master July 21, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants