注意:“ Cloud Firestore会覆盖已弃用的API”

时间:2019-07-05 10:38:03

标签: flutter google-cloud-firestore

在为Android编译Flutter移动应用程序(安装APK)时,会收到以下警告:

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Note: /Users/ez/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.6/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.                    
Note: /Users/ez/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.6/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.                      
Note: /Users/ez/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.0+6/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

StackOverflow上有很多类似的问题,每个问题都有不同的插件版本集。

我做了什么: 1.我已将插件更新为最新版本:

dependencies:
  flutter:
    sdk: flutter
  # firebase & firestore
  firebase_core: ^0.4.0+6
  cloud_functions: ^0.4.0+2
  cloud_firestore: ^0.12.6
  firebase_storage: ^3.0.2
  firebase_auth: ^0.11.1+7
  # notifications
  firebase_messaging: ^5.0.4
  1. 我已将android-> build.gradle更新为:
dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:4.2.0'  // Google Services plugin
    }
  1. 我已将gradle.properties更新为:
android.useAndroidX=true
android.enableJetifier=true

我必须承认我对所有gradle和依赖项都不熟悉... 没有适当的方法来解决所有这些依赖项吗?

1 个答案:

答案 0 :(得分:1)

这些不是错误。这些是注释,即弃用警告
您完全不必担心。开发Firestore插件的团队是唯一需要为此担心的人,如果他们认为使用不推荐使用的方法对插件没问题,并且一切正常,就没有问题。

这也意味着如果您的应用无法正常运行,例如没有开始,您有另一个问题。您发布的日志完全正常,不会引起任何问题。

我的结论是,您发布的内容绝对没有错。