【发布时间】:2021-05-04 01:13:54
【问题描述】:
我将位置包添加到项目的 pubspec.yamel 中,当我构建项目时出现此错误:
FAILURE:构建失败并出现异常。
出了什么问题:任务执行失败 ':app:processDebugResources'。执行时发生故障 com.android.build.gradle.internal.tasks.Workers$ActionFacade Android 资源链接失败 G:\flutterproject\green_doctor\marketer\marketer\build\location\intermediates\library_manifest\debug\AndroidManifest.xml:11:9-15:56: AAPT:错误:找不到属性 android:foregroundServiceType。
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。运行 --info 或 --debug 选项以获得更多日志输出。运行 --scan 以获得完整的见解。
通过https://help.gradle.org获得更多帮助
BUILD FAILED in 55s 构建失败可能是由于 AndroidX 插件不兼容。该工具即将尝试使用 Jetfier 解决不兼容问题。构建插件位置...正在运行 Gradle 任务 'assembleAarRelease'... √ 内置 build\app\outputs\repo。 构建插件 location_web... 运行 Gradle 任务 'assembleAarRelease'...
F:\flutter.pub-cache\hosted\pub.dartlang.org\location_web-1.0.1\android\src\main\java\com\lyokone\location_web\LocationWebPlugin.java:3: 错误:找不到符号导入androidx.annotation.NonNull; ^ 符号:类 NonNull 位置:包 androidx.annotation F:\flutter.pub-cache\hosted\pub.dartlang.org\location_web-1.0.1\android\src\main\java\com\lyokone\location_web\LocationWebPlugin.java:15: 错误:找不到符号 public void onAttachedToEngine(@nonnull FlutterPluginBinding flutterPluginBinding) { } ^ 符号:类 NonNull 位置:类 LocationWebPlugin F:\flutter.pub-cache\hosted\pub.dartlang.org\location_web-1.0.1\android\src\main\java\com\lyokone\location_web\LocationWebPlugin.java:20: 错误:找不到符号 public void onDetachedFromEngine(@nonnull FlutterPluginBinding 绑定){ } ^ 符号:类 NonNull 位置: 类 LocationWebPlugin 3 错误
FAILURE:构建失败并出现异常。
出了什么问题:任务执行失败 ':compileReleaseJavaWithJavac'。编译失败;看编译器 详细信息错误输出。
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。运行 --info 或 --debug 选项以获得更多日志输出。运行 --scan 以获得完整的见解。
通过https://help.gradle.org获得更多帮助
11 秒后构建失败
异常:由于该问题,无法构建插件 location_web 以上。
谁能帮我解决这个问题?
【问题讨论】:
-
你使用的是哪个版本的定位包?
-
位置 3.2.4 - @ShubhamNarkhede