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版本搞定
012022-02-13 -
CrazyCodeBoy
2021-12-06
用as打开项目下的Android项目然后clean之后在运行试一下
032022-03-29
相似问题
使用老师的代码进行安卓打包,为什么出错?
回答 2