-
Notifications
You must be signed in to change notification settings - Fork 533
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
d8/r8 can give lots of warnings about MANIFEST.MF #3622
Comments
thank you @jonathanpeppers ! |
I also get a number of those and additionally META-INF/MSFTSIG.SF and META-INF/MSFTSIG.RSA. No Forms in my stuff though. |
Same problem! |
I also have |
Same problem |
Same here |
4 similar comments
Same here |
Same here |
Same here |
Same here |
Fixes: dotnet#3622 Context: https://r8.googlesource.com/r8/ Just building a Xamairn.Forms template with multi-dex enabled produces the warning: R8 : warning : Resource 'META-INF/MANIFEST.MF' already exists. There are also other reports of: R8 : warning : Resource 'META-INF/MSFTSIG.SF' already exists. R8 : warning : Resource 'META-INF/MSFTSIG.RSA' already exists. Reviewing r8's source code, I see no way to prevent it from emitting these messages. For now, it seems simple enough to add a `Regex` for this message and downgrade it to a regular MSBuild message. I added a test for this scenario as well, however I was also getting this message from r8: Warning: The rule `-keep public class * extends java.lang.annotation.Annotation { *; }` uses extends but actually matches implements. I don't think we should downgrade this one, yet... I reworked the test so allow 1 warning and used a property to disable a warning coming from Xamarin.Build.Download.
Fixes: dotnet#3622 Context: https://r8.googlesource.com/r8/ Just building a Xamairn.Forms template with multi-dex enabled produces the warning: R8 : warning : Resource 'META-INF/MANIFEST.MF' already exists. There are also other reports of: R8 : warning : Resource 'META-INF/MSFTSIG.SF' already exists. R8 : warning : Resource 'META-INF/MSFTSIG.RSA' already exists. Reviewing r8's source code, I see no way to prevent it from emitting these messages. For now, it seems simple enough to add a `Regex` for this message and downgrade it to a regular MSBuild message. I added a test for this scenario as well, however I was also getting this message from r8: Warning: The rule `-keep public class * extends java.lang.annotation.Annotation { *; }` uses extends but actually matches implements. I don't think we should downgrade this one, yet... I reworked the test so allow 1 warning and used a property to disable a warning coming from Xamarin.Build.Download.
…ges (#4001) Fixes: #3622 Context: https://r8.googlesource.com/r8/ Just building a Xamairn.Forms template with multi-dex enabled produces the warning: R8 : warning : Resource 'META-INF/MANIFEST.MF' already exists. There are also other reports of: R8 : warning : Resource 'META-INF/MSFTSIG.SF' already exists. R8 : warning : Resource 'META-INF/MSFTSIG.RSA' already exists. Reviewing r8's source code, I see no way to prevent it from emitting these messages. For now, it seems simple enough to add a `Regex` for this message and downgrade it to a regular MSBuild message. I added a test for this scenario as well, however I was also getting this message from r8: Warning: The rule `-keep public class * extends java.lang.annotation.Annotation { *; }` uses extends but actually matches implements. I don't think we should downgrade this one, yet... I reworked the test so allow 1 warning and used a property to disable a warning coming from Xamarin.Build.Download.
…ges (#4001) Fixes: #3622 Context: https://r8.googlesource.com/r8/ Just building a Xamairn.Forms template with multi-dex enabled produces the warning: R8 : warning : Resource 'META-INF/MANIFEST.MF' already exists. There are also other reports of: R8 : warning : Resource 'META-INF/MSFTSIG.SF' already exists. R8 : warning : Resource 'META-INF/MSFTSIG.RSA' already exists. Reviewing r8's source code, I see no way to prevent it from emitting these messages. For now, it seems simple enough to add a `Regex` for this message and downgrade it to a regular MSBuild message. I added a test for this scenario as well, however I was also getting this message from r8: Warning: The rule `-keep public class * extends java.lang.annotation.Annotation { *; }` uses extends but actually matches implements. I don't think we should downgrade this one, yet... I reworked the test so allow 1 warning and used a property to disable a warning coming from Xamarin.Build.Download.
@jonathanpeppers In your commit, I can see that the message used in the regex is "Warning: Resource.+already exists", while the one being shown during build is actually "warning : Resource.+already exists". Thanks |
@tranb3r can you post your build log? I modified a test so it got the same warning, and the warning went away. But it's possible something is different for you? |
Sure. Here it is (only the r8 task): |
@tranb3r are these showing up as warnings in the IDE's error pad? Have a screenshot? These will still get logged, just as messages though. |
@jonathanpeppers |
R8 appears to warn if the same file is encountered in multiple jar files:
I don't see the need for R8 to warn about this, but that is what it does. I reviewed R8's source code and could not find a way for us to suppress the warning:
Feel free to review and let us know if you see something we could do differently (or open a PR!). Thanks. |
I've added the "--no-data-resources" r8 argument and the "resource already exists" warnings are gone (and the output classes.dex is exactly the same). |
It doesn't seem to be documented very well as to what it does:
Thanks, Google! Reading the source code, I found a comment that gives slightly more info:
The default value of R8 has an option to output java output instead of dex (Android-specific). It seems like that option would only apply to java output. I don't think you can put arbitrary files in a dex. Our build system puts these extra files in the APK later on: Let me do some other research on this. |
thanks @jonathanpeppers |
Release status update A new Preview version has now been published that includes the change to make this warning an informational message so that it will no longer appear in the Error List. That change is not yet included in a Release version. I will update this item again when a Release version is available that includes that change in behavior. Separate from that first change, investigation will continue on possible further improvements. Change included in Xamarin.Android 10.2.0.84. Change included on Windows in Visual Studio 2019 version 16.5 Preview 2. To try the Preview version that includes the change, check for the latest updates in Visual Studio Preview. Change included on macOS in Visual Studio 2019 for Mac version 8.5 Preview 1. To try the Preview version that includes the change, check for the latest updates on the Preview updater channel. |
Release status update A new Release version has now been published on Windows that includes the change to make this warning an informational message so that it will no longer appear in the Error List. That change is not yet published in a Release version on macOS. I will update this item again when a Release version is available on macOS that change in behavior. Separate from that first change, investigation will continue on possible further improvements. Change included in Xamarin.Android 10.2.0.100. Change included on Windows in Visual Studio 2019 version 16.5. To get the new version that includes the change, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/. (Change also included on macOS in Visual Studio 2019 for Mac version 8.5 Preview 1 and higher. To try the Preview version that includes the change, check for the latest updates on the Preview updater channel.) |
Release status update A new Release version has now been published on macOS that includes the change to make this warning an informational message so that it will no longer appear in the Error List. Separate from that first change, investigation will continue on possible further improvements. Change included in Xamarin.Android 10.2.0.100. Change included on macOS in Visual Studio 2019 for Mac version 8.5. To get the new version that includes the change, check for the latest updates on the Stable updater channel. (Change also included on Windows in Visual Studio 2019 version 16.5 and higher. To get the new version that includes the change, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/.) |
Kudos |
Context: #2939 (comment)
Steps to Reproduce
I think you might see them with a Xamarin.Forms template even, just enable d8/r8.
Expected Behavior
R8 shouldn't produce warnings by default.
Actual Behavior
We get warnings!
Version Information
Happens with 16.2, and probably all versions.
The text was updated successfully, but these errors were encountered: