我的档案
endpoints.json
/WORKPLACE_DIR/assets/json/endpoints.json
{
"key": "value"
}
我已经更新了我的
pubspec.yaml
assets:
- assets/json/endpoints.json
/tests/some_test.dart
test('my test', () async {
final endpoints = json.decode(await rootBundle.loadString("assets/json/endpoints.json"));
}
它仍然会出错
ERROR: Unable to load asset: assets/json/endpoints.json
package:flutter/src/services/asset_bundle.dart 221:7 PlatformAssetBundle.load
===== asynchronous gap ===========================
dart:async _AsyncAwaitCompleter.completeError
package:flutter/src/services/asset_bundle.dart PlatformAssetBundle.load
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:flutter/src/services/asset_bundle.dart PlatformAssetBundle.load
package:flutter/src/services/asset_bundle.dart 67:33 AssetBundle.loadString
flutter clean
但它仍然给出了这个错误。我不知道该怎么办。