Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Unable to load asset: assets/rrect.json #17

Closed
songshitong opened this issue Jan 29, 2019 · 6 comments
Closed

Unable to load asset: assets/rrect.json #17

songshitong opened this issue Jan 29, 2019 · 6 comments

Comments

@songshitong
Copy link

songshitong commented Jan 29, 2019

i copied example/LottieDemo to my project but there is an error occur

error log :

Unable to load asset: assets/rrect.json
#0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
<asynchronous suspension>
#1      AssetBundle.loadString (package:flutter/src/services/asset_bundle.dart:67:33)
<asynchronous suspension>
#2      CachingAssetBundle.loadString.<anonymous closure> (package:flutter/src/services/asset_bundle.dart:162:56)
#3      __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
#4      CachingAssetBundle.loadString (package:flutter/src/services/asset_bundle.dart:162:27)
#5      loadAsset (package:oldfriendspub/pages/mine/about_us_page.dart:154:8)
<asynchronous suspension>
#6      _LottieDemoState._loadButtonPressed (package:oldfriendspub/pages/mine/about_us_page.dart:56:5)
#7      _LottieDemoState.initState (package:oldfriendspub/pages/mine/about_us_page.dart:47:5)
#8      StatefulElement._firstBuild (packa<…>

DemoPage:
image

pubspec.yaml:
image

i am a newer in flutter, would you please help me?

@PramUkesh
Copy link

@songshitong may be because you are not including assets in pubspec.yaml
ping me if you correctly mention this
just found that assets/rrect.json is not in assets so remove that from array

@PramUkesh
Copy link

@songshitong reply me if it is resolved or not

@PramUkesh
Copy link

@songshitong
and one thing about posting an issue is use insert code option or quote block your issue referenced all the 1 - 8 issues because
number followed by hash reference to issue below without code block reference issue 1 for this repo. so post carefully
#1

@songshitong
Copy link
Author

first :
i am sorry for post too much issues, and, corrected it.

second:
i copied the directory assets/ from your packages to my project, and it worked well
like this:
image

third:
i found the two of same json in apk. how can i load json from your packages instead of create
directory assets in my project what cause my apk size increased 。
just delete one of them?

image

@dnfield
Copy link
Owner

dnfield commented Jan 30, 2019

Those are safe to delete.

I need to restructure this project. Sorry about that.

@songshitong
Copy link
Author

it will be a good job.

thanks for your help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants