Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The argument type 'Int32List' can't be assigned to the parameter type 'Uint16List' #79

Closed
vanelizarov opened this issue Apr 24, 2019 · 8 comments

Comments

@vanelizarov
Copy link

vanelizarov commented Apr 24, 2019

Suddenly compiler started showing me this error:

Compiler message:

file:///Users/vanelizarov/flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.4.0/lib/flare.dart:1028:18: Error: The argument type 'Int32List' can't be assigned to the parameter type 'Uint16List'.
 - 'Int32List' is from 'dart:typed_data'.
 - 'Uint16List' is from 'dart:typed_data'.
Try changing the type of the parameter, or casting the argument to 'Uint16List'.
        indices: _indices, textureCoordinates: _uvBuffer);
                 ^

I'm using only FlareActor class and do it like so:

FlareActor(
  'assets/flare/notifications.flr',
  alignment: Alignment.center,
  animation: count > 0 ? 'pendulum' : null,
  color: Colors.primary,
)

flutter doctor:

[✓] Flutter (Channel dev, v1.5.5, on Mac OS X 10.14.5 18F118d, locale en-RU)
    • Flutter version 1.5.5 at /Users/vanelizarov/flutter
    • Framework revision 5c5ddd1fc2 (19 hours ago), 2019-04-23 10:41:19 -0700
    • Engine revision e27c867c30
    • Dart version 2.3.0 (build 2.3.0-dev.0.1 1f1592edce)


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/vanelizarov/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • 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-1248-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.5.3

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 33.4.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] VS Code (version 1.33.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.25.1

[✓] Connected device (1 available)
    • iPhone Xʀ • D71EC0B3-B4A2-41DB-9C0C-878DCDD474E3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)

• No issues found!
@umberto-sonnino
Copy link
Contributor

This is due to some breaking changes on Flutter's master branch. We had to change the type of the list accordingly.
You're using Flutter's dev channel, so you can either use Flutter master (from the command line: flutter channel master), or you can change the type of the list yourself on this line, and this assignment with Uint16.fromList(triangles) while we figure out a better fix for this.

@vanelizarov
Copy link
Author

@umberto-sonnino cool! Would it be ok if I then submit PR?

@umberto-sonnino
Copy link
Contributor

Hey @vanelizarov, thanks for your contribution, but unfortunately there are some breaking differences between the various Flutter versions, depending on the channel you're using: this means that simply changing those types won't fix the issue, because it'll break for somebody else using a different channel.

@luigi-rosso created ad-hoc branches that support the corresponding Flutter channel.

You can take a look at the updated README to see how this all works!

@vprudnikoff
Copy link

This is due to some breaking changes on Flutter's master branch. We had to change the type of the list accordingly.
You're using Flutter's dev channel, so you can either use Flutter master (from the command line: flutter channel master), or you can change the type of the list yourself on this line, and this assignment with Uint16.fromList(triangles) while we figure out a better fix for this.

This is due to some breaking changes on Flutter's master branch. We had to change the type of the list accordingly.
You're using Flutter's dev channel, so you can either use Flutter master (from the command line: flutter channel master), or you can change the type of the list yourself on this line, and this assignment with Uint16.fromList(triangles) while we figure out a better fix for this.

Hello! I've changed flutter channel to master, but still got the same issue. http://priscree.ru/img/99a80c98010a28.png

@umberto-sonnino
Copy link
Contributor

Hey @prudnikoff, you can take a look at the README for how to set everything up according to the Flutter Channel you want to use!
In any case, Flutter stable works with this repo's stable branch

@lucasmatoscc
Copy link

Locally changing line 875 to Uint16List _indices; and line 936 to Uint16List.fromList(triangles); temporarily solves the issue and allows you to run the app, even though it may not be the best solution (not familiar with Flare data).

AndreaCostanzo1 added a commit to AndreaCostanzo1/FlutterApp that referenced this issue Jun 9, 2019
now flare is taken from dev branch
@stellarbear
Copy link

True, wanted to make this PR, but already done.

@pallavbohara
Copy link

recent beta version of flutter(1.19.0-4.2.pre) is not giving this error.

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

No branches or pull requests

6 participants