bundletool icon indicating copy to clipboard operation
bundletool copied to clipboard

Baseline Profile missing when using JAR from Google Maven Repo

Open maxirosson opened this issue 2 years ago • 1 comments

Describe the bug If I use the bundletool-all-1.11.1.jar (downloaded from the Github releases page), and run it with the build-apks parameter, the /assets/dexopt/baseline.prof file is properly added to the generated base-master.apk file. But if I implement an app that uses the JAR downloaded from the Google Maven Repo and invoke the same build-apks with the same parameters, the /assets/dexopt/baseline.prof file is not added the to generated base-master.apk file.

Bundletool version(s) affected Version: 1.11.1

To Reproduce

Create an app with this Main class.

object Main {
    @JvmStatic
    fun main(args: Array<String>) {
        val myArgs = listOf("build-apks",
            "--bundle=/PATH/TO/app-release.aab",
            "--output=/PATH/TO/output",
            "--output-format=DIRECTORY",
            "--mode=default",
            "--aapt2=/PATH/TO/android-sdk/build-tools/33.0.0/aapt2"
        )

        // This is NOT generating the /assets/dexopt/baseline.prof file on base-master.apk
        BundleToolMain.main(myArgs.toTypedArray())

        // But if I run bundletool-all-1.11.1.jar by command line, it is working fine:
        //java -jar ./bundletool-all-1.11.1.jar build-apks --bundle=/PATH/TO/app-release.aab --output=/PATH/TO/output --output-format="DIRECTORY" --mode="default" --aapt2=/PATH/TO/android-sdk/build-tools/33.0.0/aapt2

    }
}

Run it, and you will see that the /assets/dexopt/baseline.prof file is not added the to generated base-master.apk file.

Expected behavior The /assets/dexopt/baseline.prof file should be present on the base-master.apk file.

Environment: OS: MacOS

maxirosson avatar Sep 06 '22 14:09 maxirosson

This is also happening on v1.11.2

maxirosson avatar Sep 07 '22 19:09 maxirosson

Could you provide a project to reproduce this along with AAB file?

ymakhno avatar Nov 02 '22 15:11 ymakhno

Not enough info to action on this issue.

ymakhno avatar Nov 08 '22 17:11 ymakhno