首页 > 其他 > 详细

Flutter采坑日记

时间:2021-07-27 15:32:10      阅读:33      评论:0      收藏:0      [点我收藏+]

昨天在pub.dev上闲逛,发现一个挺有意思的程序包:photo_manager,决定尝试一下。

废话不多,直接上代码

flutter create flutterdemo01

然后用vscode打开,在终端运行:

flutter pub add photo_manager

安装包。

Widget build(BuildContext context) {
    PhotoManager.requestPermissionExtend();
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              You have pushed the button this many times:,
            ),
            Text(
              $_counter,
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: Increment,
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }

编译一下试试,经过漫长等待,终于。。。。。。。。。。。。。。。。。。报错了。

Execution failed for task ‘:photo_manager:compileDebugKotlin‘.
> Compilation error. See log for more details

* 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 23s
Exception: Gradle task assembleDebug failed with exit code 1

 

好吧,搜一下:photo_manager:compileDebugKotlin,还真有人踩过这个坑,

https://github.com/CaiJingLong/flutter_photo_manager/issues/561

 一步步来,还真的解决了,在此记录一下,希望对遇到同样问题的同学有所帮助。

Flutter采坑日记

原文:https://www.cnblogs.com/wccxsz/p/15064746.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!