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
- Use Flutter version
3.44.
- Add dependency:
dependencies:
screen_protector: 1.5.3
- Run:
flutter pub get
flutter run
/// not hot reload or restart. Kill the app and build again
- 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
- Verify whether
ScreenProtectorPlugin exists inside:
screen_protector-1.5.3/android/src/main/java/
- Regenerate Flutter plugin registration:
flutter clean
flutter pub get
-
Validate compatibility of screen_protector:1.5.3 with Flutter 3.44.
-
Check whether upgrading/downgrading the plugin resolves the missing class reference.
Summary
The Flutter Android build is failing during Java compilation due to a missing
ScreenProtectorPluginclass reference generated inGeneratedPluginRegistrant.java.Environment
screen_protectorDevDebugError Details
Build fails with the following compilation error:
Gradle Failure
Expected Behavior
The Android build should successfully compile with the registered Flutter plugins.
Actual Behavior
The generated plugin registrant references:
but the corresponding Android class cannot be found during compilation.
Steps to Reproduce
3.44.Investigation Performed
screen_protectorplugin registration.ScreenProtectorPlugin, but the Android plugin source does not appear to provide this class during compilation.Possible Cause
Potential mismatch between:
screen_protectorversion1.5.3The issue may occur after dependency cache changes, plugin regeneration, or Flutter/Android tooling updates.
Impact
Suggested Investigation
ScreenProtectorPluginexists inside:Validate compatibility of
screen_protector:1.5.3with Flutter3.44.Check whether upgrading/downgrading the plugin resolves the missing class reference.