Skip to content

App crashes on lunch when is used combined with the library 'package_info_plus' #236

@VincenzoGuglielmi94

Description

@VincenzoGuglielmi94

in a new, clean, project if into the pubspec.yalm are imported the library 'package_info_plus' (version greater than 8.0.0) and the library 'app_settings' (version 5.2.0, but also with previous version), the app crashes on launch, but only in release mode. I've noticed that both libraries depends on 'plugin_platform_interface' but, app_settings depends from version 2.0.2 (updated 3 years ago), while package_info_plus depends from version 2.1.4 (trought the library package_info_plus_platform_interface 3.2.0).

The app project is a simple test project based on your example project, where is added only the library package_info_plus: ^8.3.0

To replicate the error you need only to insert into the pubspec.yalm the library package_info_plus: ^8.3.0 and run the application in release mode

This is the error generated when i try to launch the application into release mode
2025-03-10 16:57:58.743 20553-20553 AndroidRuntime pid-20553 E FATAL EXCEPTION: main Process: com.spencerccf.app_settings_example, PID: 20553 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.spencerccf.app_settings_example/com.spencerccf.app_settings_example.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void r0.a.f(java.lang.String, z0.d)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void r0.a.f(java.lang.String, z0.d)' on a null object reference at B.h.f(SourceFile:5) at J.u.d(SourceFile:42) at r0.a.<init>(SourceFile:7) at B.h.<init>(SourceFile:11) at q0.c.<init>(SourceFile:53) at q0.g.a(SourceFile:67) at p0.d.onCreate(SourceFile:640) at android.app.Activity.performCreate(Activity.java:7893) at android.app.Activity.performCreate(Activity.java:7880) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:224)  at android.app.ActivityThread.main(ActivityThread.java:7562)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 

This is the flutter doctor --verbose
[√] Flutter (Channel stable, 3.29.0, on Microsoft Windows [Versione 10.0.19045.5555], locale it-IT) [912ms]
• Flutter version 3.29.0 on channel stable at C:\s\flutter\flutter_sdk
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 35c388afb5 (4 weeks ago), 2025-02-10 12:48:41 -0800
• Engine revision f73bfc4522
• Dart version 3.7.0
• DevTools version 2.42.2

[√] Windows Version (10 Pro 64 bit, 22H2, 2009) [3,7s]

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [5,6s]
• Android SDK at C:\Users\Vincenzo\AppData\Local\Android\sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
• All Android licenses accepted.

[√] Chrome - develop for the web [399ms]
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.5) [397ms]
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.31729.503
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.0) [254ms]
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 51.0.1
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)

[√] Android Studio (version 2024.2) [31ms]
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[√] VS Code (version 1.96.4) [30ms]
• VS Code at C:\Users\Vincenzo\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.102.0

[√] Connected device (4 available) [551ms]
• android-arm64 • Android 10 (API 29)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Versione 10.0.19045.5555]
• Chrome (web) • chrome • web-javascript • Google Chrome 133.0.6943.142
• Edge (web) • edge • web-javascript • Microsoft Edge 134.0.3124.51

[√] Network resources [538ms]
• All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions