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

Error: Undefined name 'View'. #143

Closed
Princeyyyy opened this issue May 14, 2023 · 2 comments
Closed

Error: Undefined name 'View'. #143

Princeyyyy opened this issue May 14, 2023 · 2 comments

Comments

@Princeyyyy
Copy link

Hello, I just upgraded to screenshot version 2.0.0 from 1.3.0 and i am getting the following error:
`../../AppData/Local/Pub/Cache/hosted/pub.dev/screenshot-2.0.0/lib/screenshot.dart:154:42: Error: Undefined name 'View'.
context == null ? fallBackView : View.maybeOf(context) ?? fallBackView;
^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/screenshot-2.0.0/lib/screenshot.dart:164:7: Error: No named parameter with the name 'view'.
view: view,
^^^^
/C:/src/flutter/flutter/packages/flutter/lib/src/rendering/view.dart:68:3: Context: Found this candidate, but the arguments don't match.
RenderView({
^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1157

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' 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.

BUILD FAILED in 2m 9s
Exception: Gradle task assembleDebug failed with exit code 1
`

I'm running flutter version 3.7.12
Flutter (Channel stable, 3.7.12, on Microsoft Windows [Version 10.0.22621.1702], locale en-KE)

I have reverted back to version 1.3.0 so that it works

@ritheshSalyan
Copy link
Collaborator

Hello @Princeyyyy ,

screenshot: 2.0.0 is a migration to latest FlutterView from ui.window. This is supported in flutter version 3.10. If you are using flutter below 3.10 please consider using screenshot: 1.3.0.

I am closing this issue. If you think that is incorrect please feel free to reopen.

Thank you,

@Princeyyyy
Copy link
Author

I have now upgraded to flutter 3.10 and it is now working. Thanks

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

2 participants