serenader2014 / flutter_carousel_slider

A flutter carousel widget, support infinite scroll, and custom child widget.
https://pub.dev/packages/carousel_slider
MIT License
1.6k stars 582 forks source link

Conflicting imports of CarouselController after updating Flutter to version 3.24.3 #472

Closed sawongam closed 3 weeks ago

sawongam commented 3 weeks ago

After updating Flutter to version 3.24.3, I encountered an error when running my app. The issue appears to be related to conflicting imports of CarouselController in the carousel_slider package.

Error Details:

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/carousel_slider-4.2.1/lib/carousel_slider.dart:9:1: Error: 'CarouselController' is imported from both 'package:carousel_slider/carousel_controller.dart' and 'package:flutter/src/material/carousel.dart'.
import 'carousel_controller.dart';
^^^^^^^^^^^^^^^^^^
../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/carousel_slider-4.2.1/lib/carousel_slider.dart:48:15: Error: 'CarouselController' is imported from both 'package:carousel_slider/carousel_controller.dart' and 'package:flutter/src/material/carousel.dart'.
            : CarouselController() as CarouselControllerImpl,
              ^^^^^^^^^^^^^^^^^^
../../../../../AppData/Local/Pub/Cache/hosted/pub/dev/carousel_slider-4.2.1/lib/carousel_slider.dart:62:15: Error: 'CarouselController' is imported from both 'package:carousel_slider/carousel_controller.dart' and 'package:flutter/src/material/carousel.dart'.
            : CarouselController() as CarouselControllerImpl,
              ^^^^^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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.
> Get more help at https://help.gradle.org.

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

Steps to Reproduce

Update Flutter to version 3.24.3 Attempt to run the app The app fails to compile due to conflicting imports of CarouselController in the carousel_slider package.

Additional Information

Flutter Version: 3.24.3 Package Versions: flutter: 3.24.3 carousel_slider: 4.2.1 Device: sdk gphone64 x86 64 OS: Windows

Please provide further assistance or guidance on how to resolve this issue.

serenader2014 commented 3 weeks ago

Please upgrade to v5.0.0 version. This issue is fixed in v5.0.0