Cannot add task 'generateLockfiles' as a task with that name already exists.

来源:3-5 Flutter开发环境与Android开发环境设置详解(Windows)

冲TT放学别走

2021-12-04

flutter doctor正常
新建flutter可以正常启动运行
但是 clone项目代码运行就报错,提示如下:

Running "flutter pub get" in flutter_trip...                     2,272ms
The plugin `flutter_splash_screen` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2
embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding:
https://flutter.dev/go/android-plugin-migration.
Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling
software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Script '/Users/sc/mobile-space/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 106

* What went wrong:
A problem occurred evaluating script.
> Failed to apply plugin [class 'FlutterPlugin']
   > Cannot add task 'generateLockfiles' as a task with that name already exists.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':asr_plugin'.
> compileSdkVersion is not specified.

* 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

BUILD FAILED in 7s
Running Gradle task 'assembleDebug'...                              9.0s
Exception: Gradle task assembleDebug failed with exit code 1
写回答

2回答

冲TT放学别走

提问者

2021-12-06

配置NDK版本搞定

0
1
慕婉清3464796
请问你怎么解决的具体
2022-02-13
共1条回复

CrazyCodeBoy

2021-12-06

用as打开项目下的Android项目然后clean之后在运行试一下

0
3
weixin_慕设计5031726
请问老师,这个问题是怎么解决的?
2022-03-29
共3条回复

Flutter从入门到进阶 实战携程网App 一网打尽核心技术

解锁Flutter开发新姿势,,系统掌握Flutter开发核心技术。

4788 学习 · 3277 问题

查看课程