【问题标题】:How can I solve that gradle error in flutter?如何解决颤振中的 gradle 错误?
【发布时间】:2020-12-16 07:17:55
【问题描述】:
Asset manifest contains a null or empty uri.
C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\fluttertoast-2.2.11\android\src\main\java\io\github\ponnamkarthik\toast\fluttertoast\FluttertoastPlugin.java:14: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
                                 ^
C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\fluttertoast-2.2.11\android\src\main\java\io\github\ponnamkarthik\toast\fluttertoast\FluttertoastPlugin.java:107: error: cannot find symbol
          Drawable shapeDrawable = ContextCompat.getDrawable(ctx, R.drawable.toast_bg);
                                   ^
  symbol:   variable ContextCompat
  location: class FluttertoastPlugin
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':fluttertoast:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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

BU�LD FAILED in 19s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Running Gradle task 'assembleAarRelease'...
Building plugin cloud_firestore...
Exception: The plugin cloud_firestore could not be built due to the issue above.

【问题讨论】:

    标签: flutter flutter-layout flutter-dependencies flutter-web flutter-animation


    【解决方案1】:

    您似乎使用的是旧版本的 cloud_firestore。你能添加你的 .yaml 依赖项吗?

    【讨论】:

    • 环境:sdk:">=2.7.0
    • 您使用的是非常旧的 firebase_auth 版本。我没有检查休息。通过检查 pub.dev 上的最新版本来更新您的依赖项
    • 是的,我更新了,但现在出现以下错误 'FirebaseUser' 已被弃用,不应使用 'signInWithGoogle' 方法没有为类型 'FirebaseAuth' 定义。
    • 是的,您需要使用用户而不是 FirebaseUser。
    猜你喜欢
    • 2021-07-11
    • 2021-11-05
    • 2021-05-12
    • 2021-09-17
    • 2021-05-02
    • 2023-02-16
    • 2021-10-26
    • 1970-01-01
    • 2021-08-14
    相关资源
    最近更新 更多