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

Widget name conflict with Flutter's View-widget #193

Closed
jluukka-ge opened this issue Feb 10, 2023 · 7 comments
Closed

Widget name conflict with Flutter's View-widget #193

jluukka-ge opened this issue Feb 10, 2023 · 7 comments

Comments

@jluukka-ge
Copy link

I've upgraded Flutter version from 3.3.10 to latest. Now I'm unable to use this library.

Flutter has introduced a new View-widget, whose name collides with the one defined in this library. The error originates from graphic-library's source.

I first encountered the problem when trying to build an APK of my app in an updated build environment. My app includes a simple line graph with minimal configuration. I would assume reproducing the problem should be as simple as trying to build any app which uses the graphic library with the latest version of Flutter. I'll try to verify this with a simple project in the near future.

Below is the error message produced by the failing build process.

Running Gradle task 'assembleRelease'...
[PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/developer/Android/sdk/platform-tools:/home/developer/flutter/bin, GLIBCPP_FORCE_NEW:1, OLDPWD:/home/tool/developer/src/android, FLUTTER_ROOT:/home/developer/flutter, ANDROID_SDK_ROOT:/home/developer/Android/sdk, GLIBCXX_FORCE_NEW:1, HOSTNAME:3ee417716c9a, FLUTTER_ALREADY_LOCKED:true, PWD:/home/tool/developer/src/android, HOME:/home/developer, SHLVL:1]
Checking the license for package Android SDK Build-Tools 29.0.2 in /home/developer/Android/sdk/licenses
License for package Android SDK Build-Tools 29.0.2 accepted.
Preparing "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)".
"Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" ready.
Installing Android SDK Build-Tools 29.0.2 in /home/developer/Android/sdk/build-tools/29.0.2
"Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" complete.
"Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" finished.
Checking the license for package Android SDK Platform 32 in /home/developer/Android/sdk/licenses
License for package Android SDK Platform 32 accepted.
Preparing "Install Android SDK Platform 32 (revision: 1)".
"Install Android SDK Platform 32 (revision: 1)" ready.
Installing Android SDK Platform 32 in /home/developer/Android/sdk/platforms/android-32
"Install Android SDK Platform 32 (revision: 1)" complete.
"Install Android SDK Platform 32 (revision: 1)" finished.
../../../developer/.pub-cache/hosted/pub.dev/graphic-1.0.1/lib/src/chart/chart.dart:22:1: Error: 'View' is imported from both 'package:flutter/src/widgets/view.dart' and 'package:graphic/src/chart/view.dart'.
import 'view.dart';
^^^^
../../../developer/.pub-cache/hosted/pub.dev/graphic-1.0.1/lib/src/chart/chart.dart:742:20: Error: 'View' is imported from both 'package:flutter/src/widgets/view.dart' and 'package:graphic/src/chart/view.dart'.
      state.view = View<D>(
                   ^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script '/home/developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1154

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/home/developer/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 9s
Running Gradle task 'assembleRelease'...                          190.0s
Gradle task assembleRelease failed with exit code 1

@entronad
Copy link
Owner

It seems OK in my case, I upgraded to Flutter 3.7.3 stable.
And I did't find View Widget in latest Flutter documents.

@IsaiChristian
Copy link

IM having the same issue with flutter 3.8 in the master channel, can you provide a workaround??

@entronad
Copy link
Owner

I will check the 3.8
(Why your Flutter version so new? I suggest you to use stable channel for production)

@h3ng3ll
Copy link

h3ng3ll commented Apr 2, 2023

Hey guys , My flutter is Channel master, 3.8.0-4.0.pre, I have similar issue and solved it temporary . It was change in the chart.dart code from

22 import 'view.dart to
22 import view.dart as v

189 View<D>? view;
189 v.View<D>? view;

748 state.view = View<D>(
748 state.view = v.View<D>(

after this operation everything okay till I rebuild my dependencies this problem back again . As I understand conflict between libraries of dart and packages . What to do with that ?

@entronad
Copy link
Owner

entronad commented Apr 6, 2023

I have fiexed it in v2.0.2 by changing the View to ChartView.

Still I an curious why you use a master channel of Flutter instead of stable or beta, would you tell me your consideration?

@entronad entronad closed this as completed Apr 7, 2023
@IsaiChristian
Copy link

(Why your Flutter version so new? I suggest you to use stable channel for production)

That was the right solution tbh,

@IsaiChristian
Copy link

Still I an curious why you use a master channel of Flutter instead of stable or beta, would you tell me your consideration?

This was a bad call made earlier when we need it some fixes that were only live in master

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

4 participants