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

[r8] update to 1.4.93 #3121

Merged
merged 1 commit into from
May 30, 2019
Merged

[r8] update to 1.4.93 #3121

merged 1 commit into from
May 30, 2019

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented May 23, 2019

Context: https://mvnrepository.com/artifact/com.android.tools/r8/1.4.93
Context: https://r8.googlesource.com/r8/+/refs/tags/1.4.93/

Updating to the latest R8, we hit a problem...

In R8 1.4.93, they appear to have removed support for custom
multidex.keep files when minSdkVersion >= 21. R8 decides on its
own if multidex is needed, and splits up dex files appropriately.

The new error message was added here:

https://r8.googlesource.com/r8/+/0e5c4339df0207a0e38f11438db84b29f328f777%5E%21/

Since r8.jar will now abort with an error if you specify
multidex.keep files and minSdkVersion >= 21. I feel all we can do
in this case is add a new warning if developers specify
@(MultiDexMainDexList) with R8--then allow R8 to calculate multidex
on its own.

We looked a bit, and did not find much usage of the
@(MultiDexMainDexList) item group:

https://github.com/search?q=MultiDexMainDexList&type=Code

The examples of multidex.keep files we found, looked like they
shouldn't be needed anyway.

I updated the MultiDexCustomMainDexFileList test to check dx/d8 and
API 19/21. R8 appears to create multiple dex files without any
multidex rules or multidex.keep files.

@jonathanpeppers jonathanpeppers added the do-not-merge PR should not be merged. label May 23, 2019
@jonathanpeppers
Copy link
Member Author

jonathanpeppers commented May 23, 2019

Testing this one, I suspect there is a problem with multidex:

error : R8 does not support main-dex inputs and outputs when compiling to API level 21 and above

From this r8 commit.

Hopefully, some tests fail and show the same. Looking into it.

Context: https://mvnrepository.com/artifact/com.android.tools/r8/1.4.93
Context: https://r8.googlesource.com/r8/+/refs/tags/1.4.93/

Updating to the latest R8, we hit a problem...

In R8 1.4.93, they appear to have removed support for custom
`multidex.keep` files when `minSdkVersion` >= 21. R8 decides on its
own if multidex is needed, and splits up dex files appropriately.

The new error message was added here:

https://r8.googlesource.com/r8/+/0e5c4339df0207a0e38f11438db84b29f328f777%5E%21/

Since `r8.jar` will now abort with an error if you specify
`multidex.keep` files and `minSdkVersion` >= 21. I feel all we can do
in this case is add a new warning if developers specify
`@(MultiDexMainDexList)` with R8--then allow R8 to calculate multidex
on its own.

We looked a bit, and did not find much usage of the
`@(MultiDexMainDexList)` item group:

https://github.com/search?q=MultiDexMainDexList&type=Code

The examples of `multidex.keep` files we found, looked like they
shouldn't be needed anyway.

I updated the `MultiDexCustomMainDexFileList` test to check dx/d8 and
API 19/21. R8 appears to create multiple dex files without any
multidex rules or `multidex.keep` files.
@jonathanpeppers jonathanpeppers removed the do-not-merge PR should not be merged. label May 29, 2019
@jonpryor jonpryor merged commit 34ee473 into dotnet:master May 30, 2019
@jonathanpeppers jonathanpeppers deleted the r8-1.4 branch May 31, 2019 13:46
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Jul 19, 2019
Fixes: dotnet#3370
Context: dotnet#3121

In 34ee473, I introduced an incorrect warning if:

* `android:minSdkVersion` >= 21
* `$(AndroidEnableMultiDex)` is `True`
* `$(AndroidDexTool)` is `d8`

We need to check if any `@(MultiDexMainDexList)` files were present
before issuing the warning. r8 no longer supports custom
`multidex.keep` files in some cases, so this is what the `<R8/>`
MSBuild task is actually meant to warn about.

I also improved the warning message a bit.
jonathanpeppers added a commit that referenced this pull request Jul 19, 2019
Fixes: #3370
Context: #3121

In 34ee473, I introduced an incorrect warning if:

* `android:minSdkVersion` >= 21
* `$(AndroidEnableMultiDex)` is `True`
* `$(AndroidDexTool)` is `d8`

We need to check if any `@(MultiDexMainDexList)` files were present
before issuing the warning. r8 no longer supports custom
`multidex.keep` files in some cases, so this is what the `<R8/>`
MSBuild task is actually meant to warn about.

I also improved the warning message a bit.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants