Flare-flutter: [1.5.4]'Uint16List' can't be assigned to the parameter type 'Int32List'.

Created on 12 Jul 2019  Â·  8Comments  Â·  Source: 2d-inc/Flare-Flutter

  • Error:
 - 'Uint16List' is from 'dart:typed_data'.
 - 'Int32List' is from 'dart:typed_data'.
Try changing the type of the parameter, or casting the argument to 'Int32List'.
        indices: _indices, textureCoordinates: _uvBuffer);
$ flutter channel
Flutter channels:
  beta
  dev
  master
* stable



md5-08bfaee2bd9fd6c5ebc57f213b5ca3c7



flutter doctor
$ flutter doctor -v
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.3 18D109, locale zh-Hans-CN)
    • Flutter version 1.5.4-hotfix.2 at /Users/bling-abc/program/flutter
    • Framework revision 7a4c33425d (2 months ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/bling-abc/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/bling-abc/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • ios-deploy 1.9.4
    • CocoaPods version 1.6.1

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 36.1.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.1.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 34.0.2
    • Dart plugin version 183.5912.23

[✓] Connected device (1 available)
    • EML AL00 • CLB0219309002436 • android-arm64 • Android 9 (API 28)

• No issues found!



md5-7239f2139292ddc49b174672ed7c3847



  # flr
  flare_flutter: ^1.5.4

Most helpful comment

Well, shouldn't the latest version of Flutter (>=1.7.8+hotfix.3) be included in the environment section of the pubspec.yaml of this package? That shouldn't let us install the latest version of the package if we use an older Flutter version.

All 8 comments

same issue, and very annoying.

using channel stable + flare_flutter: ^1.5.4 (as indicated in https://github.com/2d-inc/Flare-Flutter/#flutter-channel) doesn't work.

I tried to change the type but it didn't work, any idea??

Also getting this, does anyone know the flare version that works?

Compiler message:
file:///C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.5.4/lib/flare.dart:1027:18: Error: The argument type 'Uint16List' can't be assigned to the parameter type 'Int32List'.
 - 'Uint16List' is from 'dart:typed_data'.
 - 'Int32List' is from 'dart:typed_data'.
Try changing the type of the parameter, or casting the argument to 'Int32List'.
        indices: _indices, textureCoordinates: _uvBuffer);
                 ^
Compiler failed on C:\Flutter\Projects\via_pinn\lib/main.dart
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17763.615], locale en-CA)
    • Flutter version 1.5.4-hotfix.2 at C:\Flutter\flutter
    • Framework revision 7a4c33425d (3 months ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

It's a combination of the latest flutter stable (1.7.8+hotfix.3) and Flare 1.5.4. Both of those versions must be satisfied for the latest version of Flare and Flutter to work together (we strongly recommend you use these version).

It looks like you are using the old stable (v1.5.4-hotfix.2) which has a breaking change with Flutter 1.7.8+hotfix.3. Flare. Please upgrade to the latest Flutter stable.

Yea was just about to comment that updating flutter seemed to work (run "flutter upgrade") and then use the stable flare tag still. But if that isn't an option 1.5.0 also worked (although I wouldn't recommend hard versioning ever). Thanks for the reply @luigi-rosso

1.5.0 would work with the older Flutter stable 1.5.4-hotfix.2.

The cause of all of this is that Flutter changed the signature of a method Flare uses. This was a good change but it broke compatibility. If you use a version of Flutter with the old signature, you'll need to use a version of Flare that's <=1.5.3. If you're using the latest stable >=1.7.8+hotfix.3 then any flare_flutter >=1.5.4 will work.

In your case, flutter upgrade should get you up to the latest version. And then update your pubspec to flare_flutter: ^1.5.4 and call flutter pub get. That should get everything up to date!

Well, shouldn't the latest version of Flutter (>=1.7.8+hotfix.3) be included in the environment section of the pubspec.yaml of this package? That shouldn't let us install the latest version of the package if we use an older Flutter version.

That's awesome, I didn't realize that was configurable. Thanks for the suggestion!

close it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

parlux picture parlux  Â·  4Comments

marcelgarus picture marcelgarus  Â·  4Comments

rohan20 picture rohan20  Â·  6Comments

yjoo9317 picture yjoo9317  Â·  5Comments

EArminjon picture EArminjon  Â·  7Comments