首页 > 解决方案 > 如何解决颤振中的 gradle 错误?

问题描述

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.

标签: flutterflutter-layoutflutter-dependenciesflutter-webflutter-animation

解决方案


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


推荐阅读