rive-app / rive-flutter

Flutter runtime for Rive
https://rive.app
MIT License
1.21k stars 191 forks source link

UnsupportedError: A new runtime is likely necessary to play this file. #77

Closed yinleiCoder closed 3 years ago

yinleiCoder commented 3 years ago

Oh! please help me. I upgraded to the new version(v0.7.0), then can't load my file. It throws such an error: Unsupported property key , A new runtime is likely necessary to play this file.

yinleiCoder commented 3 years ago
void _loadRiveFile() async {
    // Load the animation file from the bundle, note that you could also
    // download this. The RiveFile just expects a list of bytes.
    rootBundle.load(riveFileName).then(
          (data) async {
        // Load the RiveFile from the binary data.
        final file = RiveFile.import(data);
        // The artboard is the root of the animation and gets drawn in the
        // Rive widget.
        final artboard = file.mainArtboard;
        // Add a controller to play back a known animation on the main/default
        // artboard.We store a reference to it so we can toggle playback.
        artboard.addController(_riveController = SimpleAnimation('drive'));
        setState(() => _artboard = artboard);
      },
    ).catchError((e) => print(e));
  }

Unsupported operation: Unsupported property key 1351. A new runtime is likely necessary to play this file.

yinleiCoder commented 3 years ago
[√] Flutter (Channel stable, 2.0.3, on Microsoft Windows [Version 10.0.19042.867], locale zh-CN)
    • Flutter version 2.0.3 at D:\flutter
    • Framework revision 4d7946a68d (2 weeks ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at D:\AndroidSDK
    • Platform android-30, build-tools 29.0.3
    • ANDROID_HOME = D:\AndroidSDK
    • Java binary at: D:\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
    • Android Studio at D:\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] IntelliJ IDEA Ultimate Edition (version 2020.1)
    • IntelliJ at D:\IntelliJ IDEA\IntelliJ IDEA 2018.3.5
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] Connected device (3 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 88.0.4324.104
    • Edge (web)              • edge          • web-javascript • Microsoft Edge 89.0.774.63
yinleiCoder commented 3 years ago

i clone your example project and run ,It's the same mistake

obiwanzenobi commented 3 years ago

It is probably related with:

New binary format 7.0 with improved flexibility which is not compatible with 6.0 files. The Rive editor will be able to export both format 6.0 and 7.0, but please note that 6.0 is now deprecated and all new improvements and bug fixes to the format will be done on 7.0.

yinleiCoder commented 3 years ago

It is probably related with:

New binary format 7.0 with improved flexibility which is not compatible with 6.0 files. The Rive editor will be able to export both format 6.0 and 7.0, but please note that 6.0 is now deprecated and all new improvements and bug fixes to the format will be done on 7.0.

it's right. I solved the problem by changing the RIV file.Thank you!

doodatales commented 3 years ago

I don't know if any of you guys are devs, but it's pretty ridiculous that most of the few Rive examples don't actually work/aren't supported with the new version of rive. Personally I'm using Rive for a production project and am able to work around that, but it's pretty unfair to any of the other devs out there trying to learn how to use this package.

luigi-rosso commented 3 years ago

Sorry for all the confusion around all of this. We sometimes add features that require modifying the runtime format. The format is getting more resilient to breaking changes so we hope to need to do this even more rarely in the future.

Two examples are provided in this repo under the example folder. If there's something specific you're looking for, please let us know. We also have a pretty strong community on Discord.

All old v6 files will still work on 0.6.x packages if you cannot get a newer export. The editor also offers exporting both v6 and v7 files, so whichever package version you are on you should still able to export content for it.