我在pubspec.yaml文件中使用存储库包时遇到了问题。
dependencies:
flutter:
sdk: flutter
flutter_stripe:
git:
url: https://github.com/flutter-stripe/flutter_stripe.git
ref: poc-use-expensive-androidview按照提供的步骤执行https://dart.dev/tools/pub/dependencies#git-packages。
但是,我得到了错误。
Could not find a file named "pubspec.yaml" in https://github.com/flutter-stripe/flutter_stripe.git 7934151fefed73c6a22c253de3a1f1c9d46decc2.
pub get failed (1; Could not find a file named "pubspec.yaml" in https://github.com/flutter-stripe/flutter_stripe.git 7934151fefed73c6a22c253de3a1f1c9d46decc2.)我不知道我应该为存储库中不存在的pubspec.yaml准备什么。如果您像使用flutter pub add flutter_stripe那样调用包,那么它可以正常工作。
之所以需要使用非官方分支,是因为包提供的字段之一不能正常工作,建议的解决方案是使用这个分支。
发布于 2022-08-19 07:32:44
如果您查看git项目的包,您可以看到更多的包:https://github.com/flutter-stripe/flutter_stripe/tree/main/packages,您必须选择所需的包。
发布于 2022-08-19 07:31:44
对不起,我的错,我不知道托管包的根不是最终的路径。我被要求向包添加一个路径,然后可以在./ packages /stripe中找到它。
flutter_stripe:
git:
url: https://github.com/flutter-stripe/flutter_stripe.git
ref: poc-use-expensive-androidview
path: ./packages/stripe对于任何和我有同样问题的人..。或者我只是个菜鸟
https://stackoverflow.com/questions/73413144
复制相似问题