美文网首页flutter
Flutter通过publish_to解决warning: Pu

Flutter通过publish_to解决warning: Pu

作者: __Mr_Xie__ | 来源:发表于2023-08-20 17:48 被阅读0次

    警告描述

    Publishable packages can't have 'path' dependencies. Try adding a 'publish_to: none' entry to mark the package as not for publishing or remove the path dependency.dart(invalid_dependency)

    解决方法

    添加代码publish_to: none,如下:

    name: example
    description: A new Flutter project.
    version: 1.0.0+1
    # 下面这行代码防止包被意外发布到
    # pub.dev使用pub publish。这是私有包的首选。
    #如果你想发布到pub.dev,请删除publish_to: none
    publish_to: none
    
    environment:
      sdk: ">=2.13.0 <3.0.0"
    
    dependencies:
      flutter:
        sdk: flutter
      flutter_bloc:
        path: ../
    
    dependency_overrides:
      bloc:
        path: ../../bloc
      flutter_bloc:
        path: ../
    
    flutter:
      uses-material-design: true
    

    相关文章

      网友评论

        本文标题:Flutter通过publish_to解决warning: Pu

        本文链接:https://www.haomeiwen.com/subject/qznsmdtx.html