Skip to content

Commit

Permalink
Fix the local-only lint errors due to an unexpected `GeneratedPluginR…
Browse files Browse the repository at this point in the history
…egistrant.java` (flutter#50795)

Remove `android/**/GeneratedPluginRegistrant.java` from the global
`.gitignore`.

This file should never exist in the source tree, locally or on CI, and
it existing/being hidden causes lint errors.

## Background

Here is what we _think_ happens:

- Someone opens `$ENGINE/src/flutter/testing/scenario_app` in VS Code
- VS Code picks this up as a "Flutter package", running `flutter
packages get`
- The Flutter tool generates `../GeneratedPluginRegistrant.java`,
thinking this is a Flutter app
- The lint error fails on `GeneratedPluginRegistrant`

```txt
$ ninja -j100 -C out/android_debug_unopt_arm64/
FAILED: scenario_app/reports/lint-results.xml 
vpython3 ../../flutter/testing/rules/run_gradle.py /Users/aaclarke/dev/engine/src/flutter/testing/scenario_app/android lint --no-daemon -Pflutter_jar=/Users/aaclarke/dev/engine/src/out/android_debug_unopt_arm64/flutter.jar -Pout_dir=/Users/aaclarke/dev/engine/src/out/android_debug_unopt_arm64/scenario_app --project-cache-dir=/Users/aaclarke/dev/engine/src/out/android_debug_unopt_arm64/scenario_app/.gradle --gradle-user-home=/Users/aaclarke/dev/engine/src/out/android_debug_unopt_arm64/scenario_app/.gradle

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lintDebug'.
>                 Lint found errors in the project; aborting build.
  
                  Fix the issues identified by lint, or create a baseline to see only new errors:
                  '''
                  android {
                      lint {
                          baseline = file("lint-baseline.xml")
                      }
                  }
                  '''
  
                  For more details, see https://developer.android.com/studio/write/lint#snapshot
  
                  Lint found 1 errors, 0 warnings. First failure:
```

/cc @christopherfujino for any other theories.
  • Loading branch information
matanlurey authored Feb 21, 2024
1 parent db49661 commit 8e1406f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ xcuserdata
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
Expand Down Expand Up @@ -76,7 +75,6 @@ unlinked_spec.ds
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
*.jks

Expand Down

0 comments on commit 8e1406f

Please sign in to comment.