jonbhanson / flutter_native_splash

Automatically generates native code for adding splash screens in Android and iOS. Customize with specific platform, background color and splash image.
https://pub.dev/packages/flutter_native_splash
MIT License
1.28k stars 200 forks source link

build_runner version solving failed #601

Closed IAMIbrahimmemon closed 7 months ago

IAMIbrahimmemon commented 7 months ago

Describe the bug

When I run dart run flutter_native_splash:create

I get this: `The current Dart SDK version is 2.19.2.

Because no versions of build_runner match >2.4.6 <3.0.0 and build_runner 2.4.6 requires SDK version ^3.0.0, build_runner ^2.4.6 is forbidden. So, because iwingo_app depends on build_runner ^2.4.6, version solving failed.`

Configuration

Paste the flutter_native_splash section of your yaml config.

flutter_native_splash:
  # This package generates native code to customize Flutter's default white native splash screen
  # with background color and splash image.
  # Customize the parameters below, and run the following command in the terminal:
  # dart run flutter_native_splash:create
  # To restore Flutter's default white splash screen, run the following command in the terminal:
  # dart run flutter_native_splash:remove

  # IMPORTANT NOTE: These parameter do not affect the configuration of Android 12 and later, which
  # handle splash screens differently that prior versions of Android.  Android 12 and later must be
  # configured specifically in the android_12 section below.

  # color or background_image is the only required parameter.  Use color to set the background
  # of your splash screen to a solid color.  Use background_image to set the background of your
  # splash screen to a png image.  This is useful for gradients. The image will be stretch to the
  # size of the app. Only one parameter can be used, color and background_image cannot both be set.
#  color: "#42a5f5"
  background_image: "assets/images/FastCarImage.png"

Device (please complete the following information):

To Reproduce Steps to reproduce the behavior, using the example app:

  1. Run flutter pub add flutter_native_splash
  2. Run dart run flutter_native_splash:create
  3. See error

Screenshots Screenshot 2023-10-10 at 5 03 50 PM

Additional context I want to add native splash to my flutter app to stop showing the white screen

jonbhanson commented 7 months ago

It looks like this problem comes from build_runner. Are you able to successfully execute flutter pub get?

IAMIbrahimmemon commented 7 months ago

yes

jonbhanson commented 7 months ago

I followed your instructions to reproduce the problem on this package's example, but I did not receive any errors. Since the error describes a conflict with build_runner, it seems your instructions to reproduce the error must include adding a dependency on build_runner ^2.4.6, which I also did but did not reproduce the error.

jonbhanson commented 7 months ago

The current Dart SDK version is 2.19.2. build_runner 2.4.6 requires SDK version ^3.0.0

The problem is that build_runner 2.4.6 requires Dart version 3.0.0 or greater and you are running Dart 2.19.2. It has nothing to do with this package.