Skip to content

Build Failure Report: Missing ScreenProtectorPlugin Class During Android Compilation #74

Description

@Mikeruss1418

Summary

The Flutter Android build is failing during Java compilation due to a missing ScreenProtectorPlugin class reference generated in GeneratedPluginRegistrant.java.

Environment

  • Flutter Version: 3.44
  • Package: screen_protector
  • Package Version: 1.5.3
  • Build Target: Android
  • Build Variant: DevDebug

Error Details

Build fails with the following compilation error:

C:\projects\app\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:114:
error: cannot find symbol

flutterEngine.getPlugins().add(
    new com.prongbang.screen_protector.ScreenProtectorPlugin()
);

symbol:
  class ScreenProtectorPlugin

location:
  package com.prongbang.screen_protector

Gradle Failure

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDevDebugJavaWithJavac'.

> Compilation failed; see the compiler output below.

Expected Behavior

The Android build should successfully compile with the registered Flutter plugins.

Actual Behavior

The generated plugin registrant references:

com.prongbang.screen_protector.ScreenProtectorPlugin

but the corresponding Android class cannot be found during compilation.

Steps to Reproduce

  1. Use Flutter version 3.44.
  2. Add dependency:
dependencies:
  screen_protector: 1.5.3
  1. Run:
flutter pub get
flutter run
/// not hot reload or restart. Kill the app and build again
  1. Android build fails during Java compilation.

Investigation Performed

  • Verified the failure occurs inside generated plugin registration code.
  • Error is isolated to screen_protector plugin registration.
  • The generated file contains a reference to ScreenProtectorPlugin, but the Android plugin source does not appear to provide this class during compilation.

Possible Cause

Potential mismatch between:

  • Generated Flutter plugin registration
  • Cached plugin artifacts
  • Android implementation of screen_protector version 1.5.3

The issue may occur after dependency cache changes, plugin regeneration, or Flutter/Android tooling updates.

Impact

  • Android application cannot be built.
  • Development and CI builds are blocked.

Suggested Investigation

  1. Verify whether ScreenProtectorPlugin exists inside:
screen_protector-1.5.3/android/src/main/java/
  1. Regenerate Flutter plugin registration:
flutter clean
flutter pub get
  1. Validate compatibility of screen_protector:1.5.3 with Flutter 3.44.

  2. Check whether upgrading/downgrading the plugin resolves the missing class reference.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions