Previously, R8 would fail if it went over the dex limit on an L+ target (like
Monochrome). However, since R8 reduced the methods pretty dramatically, it
wasn't being seen.

Bug: 908988
Change-Id: Ic393d217f8f5f493db505136e3f4c0374d98c44a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594203
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Eric Stevenson <estevenson@chromium.org>
Auto-Submit: Sam Maier <smaier@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#658236}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4f9191eafb7ad8c0b55310d2e2a6be2736291c36
This commit is contained in:
Sam Maier 2019-05-09 20:03:24 +00:00 коммит произвёл Commit Bot
Родитель 7e01dbc7c7
Коммит f3d4cc59a0
2 изменённых файлов: 20 добавлений и 3 удалений

Просмотреть файл

@ -0,0 +1,15 @@
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Proguard flags to pass to R8 which do nothing, and thus allows R8 to
# arbitrarily assign code to different dex files. If we pass a flags file with
# no rules, R8 applies default main dex rules which usually include too much
# and pushes us over the main dex limit. We can't pass higher --min-api since we
# also want to allow multidex in libraries, which are compiled with a low
# min-api. Thus, we have rules which won't do anything to pass as a
# main-dex-rule.
-keep class this.should.not.match.anything {
*;
}

Просмотреть файл

@ -1300,9 +1300,11 @@ if (enable_java_templates) {
]
inputs += [ _main_dex_rules ]
} else {
if (defined(invoker.extra_main_dex_proguard_config)) {
not_needed(invoker, [ "extra_main_dex_proguard_config" ])
}
args += [
"--main-dex-rules-path",
rebase_path("//build/android/arbitrary_main_dex.flags",
root_build_dir),
]
}
}