fluttercommunity / plus_plugins

Flutter Community Plus Plugins
BSD 3-Clause "New" or "Revised" License
1.61k stars 975 forks source link

[Compile]: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null #3244

Closed chotixity closed 2 months ago

chotixity commented 2 months ago

Operating System

Ubuntu 22.04

Plugin

android_alarm_manager_plus

Version

4.0.4

Flutter SDK

3.24.1

Compilation command

on my VScode Run> Run With Debugging

Dart Dependencies

name: hoplit
description: An habit tracker application

# 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: 20.0.0

environment:
  sdk: ">=2.17.1 <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

  # Launcher helper libs
  flutter_native_splash: ^2.4.0

  # Analytics tools
  # flutter_clarity: ^1.0.0+3
  clarity_support: ^0.0.1

  http: ^1.2.1
  font_awesome_flutter: ^10.7.0
  shared_preferences: ^2.2.3
  intl: 0.19.0
  auto_size_text: ^3.0.0
  percent_indicator: ^4.2.3
  url_launcher: ^6.2.6
  animated_text_kit: ^4.2.2
  dropdown_button2: ^2.3.9
  roundcheckbox: ^2.0.5
  table_calendar: ^3.0.9
  syncfusion_flutter_charts: ^25.2.4
  syncfusion_flutter_sliders: ^25.2.4
  syncfusion_flutter_core: ^25.2.4
  lottie: ^3.1.2
  dots_indicator: ^3.0.0

  # Firebase libraries flutter
  firebase_auth: ^4.19.5
  firebase_dynamic_links: ^5.5.5
  firebase_analytics: ^10.10.5
  firebase_crashlytics: ^3.5.5
  firebase_messaging: ^14.9.2
  cloud_firestore: ^4.17.3
  firebase_core: ^2.31.0

  # Signing in libs
  google_sign_in: ^6.2.1
  sign_in_with_apple: ^6.1.0
  flutter_facebook_auth: ^7.0.0

  # Dependency Injection
  json_annotation: ^4.9.0
  get_it: ^7.7.0
  injectable: ^2.4.2

  cupertino_icons: ^1.0.8

  # DDD - architecture
  dartz: ^0.10.1
  flutter_bloc: ^8.1.5
  bloc: ^8.1.4
  equatable: ^2.0.5

  # Other dependencies
  flutter_secure_storage: ^9.0.0
  another_flushbar: ^1.12.30
  uuid: ^4.4.0
  auto_route: ^8.1.3
  easy_localization: ^3.0.7
  google_fonts: ^6.2.1
  # end  front-end(UI stuffs)

  # referenced packages
  vector_math: any
  collection: any
  flutter_phoenix: "^1.0.0"
  permission_handler: ^11.3.1
  workmanager: ^0.5.2
  logger: ^2.3.0
  shared_preferences_foundation: ^2.4.0
  shared_preferences_android: ^2.2.1

  # Notification core libraries
  flutter_local_notifications: ^17.1.2
  timezone: ^0.9.3

  freezed_annotation: ^2.4.1
  flutter_isolate: ^2.0.4
  android_alarm_manager_plus: ^4.0.4
  upgrader: ^10.3.0
  in_app_review: ^2.0.9
  flutter_timezone: ^1.0.8
  cached_network_image: ^3.3.1

  visibility_detector: ^0.4.0+2
  emoji_picker_flutter: ^2.2.0
  in_app_purchase: ^3.2.0
  card_swiper: ^3.0.1
  flutter_card_swiper: ^7.0.1
  reorderables: ^0.6.0
  rename_app: ^1.3.2
  pulsator: ^1.0.0+2
  flutter_markdown: ^0.7.3+1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: ^0.13.1
  change_app_package_name: ^1.1.0

  # 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: ^4.0.0

  # DDD architecture
  injectable_generator: ^2.6.1
  auto_route_generator: ^8.0.0
  json_serializable: ^6.8.0
  build_runner: ^2.4.8
  freezed: ^2.4.7
  # end DDD

# 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 packages.
flutter_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/images/logo6i.png"
  remove_alpha_ios: true
  # adaptive_icon_background: "#3a9ecc"
  adaptive_icon_foreground: "assets/images/logo_foreground2.png"
  web:
    generate: true
    image_path: "icons/logo6i.png"
    background_color: "#3a9ecc"
    theme_color: "#3a9ecc"

flutter:

  # 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/json/
    - assets/translations/
    - android/app/src/main/res/drawable/
    - assets/fonts/hoplit/
    - assets/google_fonts/
    - assets/achievements/

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # 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: Hoplit
      fonts:
        - asset: assets/fonts/hoplit/Hoplit.ttf

    - family: Hoplit2
      fonts:
        - asset: assets/fonts/hoplit/Hoplit2.ttf
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

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:
  # flutter pub run flutter_native_splash:create
  # To restore Flutter's default white splash screen, run the following command in the terminal:
  # flutter pub run flutter_native_splash:remove

  # 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/splash_background.png"

  # Optional parameters are listed below.  To enable a parameter, uncomment the line by removing
  # the leading # character.

  # The image parameter allows you to specify an image used in the splash screen.  It must be a
  # png file and should be sized for 4x pixel density.
  image: assets/images/splash_logo.png

  # The branding property allows you to specify an image used as branding in the splash screen.
  # It must be a png file. Currently, it is only supported for Android < v12 and iOS.
  branding: assets/images/branding.png

  # To position the branding image at the bottom of the screen you can use bottom, bottomRight,
  # and bottomLeft. The default values is bottom if not specified or specified something else.
  branding_mode: bottom

  # The color_dark, background_image_dark, image_dark, branding_dark are parameters that set the background
  # and image when the device is in dark mode. If they are not specified, the app will use the
  # parameters from above. If the image_dark parameter is specified, color_dark or
  # background_image_dark must be specified.  color_dark and background_image_dark cannot both be
  # set.
  #color_dark: "#042a49"
  #background_image_dark: "assets/dark-background.png"
  #image_dark: assets/splash-invert.png
  #branding_dark: assets/dart_dark.png

  # Android 12 handles the splash screen differently than previous versions.  Please visit
  # https://developer.android.com/guide/topics/ui/splash-screen
  # Following are Android 12 specific parameter.
  android_12:
    # The image parameter sets the splash screen icon image.  If this parameter is not specified,
    # the app's launcher icon will be used instead.
    # Please note that the splash screen will be clipped to a circle on the center of the screen.
    # App icon with an icon background: This should be 960?960 pixels, and fit within a circle
    # 640 pixels in diameter.
    # App icon without an icon background: This should be 1152?1152 pixels, and fit within a circle
    # 768 pixels in diameter.
    image: assets/images/splash_logo_android12.png

    # Splash screen background color.
    color: "#3583d2"

    # App icon background color.
    #icon_background_color: "#111111"

    branding: assets/images/branding_android12.png
  # The image_dark parameter and icon_background_color_dark set the image and icon background
  # color when the device is in dark mode. If they are not specified, the app will use the
  # parameters from above.
  #image_dark: assets/android12splash-invert.png
  #color_dark: "#042a49"
  #icon_background_color_dark: "#eeeeee"

  # The android, ios and web parameters can be used to disable generating a splash screen on a given
  # platform.
  #android: false
  #ios: false
  #web: false

  # The position of the splash image can be set with android_gravity, ios_content_mode, and
  # web_image_mode parameters.  All default to center.
  #
  # android_gravity can be one of the following Android Gravity (see
  # https://developer.android.com/reference/android/view/Gravity): bottom, center,
  # center_horizontal, center_vertical, clip_horizontal, clip_vertical, end, fill, fill_horizontal,
  # fill_vertical, left, right, start, or top.
  #android_gravity: center
  #
  # ios_content_mode can be one of the following iOS UIView.ContentMode (see
  # https://developer.apple.com/documentation/uikit/uiview/contentmode): scaleToFill,
  # scaleAspectFit, scaleAspectFill, center, top, bottom, left, right, topLeft, topRight,
  # bottomLeft, or bottomRight.
  #ios_content_mode: center
  #
  # web_image_mode can be one of the following modes: center, contain, stretch, and cover.
  #web_image_mode: center

  # The screen orientation can be set in Android with the android_screen_orientation parameter.
  # Valid parameters can be found here:
  # https://developer.android.com/guide/topics/manifest/activity-element#screen
  #android_screen_orientation: sensorLandscape

  # To hide the notification bar, use the fullscreen parameter.  Has no effect in web since web
  # has no notification bar.  Defaults to false.
  # NOTE: Unlike Android, iOS will not automatically show the notification bar when the app loads.
  #       To show the notification bar, add the following code to your Flutter app:
  #       WidgetsFlutterBinding.ensureInitialized();
  #       SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]);
  fullscreen: true

  # If you have changed the name(s) of your info.plist file(s), you can specify the filename(s)
  # with the info_plist_files parameter.  Remove only the # characters in the three lines below,
  # do not remove any spaces:
  #info_plist_files:
  #  - 'ios/Runner/Info-Debug.plist'
  #  - 'ios/Runner/Info-Release.plist'

flutter_launcher_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/images/logo_foreground.png"
  adaptive_icon_foreground: "assets/images/logo_foreground2.png"
  adaptive_icon_background: "#3583d2"
  min_sdk_android: 21 # android min sdk min:16, default 21

Native dependencies

No response

Compilation Error

Launching lib/main.dart on sdk gphone16k x86 64 in debug mode...
ERROR:/home/choti/.gradle/caches/transforms-3/01af56cd9f6768023c319c1450ed2e79/transformed/jetified-appcompat-resources-1.7.0-runtime.jar: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
ERROR:/home/choti/.gradle/caches/transforms-3/9c2a499a65c5ac8dc7475674d58b6332/transformed/appcompat-1.7.0-runtime.jar: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform appcompat-resources-1.7.0.aar (androidx.appcompat:appcompat-resources:1.7.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=27, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: /home/choti/.gradle/caches/transforms-3/01af56cd9f6768023c319c1450ed2e79/transformed/jetified-appcompat-resources-1.7.0-runtime.jar.
         > Error while dexing.
   > Failed to transform appcompat-1.7.0.aar (androidx.appcompat:appcompat:1.7.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=27, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: /home/choti/.gradle/caches/transforms-3/9c2a499a65c5ac8dc7475674d58b6332/transformed/appcompat-1.7.0-runtime.jar.
         > Error while dexing.

* 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 40s
Error: Gradle task assembleDebug failed with exit code 1

Exited (1).

Flutter Doctor

choti@choti:~$ flutter doctor -v
[✓] Flutter (Channel stable, 3.24.1, on Ubuntu 22.04.4 LTS 6.8.0-40-generic,
    locale en_US.UTF-8)
    • Flutter version 3.24.1 on channel stable at
      /home/choti/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5874a72aa4 (2 weeks ago), 2024-08-20 16:46:00 -0500
    • Engine revision c9b9d5780d
    • Dart version 3.5.1
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/choti/Android/Sdk
    • Platform android-35, build-tools 34.0.0
    • ANDROID_HOME = /home/choti/Android/Sdk
    • Java binary at: /snap/android-studio/161/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.10+0-17.0.10b1087.21-11609105)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2024.1)
    • Android Studio at /snap/android-studio/161
    • Flutter plugin version 81.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.10+0-17.0.10b1087.21-11609105)

[✓] VS Code (version 1.92.2)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.96.0

[✓] Connected device (4 available)
    • RMX3231 (mobile)              • 0151420S34106E16 • android-arm    •
      Android 11 (API 30)
    • sdk gphone16k x86 64 (mobile) • emulator-5554    • android-x64    •
      Android 15 (API 35) (emulator)
    • Linux (desktop)               • linux            • linux-x64      • Ubuntu
      22.04.4 LTS 6.8.0-40-generic
    • Chrome (web)                  • chrome           • web-javascript • Google
      Chrome 128.0.6613.113

[✓] Network resources
    • All expected network resources are available.

• No issues found!
choti@choti:~$

Checklist before submitting a bug

miquelbeltran commented 2 months ago

This may help: https://github.com/flutter/flutter/issues/145789#issuecomment-2048909224

chotixity commented 2 months ago

Bumped My AGP to 8.5 and it is now fixed