Skip to content

integration_test has lint issues for older targets #88005

@stuartmorgan-g

Description

@stuartmorgan-g

I'm trying to enable linting of Android native code in flutter/plugins, and ran into the following issue in essentially every plugin:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':integration_test:lintDebug'.
> Lint found errors in the project; aborting build.
  
  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...
  
  Errors found:
  
  [...]/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/FlutterTestRunner.java:40: Error: Multi-catch with these reflection exceptions requires API level 19 (current min is 16) because they get compiled to the common but new super type ReflectiveOperationException. As a workaround either create individual catch statements, or catch Exception. [NewApi]
          } catch (InstantiationException | IllegalAccessException e) {
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

AFAICT because it's coming from integration_test I can't suppress it with a baseline file (since that's per-module). I'm still looking into whether there are other ways I can bypass just this error for now, but it's something could affect 3P plugins as well. We should ideally fix it in integration_test (especially since it sounds like it's an actual issue in the implementation).

/cc @blasten

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsf: integration_testThe flutter/packages/integration_test pluginplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions