dnfield / lottie-flutter

A pure Dart/Flutter implementation of Lottie
Apache License 2.0
115 stars 24 forks source link

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

Closed songshitong closed 5 years ago

songshitong commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

@songshitong reply me if it is resolved or not

PramUkesh commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

Those are safe to delete.

I need to restructure this project. Sorry about that.

songshitong commented 5 years ago

it will be a good job.

thanks for your help.