Skip to content

[camera][android] Unit tests fail #71709

Closed
@svenjacobs

Description

@svenjacobs

I'm integrating a Flutter module into an Android app in an "add 2 app" situation. After adding camera (0.5.8+11) to the Flutter module, the Android unit tests fail. When running ./gradlew test in my Android project I get the following error:

> Task :camera:compileDebugUnitTestJavaWithJavac FAILED
/Users/sven/.pub-cache/hosted/pub.dartlang.org/camera-0.5.8+11/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java:103: warning: [unchecked] unchecked cast
        return (Map<String, String>) StandardMethodCodec.INSTANCE.decodeEnvelope(sentMessage);
                                                                                ^
  required: Map<String,String>
  found:    Object
error: warnings found and -Werror specified
1 error
1 warning

I'm wondering how this failing unit test was not discovered yet because the unchecked cast is ignored in the test's source code but obviously warnings are treated as errors.

Flutter version 1.22.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consolefound in release: 1.22Found to occur in 1.22has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions