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

Maven library fails with java.lang.VerifyError: Verifier rejected class ... on Android 11 #457

Closed
M66B opened this issue Jun 14, 2020 · 3 comments

Comments

@M66B
Copy link

M66B commented Jun 14, 2020

Describe the bug

Library version 1.6.5 from:
https://mvnrepository.com/artifact/com.sun.mail/android-mail
https://mvnrepository.com/artifact/com.sun.mail/android-activation

Caused by: java.lang.VerifyError: Verifier rejected class com.sun.mail.handlers.handler_base: java.awt.datatransfer.DataFlavor[] com.sun.mail.handlers.handler_base.getTransferDataFlavors() failed to verify: java.awt.datatransfer.DataFlavor[] com.sun.mail.handlers.handler_base.getTransferDataFlavors(): [0x4]  can't resolve returned type 'Unresolved Reference: java.awt.datatransfer.DataFlavor[]' or 'Reference: javax.activation.ActivationDataFlavor[]' (declaration of 'com.sun.mail.handlers.handler_base' appears in /data/app/.../base.apk)
        at java.lang.Class.newInstance(Class.java:-2)
        at javax.activation.MailcapCommandMap.getDataContentHandler(MailcapCommandMap.java:601)
        at javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:573)
        at javax.activation.CommandMap.createDataContentHandler(CommandMap.java:205)
        at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:594)
        at javax.activation.DataHandler.getContent(DataHandler.java:521)
        at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1475)

Smartphone:

  • Device: Pixel 3a XL
  • OS: Android 11 beta 1

Additional context
The same library works without problems on Android 10.

Compiling the source inline with the app solves the issue on Android 11:
M66B/FairEmail@286a8fd

My guess there is something wrong with the build process / published library.

@rivercartwright
Copy link

The same problem exists on the released version of Android 11.

@rivercartwright
Copy link

I have a convoluted workaround for this problem. It's temporary.

I switched to using the release candidates of the Eclipse Jakarta Mail and Activation components.

    implementation 'com.sun.mail:jakarta.mail:2.0.0-RC6'
    implementation 'com.sun.activation:jakarta.activation:2.0.0-RC3'

However, there is a bug in the pom.xml metadata of the activation library that prevents Android from compiling it.
jakartaee/jaf-api#53

While I wait for a fix to be incorporated and published I was able to unjar the activation jar, fix the pom.xml, jar it up again and then use it directly.

    implementation('com.sun.mail:jakarta.mail:2.0.0-RC6') {
        // This exclusion and the inclusion of the modified jar below are to work around
        // an error in the pom.xml metadata. https://github.com/eclipse-ee4j/jaf/issues/53
        exclude group: 'com.sun.activation', module: 'jakarta.activation'
    }
    implementation files('libs/jakarta.activation-2.0.0-RC3-mymod1.jar')

@lukasj
Copy link
Contributor

lukasj commented Jan 15, 2021

same as #489, closing in favor of that one (has more comments...)

@lukasj lukasj closed this as completed Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants