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

Update to Flutter 3.22.0 does not compile if using PageView #148665

Closed
guillermoherrero opened this issue May 20, 2024 · 2 comments
Closed

Update to Flutter 3.22.0 does not compile if using PageView #148665

guillermoherrero opened this issue May 20, 2024 · 2 comments
Labels
r: invalid Issue is closed as not valid

Comments

@guillermoherrero
Copy link

Steps to reproduce

Create a Flutter project with the 3.22.0 version
Write a simple Widget that uses PageView (1 simple page will suffice)

Expected results

The simple page is displayed on the screen embedded inside the PageView Widget.

Actual results

The application crushes as soon as it starts running, showing the following error:

Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
../../../../../.pub-cache/hosted/pub.dev/page_indicator-0.4.1/lib/src/container.dart:56:42: Error: Property 'initialPage' cannot be accessed on 'PageController?' because it is potentially null.

  • 'PageController' is from 'package:flutter/src/widgets/page_view.dart' ('../../../../../snap/flutter/common/flutter/packages/flutter/lib/src/widgets/page_view.dart').
    Try accessing using ?. instead.
    final initPage = pageView.controller.initialPage;
    ^^^^^^^^^^^
    Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

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

Process 'command '/home//snap/flutter/common/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.

BUILD FAILED in 2s
Error: Gradle task assembleDebug failed with exit code 1

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.0, on Ubuntu 22.04.4 LTS 6.5.0-27-generic,
    locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version
    34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2023.2)
[✓] IntelliJ IDEA Community Edition (version 2024.1)
[✓] VS Code (version 1.89.1)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!
@stuartmorgan
Copy link
Contributor

../../../../../.pub-cache/hosted/pub.dev/page_indicator-0.4.1

Issues in third-party packages need to be reported to the developers of the package.

Closing as this is not code that is part of the Flutter project.

@stuartmorgan stuartmorgan closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
@stuartmorgan stuartmorgan added the r: invalid Issue is closed as not valid label May 20, 2024
Copy link

github-actions bot commented Jun 3, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: invalid Issue is closed as not valid
Projects
None yet
Development

No branches or pull requests

2 participants