serenader2014 / flutter_carousel_slider

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

Error: 'CarouselController' is imported from both 'package:carousel_slider/carousel_controller.dart' and 'package:flutter/src/material/carousel.dart'. #462

Closed JuKu closed 2 months ago

JuKu commented 3 months ago

PRE: Build the app bundle for android IS: There is an error while building SHOULD: The shouldn't be an error.

Log:

== Building for Android ==

> flutter build appbundle --release

Running Gradle task 'bundleRelease'...                          
Checking the license for package Android SDK Platform 34 in /usr/local/share/android-sdk/licenses
License for package Android SDK Platform 34 accepted.
Preparing "Install Android SDK Platform 34 (revision: 3)".
"Install Android SDK Platform 34 (revision: 3)" ready.
Installing Android SDK Platform 34 in /usr/local/share/android-sdk/platforms/android-34
"Install Android SDK Platform 34 (revision: 3)" complete.
"Install Android SDK Platform 34 (revision: 3)" finished.
../.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';
^^^^^^^^^^^^^^^^^^
../.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,
              ^^^^^^^^^^^^^^^^^^
../.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:compileFlutterBuildRelease'.
> Process 'command '/Users/builder/programs/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 2m 29s
Running Gradle task 'bundleRelease'...                            149.9s
Gradle task bundleRelease failed with exit code 1

Build failed :|
Failed to build for Android
myteta commented 3 months ago

yess.... errrorr.... please solve.... this problem...

Rokon-556 commented 3 months ago

yess.... errrorr.... please solve.... this problem...

Upgrade "carousel_slider" package. And if you use "controller" then you have to declare like that: "CarouselSliderController yourController = CarouselSliderController();". Hopefully the issue will be solved.

serenader2014 commented 2 months ago

The issue is fixed in v5.0.0, please upgrade the package, and try again.

JuKu commented 2 months ago

@serenader2014 Thank you very much! :)