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

问题描述 投票:0回答:1

我正在尝试使用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
android dart flutter android-wallpaper wallpapermanager
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.