Skip to content

Missing classes errors with R8 full mode using Tink in Android #7

Description

@tonidero

Help us help you

We'd like to know more about
your Tink deployment.

Describe the bug:

After updating our Android SDK to R8 full mode (as part of the Android Gradle Plugin 8.0 upgrade), we started seeing some missing classes errors:

Missing class com.google.errorprone.annotations.CanIgnoreReturnValue (referenced from: com.google.crypto.tink.subtle.Ed25519$XYZ com.google.crypto.tink.subtle.Ed25519$XYZ.fromPartialXYZT(com.google.crypto.tink.subtle.Ed25519$XYZ, com.google.crypto.tink.subtle.Ed25519$PartialXYZT) and 1 other context)
Missing class com.google.errorprone.annotations.Immutable (referenced from: com.google.crypto.tink.util.Bytes)

Adding the following to our proguard rules works around the issue:

-dontwarn com.google.errorprone.annotations.CanIgnoreReturnValue
-dontwarn com.google.errorprone.annotations.Immutable

But these proguard rules should be part of the Tink library.

What was the expected behavior?

Minified builds in Android would continue working without build issues after upgrading to AGP 8.0

How can we reproduce the bug?

We currently only use the Ed25519Verify class from Tink in our project like this:

class SignatureVerifier(publicKey: ByteArray) {

    private val verifier = Ed25519Verify(publicKey)

    fun verify(signatureToVerify: ByteArray, messageToVerify: ByteArray): Boolean {
        return try {
            verifier.verify(signatureToVerify, messageToVerify)
            true
        } catch (_: GeneralSecurityException) {
            false
        }
    }
}

Do you have any debugging information?

If applicable, include error messages, stack traces, or any other debugging information.

What version of Tink are you using?

We use version 1.8.0:

implementation "com.google.crypto.tink:tink-android:1.8.0"

Can you tell us more about your development environment?

  • Android Studio Flamingo 2022.2.1
  • Android Gradle Plugin 8.0

Is there anything else you'd like to add?

Provide any additional context about the problem.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions