C.C*_*ana 18 dart android-studio flutter
当我尝试运行我的应用程序时,我收到此附加错误。有任何想法吗?(以下)
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.
Run Code Online (Sandbox Code Playgroud)
我检查了 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
Run Code Online (Sandbox Code Playgroud)
Rav*_*ara 39
就我而言,问题是我缺少 slash /。
首先,我添加了我的图标路径,如下所示。
assets:
- assets/icons
Run Code Online (Sandbox Code Playgroud)
我通过/在路径末尾添加斜杠来解决这个问题,如下所示:
assets:
- assets/icons/
Run Code Online (Sandbox Code Playgroud)
Dar*_*han 18
检查资产标识。通常它应该从新行的开始有 3 个空格。
assets:
- assets/credentials.json // <-- count three spaces from start
Run Code Online (Sandbox Code Playgroud)
我遇到了同样的问题,我有两个错误:
正如@Darshan 所说,它应该离起始行三个空格
-assets/credentials.json // <-- 从开始算三个空格
它应该出现一条灰线,像这样
| 归档时间: |
|
| 查看次数: |
15373 次 |
| 最近记录: |