无法捕获任务':app:transformClassesWithDexBuilderForDebug'的输出文件的指纹

时间:2019-04-28 04:44:16

标签: android dart flutter android-wallpaper wallpapermanager

我正在尝试使用Flutter的墙纸包(https://pub.dartlang.org/packages/wallpaper)创建墙纸应用。问题是,当我尝试运行该应用程序时,出现错误消息:

Failed to capture fingerprint of output files for task ':app:transformClassesWithDexBuilderForDebug' property 'streamOutputFolder' during up-to-date check.

这是我的dart文件的完整代码,试图访问Wallpaper软件包的功能:

import 'package:flutter/material.dart';
import 'package:wallpaper/wallpaper.dart';

class FullScreenImage extends StatelessWidget {

  String imgPath;
  String imgID;
  FullScreenImage(this.imgPath, this.imgID);

  final LinearGradient backgroundGradient = LinearGradient(
    colors: [Color(0x10000000), Color(0x30000000)],
    begin: Alignment.topLeft,
    end: Alignment.bottomRight,
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SizedBox.expand(
        child: Container(
          decoration: BoxDecoration(
            gradient: backgroundGradient,
          ),
          child: Stack(
            children: <Widget>[
              Align(
                alignment: Alignment.center,
                child: Hero(
                  tag: imgID,
                  child: Image.network(
                    imgPath,
                    fit: BoxFit.cover,
                  ),
                ),
              ),
              Align(
                alignment: Alignment.topCenter,
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  mainAxisSize: MainAxisSize.min,
                  children: <Widget>[
                    AppBar(
                      elevation: 8.0,
                      backgroundColor: Colors.transparent,
                      leading: IconButton(
                        icon: Icon(Icons.close),
                        onPressed: () => Navigator.of(context).pop(),
                      ),
                    )
                  ],
                ),
              ),
              Padding(
                padding: EdgeInsets.only(bottom: 4.0),
                child: Align(
                  alignment: Alignment.bottomCenter,
                  child: RaisedButton(
                    color: Colors.transparent,
                    child: Icon(
                      Icons.file_download,
                      color: Colors.white,
                      size: 30,
                    ),
                    onPressed: () async {
                      await Wallpaper.homeScreen(imgPath);
                    },
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

我希望该应用在Android的主屏幕上设置壁纸。但是,我遇到了一个奇怪的长错误。所以,这是我的控制台日志:

g lib\main.dart on QMobile Z10 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of output files for task ':app:transformClassesWithDexBuilderForDebug' property 'streamOutputFolder' during up-to-date check.
> Could not read path 'F:\Apps\querencia\build\app\intermediates\transforms\dexBuilder\debug\146\com\google\firebase\analytics\connector\impl'.

* 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 1m 25s
Finished with error: Gradle task assembleDebug failed with exit code 1

1 个答案:

答案 0 :(得分:0)

我不知道确定的原因,但是重建项目解决了这个问题。