Skip to content

[shared_preferences] Warnings after latest 0.5.4 release #43254

@Zazo032

Description

@Zazo032

Steps to Reproduce

  1. Upgrade shared_preferences to latest version (0.5.4)
  2. Run an app that uses the plugin

Note that warnings are gone after second run.

Target Platform: Android
Target OS version/browser: 10
Devices: Pixel 3 XL

Logs

11:11:40.837 4 info flutter.tools Running Gradle task 'assembleDebug'...
11:12:04.212 5 info flutter.tools C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.4\android\src\main\java\io\flutter\plugins\sharedpreferences\MethodCallHandlerImpl.java:137: warning: [unchecked] unchecked cast
11:12:04.212 6 info flutter.tools       return (List<String>) stream.readObject();
11:12:04.213 7 info flutter.tools                                              ^
11:12:04.214 8 info flutter.tools   required: List<String>
11:12:04.214 9 info flutter.tools   found:    Object
11:12:04.214 10 info flutter.tools C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.4\android\src\main\java\io\flutter\plugins\sharedpreferences\MethodCallHandlerImpl.java:182: warning: [unchecked] unchecked method invocation: constructor <init> in class ArrayList is applied to given types
11:12:04.214 11 info flutter.tools           List<String> listValue = new ArrayList<>((Set) value);
11:12:04.214 12 info flutter.tools                                    ^
11:12:04.214 13 info flutter.tools   required: Collection<? extends E>
11:12:04.214 14 info flutter.tools   found: Set
11:12:04.214 15 info flutter.tools   where E is a type-variable:
11:12:04.214 16 info flutter.tools     E extends Object declared in class ArrayList
11:12:04.215 17 info flutter.tools C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.4\android\src\main\java\io\flutter\plugins\sharedpreferences\MethodCallHandlerImpl.java:182: warning: [unchecked] unchecked conversion
11:12:04.215 18 info flutter.tools           List<String> listValue = new ArrayList<>((Set) value);
11:12:04.215 19 info flutter.tools                                                    ^
11:12:04.215 20 info flutter.tools   required: Collection<? extends E>
11:12:04.215 21 info flutter.tools   found:    Set
11:12:04.215 22 info flutter.tools   where E is a type-variable:
11:12:04.215 23 info flutter.tools     E extends Object declared in class ArrayList
11:12:04.215 24 info flutter.tools C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.4\android\src\main\java\io\flutter\plugins\sharedpreferences\MethodCallHandlerImpl.java:182: warning: [unchecked] unchecked conversion
11:12:04.215 25 info flutter.tools           List<String> listValue = new ArrayList<>((Set) value);
11:12:04.215 26 info flutter.tools                                    ^
11:12:04.215 27 info flutter.tools   required: List<String>
11:12:04.215 28 info flutter.tools   found:    ArrayList
11:12:04.274 29 info flutter.tools 4 warnings
11:12:30.410 30 info flutter.tools Built build\app\outputs\apk\debug\app-debug.apk.

Flutter doctor

[√] Flutter (Channel master, v1.10.15-pre.202, on Microsoft Windows [Versión 10.0.18362.418], locale es-ES)
    • Flutter version 1.10.15-pre.202 at C:\src\flutter
    • Framework revision 46ea99122b (5 hours ago), 2019-10-21 20:54:02 -0700
    • Engine revision 8882bf3c73
    • Dart version 2.6.0 (build 2.6.0-dev.8.0 a61c775db8)


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\crist\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including following components:
        MSBuild
        MSVC v142 - VS 2019 C++ x64/x86 build tools
       - If there are multiple versions, install the latest one
        Windows 10 SDK (10.0.17763.0)

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 40.2.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] Connected device (2 available)
    • Pixel 3 XL • 89PY09NNV • android-arm64 • Android 10 (API 29)
    • Windows    • Windows   • windows-x64   • Microsoft Windows [Versión 10.0.18362.418]

Metadata

Metadata

Assignees

Labels

c: regressionIt was better in the past than it is nowcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.p: shared_preferencesPlugin to read and write Shared Preferencespackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions