Sam Stern
Sam Stern

Reputation: 25134

Firestore: Invalid package reference in library

After updating to com.google.firebase:firebase-firestore:16.0.0 I get the following lint error:

  Error: Invalid package reference in library; not included in Android: javax.naming.directory. Referenced from io.grpc.internal.DnsNameResolver.JndiResolver. [InvalidPackage]
  Error: Invalid package reference in library; not included in Android: javax.naming. Referenced from io.grpc.internal.DnsNameResolver.JndiResolver. [InvalidPackage]

Seems that the grpc dependency is making lint unhappy. How can I solve this?

Upvotes: 21

Views: 6458

Answers (2)

nicopico
nicopico

Reputation: 3636

You can remove this error by setting the following content in a lint.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <issue id="InvalidPackage">
        <ignore path="*/io.grpc/grpc-core/*"/>
    </issue>
</lint>

The lint.xml should be at the root of your application module.

The advantage over demoting the error to a warning is that if you later happen to add a dependency which really have an invalid package, you will still get the error.

Upvotes: 31

Sam Stern
Sam Stern

Reputation: 25134

This error should be safe to ignore. You can downgrade all InvalidPackage errors to warnings using this block:

android {

    // ...

    lintOptions {
        warning 'InvalidPackage'
    }
}

Upvotes: 18

Related Questions