解决Flutter 编译异常path_provider

解决Flutter 编译异常path_provider

错误信息

Error running Gradle:
ProcessException: Process “/Users/*/AndroidStudioProjects/android/colorsizemanage/.android/gradlew” exited abnormally:

FAILURE: Build failed with an exception.

  • Where:
    Script ‘/Users/*/Downloads/flutter/packages/flutter_tools/gradle/flutter.gradle’ line: 200

  • What went wrong:
    A problem occurred configuring project ‘:path_provider’.

Failed to notify project evaluation listener.
Could not get unknown property ‘android’ for project ‘:path_provider’ of type org.gradle.api.Project.
Could not find method debugProvided() for arguments [file collection] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • 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 3s
Command: /Users/*/AndroidStudioProjects/android/flutter_module/.android/gradlew app:properties

Please review your Gradle project setup in the android/ folder.

解决方式

之前是项目里面有个保存数据到本地的操作所以依赖了path_provider: ^0.4.1
这个依赖在我使用flutter 1.1.7旧版本的时候是可以使用的,后来因为某些原因我升级了flutter
到2.几的版本,我再去编译项目一直报上面的错误,当我把path_provider: ^0.4.1升级为path_provider: ^0.5.0+1 这个版本,即可编译正常通过

    原文作者:MugWorld
    原文地址: https://blog.csdn.net/MugWorld/article/details/88776068
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞