Firestore: Invalid package reference in library

狂风中的少年 提交于 2020-01-02 00:52:12

问题


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?


回答1:


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.




回答2:


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

android {

    // ...

    lintOptions {
        warning 'InvalidPackage'
    }
}


来源:https://stackoverflow.com/questions/50159255/firestore-invalid-package-reference-in-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!