繁体   English   中英

因为当我在 Android 应用程序中使用 Firebase Firestore 的依赖项时出现错误?

[英]Because when I use the dependency of Firebase Firestore in my Android application I get an error?

每次我尝试编译我的 APK 或使用命令/lintdebug我是 Windows 用户)时,我都会收到错误消息。 我知道我可以通过在 build.gradle 中添加一些 lint 配置行来跳过这个问题但我希望我的项目干净,没有错误或警告。

检查是否是因为Firebase Firestore 的依赖性,因为当我从我的依赖项列表中删除它,错误消失了。

这是我的错误,我希望有人可以帮助我。

C:\Users\itzThiefz.exe\AndroidStudioProjects\RavenNetwork>gradlew lintdebug

> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Task :app:processDebugGoogleServices
Parsing json file: C:\Users\itzThiefz.exe\AndroidStudioProjects\RavenNetwork\app\google-services.json

> Task :app:lintDebug
Wrote HTML report to file:///C:/Users/itzThiefz.exe/AndroidStudioProjects/RavenNetwork/app/build/reports/lint-results-debug.html
Wrote XML report to file:///C:/Users/itzThiefz.exe/AndroidStudioProjects/RavenNetwork/app/build/reports/lint-results-debug.xml

> Task :app:lintDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lintDebug'.
> Lint found errors in the project; aborting build.

  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...

  Errors found:

  C:\Users\itzThiefz.exe\.gradle\caches\modules-2\files-2.1\io.grpc\grpc-core\1.16.1\8a938ece0ad8d8bf77d790c502ba51ebec114aa9\grpc-core-1.16.1.jar: Error: Invalid package reference in li
brary; not included in Android: javax.naming.directory. Referenced from io.grpc.internal.JndiResourceResolverFactory.JndiResourceResolver. [InvalidPackage]
  C:\Users\itzThiefz.exe\.gradle\caches\modules-2\files-2.1\io.grpc\grpc-core\1.16.1\8a938ece0ad8d8bf77d790c502ba51ebec114aa9\grpc-core-1.16.1.jar: Error: Invalid package reference in li
brary; not included in Android: javax.naming. Referenced from io.grpc.internal.JndiResourceResolverFactory.JndiResourceResolver. [InvalidPackage]



* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 30s
15 actionable tasks: 2 executed, 13 up-to-date

此问题已在 grpc 1.20.0 中修复。 修改您的 app/build.gradle 以在依赖项列表中包含此版本的 grpc。

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'io.grpc:grpc-core:1.20.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM