尝试运行我的应用程序时,出现此错误。有任何想法吗?
(以下)
Launching lib\main.dart on SM J200Y in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
Error detected in pubspec.yaml:
No file or variants found for asset: assets/credentials.json.
我已经检查了yaml文件,并且格式似乎还不错。我茫然想要这个问题。 (也如下)
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/credentials.json
最佳答案
检查 Assets 的缩进。通常,从新行开始应有3个空格。
assets:
- assets/credentials.json // <-- count three spaces from start
关于android-studio - 在我的 Assets 上获取 "No file or variants found for asset"发现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59657146/