问题
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