m-r-davari / flutter_3d_controller

The most complete Flutter package for rendering interactive 3D models in various formats (GLB, GLTF, OBJ, FBX), with the ability to control animations, textures, camera, and more.
https://pub.dev/packages/flutter_3d_controller
MIT License
107 stars 14 forks source link

getAvailableAnimations does not work on iOS but works on Android #19

Closed wesleycoats closed 4 months ago

wesleycoats commented 5 months ago

getAvailableAnimations feature is not working on iOS.

It gets a parse error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Unexpected character (at line 2, character 5)
    Idle,
    ^

#0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1380:5)
#1      _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1247:9)
#2      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:912:22)
#3      _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#4      JsonDecoder.convert (dart:convert/json.dart:610:36)
#5      JsonCodec.decode (dart:convert/json.dart:216:41)
#6      jsonDecode (dart:convert/json.dart:155:10)
#7      Flutter3DDatasource.getAvailableAnimations (package:flutter_3d_controller/src/data/datasources/flutter_3d_datasource_mobile.dart:48:12)
<asynchronous suspension>
#8      Flutter3DRepository.getAvailableAnimations (package:flutter_3d_controller/src/data/repositories/flutter_3d_repository.dart:25:12)
<asynchronous suspension>
#9      Flutter3DController.getAvailableAnimations <…>

I know this GLB has animations because it works on Android with the same code:

I/flutter (11411): [Idle, Jump, Land, Run]

m-r-davari commented 4 months ago

please check latest version, and make sure your animation names does not contain any special character