Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 785
Sam Stern Avatar asked May 03 '18 15:05

Sam Stern


2 Answers

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.

like image 185
nicopico Avatar answered Oct 05 '22 16:10

nicopico


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

android {

    // ...

    lintOptions {
        warning 'InvalidPackage'
    }
}
like image 23
Sam Stern Avatar answered Oct 05 '22 15:10

Sam Stern