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.36k stars 215 forks source link

App crashes on start #360

Closed EmanueleVinci closed 2 years ago

EmanueleVinci commented 2 years ago

Describe the bug If I start the app I get "Lost connection to device" in console.

Note: I can't use the last version becouse it causes conflict with another package.

To Reproduce Steps to reproduce the behavior:

  1. add the image in assets/splash_image/.
  2. run flutter pub run flutter_native_splash:create
  3. run

Am I doing something wrong? I leave you the image and the pubspec file.

Device (please complete the following information):

splash_screen

pubspec.yaml

name: app
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+2

environment:
  sdk: ">=2.12.0 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

  platform: ^3.1.0

  #Firebase
  firebase_core: ^1.16.0
  firebase_core_web: ^1.6.3
  firebase_analytics: ^9.1.7
  firebase_analytics_web: ^0.4.0+12

  #Logic
  flutter_bloc: ^8.0.1
  equatable: ^2.0.3
  get: ^4.6.1

  #Utils
  image_picker: ^0.8.4+11
  image_picker_web: ^2.1.1
  intl: ^0.17.0
  shared_preferences: ^2.0.13
  google_fonts: ^2.3.1
  fluttertoast: ^8.0.9
  font_awesome_flutter: ^10.1.0
  fl_chart: ^0.50.1
  file_picker: ^4.5.0
  camera: ^0.9.4+21
  camera_web: ^0.2.1+3
  image: ^3.1.3
  uuid: ^3.0.6
  url_launcher: ^6.0.20
  auto_size_text: ^3.0.0

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  flutter_svg: ^1.0.3
  share_plus: ^4.0.4
  flutter_cached_pdfview: ^0.4.1
  video_player: ^2.4.0
  universal_html: ^2.0.8
  flutter_native_splash: ^2.1.0+1

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^1.0.0

  flutter_launcher_icons: "^0.9.2"

flutter_icons:
  android: true
  ios: true
  image_path: "assets/icon/icon.png"
  remove_alpha_ios: true

flutter_native_splash:
  background_image: "assets/splash_screen/splash_screen.png"

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  #intl
  generate: true

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/images/
    - assets/artworks/

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  fonts:
    - family: Gilroy
      fonts:
        - asset: assets/fonts/Gilroy-Thin.otf
          weight: 100
        - asset: assets/fonts/Gilroy-ThinItalic.otf
          style: italic
          weight: 100
        - asset: assets/fonts/Gilroy-UltraLight.otf
          weight: 200
        - asset: assets/fonts/Gilroy-UltraLightItalic.otf
          style: italic
          weight: 200
        - asset: assets/fonts/Gilroy-Light.otf
          weight: 300
        - asset: assets/fonts/Gilroy-LightItalic.otf
          style: italic
          weight: 300
        - asset: assets/fonts/Gilroy-Regular.otf
          weight: 400
        - asset: assets/fonts/Gilroy-RegularItalic.otf
          style: italic
          weight: 400
        - asset: assets/fonts/Gilroy-Medium.otf
          weight: 500
        - asset: assets/fonts/Gilroy-MediumItalic.otf
          style: italic
          weight: 500
        - asset: assets/fonts/Gilroy-SemiBold.otf
          weight: 600
        - asset: assets/fonts/Gilroy-SemiBoldItalic.otf
          style: italic
          weight: 600
        - asset: assets/fonts/Gilroy-Bold.otf
          weight: 700
        - asset: assets/fonts/Gilroy-BoldItalic.otf
          style: italic
          weight: 700
        - asset: assets/fonts/Gilroy-ExtraBold.otf
          weight: 800
        - asset: assets/fonts/Gilroy-ExtraBoldItalic.otf
          style: italic
          weight: 800
        - asset: assets/fonts/Gilroy-Heavy.otf
          weight: 900
        - asset: assets/fonts/Gilroy-HeavyItalic.otf
          style: italic
          weight: 900
jonbhanson commented 2 years ago

@EmanueleVinci I don't think this package could cause the problem you are describing. Can you make a quick test and replace your main() function with a simple one that returns a 'hello world' app and see if the app still gets stuck?