Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Crashlytics]: Warning unchecked cast #16838

Open
1 task done
under3415 opened this issue Dec 5, 2024 · 2 comments · May be fixed by #16864
Open
1 task done

[Crashlytics]: Warning unchecked cast #16838

under3415 opened this issue Dec 5, 2024 · 2 comments · May be fixed by #16864
Labels
Needs Attention This issue needs maintainer attention. platform: android Issues / PRs which are specifically for Android. plugin: crashlytics type: bug Something isn't working

Comments

@under3415
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Crashlytics

Which platforms are affected?

Android

Description

When building app, unchecked cast warning is displayed

FlutterFirebaseCrashlyticsPlugin.java:152: warning: [unchecked] unchecked cast
(List) Objects.requireNonNull(arguments.get(Constants.LOADING_UNITS));
^
required: List
found: Object

Reproducing the issue

Build android app

Firebase Core version

3.8.1

Flutter Version

4.2.0

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
Dart SDK 3.5.4
Flutter SDK 3.24.5

dependencies:
- app_install_date 0.1.5 [flutter path_provider]
- audio_session 0.1.21 [flutter flutter_web_plugins rxdart meta]
- carousel_slider 5.0.0 [flutter]
- device_info_plus 11.1.1 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta web win32 win32_registry]
- encrypt 5.0.3 [args asn1lib clock collection crypto pointycastle]
- firebase_core 3.8.1 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 4.2.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_local_notifications 18.0.1 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
- flutter_svg 2.0.16 [flutter http vector_graphics vector_graphics_codec vector_graphics_compiler]
- flutter_timezone 3.0.1 [flutter flutter_web_plugins]
- hive 2.2.3 [meta crypto]
- hive_flutter 1.1.0 [flutter hive path_provider path]
- in_app_purchase 3.2.0 [flutter in_app_purchase_android in_app_purchase_platform_interface in_app_purchase_storekit]
- in_app_review 2.0.10 [flutter in_app_review_platform_interface]
- intl 0.19.0 [clock meta path]
- json_annotation 4.9.0 [meta]
- json_serializable 6.9.0 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]
- just_audio 0.9.42 [just_audio_platform_interface just_audio_web audio_session rxdart path path_provider async uuid crypto meta flutter]
- lottie 3.1.3 [archive flutter http path vector_math]
- numberpicker 2.1.2 [flutter infinite_listview]
- path_provider 2.1.5 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- provider 6.1.2 [collection flutter nested]
- wakelock_plus 1.2.8 [flutter flutter_web_plugins meta wakelock_plus_platform_interface win32 dbus package_info_plus web]

dev dependencies:
- build_runner 2.4.13 [analyzer args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- flutter_launcher_icons 0.14.2 [args checked_yaml cli_util image json_annotation path yaml]
- flutter_lints 5.0.0 [lints]
- hive_generator 2.0.1 [build source_gen hive analyzer source_helper]

transitive dependencies:
- _fe_analyzer_shared 72.0.0 [meta]
- _flutterfire_internals 1.3.47 [collection firebase_core firebase_core_platform_interface flutter meta]
- _macros 0.3.2
- analyzer 6.7.0 [_fe_analyzer_shared collection convert crypto glob macros meta package_config path pub_semver source_span watcher yaml]
- archive 3.6.1 [crypto path]
- args 2.6.0
- asn1lib 1.5.8
- async 2.11.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- build 2.4.1 [analyzer async convert crypto glob logging meta package_config path]
- build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 4.0.2 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.4.2 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml]
- build_runner_core 7.3.2 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.9.2 [built_collection collection fixnum meta]
- characters 1.3.0
- checked_yaml 2.0.3 [json_annotation source_span yaml]
- cli_util 0.4.2 [meta path]
- clock 1.1.1
- code_builder 4.10.1 [built_collection built_value collection matcher meta]
- collection 1.18.0
- convert 3.1.2 [typed_data]
- crypto 3.0.6 [typed_data]
- dart_style 2.3.7 [analyzer args collection package_config path pub_semver source_span]
- dbus 0.7.10 [args ffi meta xml]
- device_info_plus_platform_interface 7.0.1 [flutter meta plugin_platform_interface]
- fake_async 1.3.1 [clock collection]
- ffi 2.1.3
- file 7.0.1 [meta path]
- firebase_core_platform_interface 5.3.1 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.18.2 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- firebase_crashlytics_platform_interface 3.7.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- fixnum 1.1.1
- flutter_local_notifications_linux 5.0.0 [dbus ffi flutter flutter_local_notifications_platform_interface path xdg_directories]
- flutter_local_notifications_platform_interface 8.0.0 [flutter plugin_platform_interface]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
- frontend_server_client 4.0.0 [async path]
- glob 2.1.2 [async collection file path string_scanner]
- graphs 2.3.2 [collection]
- http 1.2.2 [async http_parser meta web]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- image 4.3.0 [archive meta xml]
- in_app_purchase_android 0.3.6+12 [collection flutter in_app_purchase_platform_interface json_annotation]
- in_app_purchase_platform_interface 1.4.0 [flutter plugin_platform_interface]
- in_app_purchase_storekit 0.3.20+2 [collection flutter in_app_purchase_platform_interface json_annotation]
- in_app_review_platform_interface 2.0.5 [flutter url_launcher plugin_platform_interface platform]
- infinite_listview 1.1.0 [flutter]
- io 1.0.4 [meta path string_scanner]
- js 0.7.1
- just_audio_platform_interface 4.3.0 [flutter plugin_platform_interface]
- just_audio_web 0.4.13 [just_audio_platform_interface flutter flutter_web_plugins web]
- leak_tracker 10.0.5 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.5 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.1 [leak_tracker matcher meta]
- lints 5.0.0
- logging 1.3.0
- macros 0.1.2-main.4 [_macros]
- matcher 0.12.16+1 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.11.1 [collection]
- meta 1.15.0
- mime 2.0.0
- nested 1.0.0 [flutter]
- package_config 2.1.0 [path]
- package_info_plus 8.1.1 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface web win32 clock]
- package_info_plus_platform_interface 3.0.1 [flutter meta plugin_platform_interface]
- path 1.9.0
- path_parsing 1.1.0 [meta vector_math]
- path_provider_android 2.2.14 [flutter path_provider_platform_interface]
- path_provider_foundation 2.4.1 [flutter path_provider_platform_interface]
- path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface]
- path_provider_windows 2.3.0 [ffi flutter path path_provider_platform_interface]
- petitparser 6.0.2 [meta]
- platform 3.1.6
- plugin_platform_interface 2.1.8 [meta]
- pointycastle 3.9.1 [collection convert js]
- pool 1.5.1 [async stack_trace]
- pub_semver 2.1.4 [collection meta]
- pubspec_parse 1.3.0 [checked_yaml collection json_annotation pub_semver yaml]
- rxdart 0.28.0
- shelf 1.4.1 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 2.0.1 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_gen 1.5.0 [analyzer async build dart_style glob path source_span yaml]
- source_helper 1.3.4 [analyzer collection source_gen]
- source_span 1.10.0 [collection path term_glyph]
- sprintf 7.0.0
- stack_trace 1.11.1 [path]
- stream_channel 2.1.2 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test_api 0.7.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- timezone 0.10.0 [http path]
- timing 1.0.1 [json_annotation]
- typed_data 1.4.0 [collection]
- url_launcher 6.3.1 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- url_launcher_android 6.3.14 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.3.2 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.2.1 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.2.2 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.3.2 [flutter plugin_platform_interface]
- url_launcher_web 2.3.3 [flutter flutter_web_plugins url_launcher_platform_interface web]
- url_launcher_windows 3.1.3 [flutter url_launcher_platform_interface]
- uuid 4.5.1 [crypto sprintf meta fixnum]
- vector_graphics 1.1.15 [flutter http vector_graphics_codec]
- vector_graphics_codec 1.1.12
- vector_graphics_compiler 1.1.16 [args meta path path_parsing vector_graphics_codec xml]
- vector_math 2.1.4
- vm_service 14.2.5
- wakelock_plus_platform_interface 1.2.1 [flutter plugin_platform_interface meta]
- watcher 1.1.0 [async path]
- web 1.1.0
- web_socket 0.1.6 [web]
- web_socket_channel 3.0.1 [async crypto stream_channel web web_socket]
- win32 5.9.0 [ffi]
- win32_registry 1.1.5 [ffi win32]
- xdg_directories 1.1.0 [meta path]
- xml 6.5.0 [collection meta petitparser]
- yaml 3.1.2 [collection source_span string_scanner]

Additional context and comments

No response

@under3415 under3415 added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Dec 5, 2024
@SelaseKay SelaseKay added plugin: crashlytics platform: android Issues / PRs which are specifically for Android. labels Dec 9, 2024
@SelaseKay
Copy link
Contributor

SelaseKay commented Dec 9, 2024

Hi @under3415, thanks for the report. I tried building an apk but did not encounter this warning. Could you provide detailed steps to reproduce this issue?

@SelaseKay SelaseKay added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Dec 9, 2024
@under3415
Copy link
Author

under3415 commented Dec 12, 2024

Migrate to the declarative plugin block:
https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply

Upgrade to gradle 8.11.1

Upgrade plugins:

plugins {
    id 'dev.flutter.flutter-plugin-loader' version '1.0.0'
    //https://developer.android.com/build/releases/gradle-plugin
    id 'com.android.application' version '8.7.3' apply false 
    //https://kotlinlang.org/docs/releases.html#release-details
    id 'org.jetbrains.kotlin.android' version '2.0.21' apply false
}

Add unchecked arg:

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked"
        }
    }   
    repositories {
        mavenCentral()
        google()
    }
}

@google-oss-bot google-oss-bot removed the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Dec 12, 2024
@SelaseKay SelaseKay linked a pull request Dec 12, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention This issue needs maintainer attention. platform: android Issues / PRs which are specifically for Android. plugin: crashlytics type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants