Scout Flutter Plugin - Missing Main Class Definition in Android Package
Description
The scout_flutter Flutter plugin fails to initialize because the Android plugin main class is not found in the expected locations. The plugin configuration specifies an Android package but the corresponding main class file does not exist in either the Java or Kotlin source directories.
Error Message
The plugin `scout_flutter` doesn't have a main class defined in:
- /Users/myMachine/Dev/flutter_projects/scout-flutter/android/src/main/java/com/base14/scout_flutter/ScoutFlutterPlugin.java
- /Users/myMachine/Dev/flutter_projects/scout-flutter/android/src/main/kotlin/com/base14/scout_flutter/ScoutFlutterPlugin.kt
This is likely due to an incorrect `androidPackage: com.base14.scout_flutter`
or `mainClass` entry in the plugin's pubspec.yaml.
If you are the author of this plugin, fix the `androidPackage` entry or move
the main class to any of the locations used above. Otherwise, please contact
the author of this plugin and consider using a different plugin in the meantime.
Environment
- Flutter Project: scout-flutter
- Platform: Android
- Expected Main Class Package:
com.base14.scout_flutter
- Expected Main Class Locations:
- Java:
android/src/main/java/com/base14/scout_flutter/ScoutFlutterPlugin.java
- Kotlin:
android/src/main/kotlin/com/base14/scout_flutter/ScoutFlutterPlugin.kt
Issue Summary
- ❌ Android plugin main class file is missing
- ❌ Cannot initialize native Android bindings for scout_flutter
- ❌ Plugin configuration in
pubspec.yaml may not match actual source structure
Possible Causes
- Missing Plugin Implementation: The Android plugin implementation files were not generated or included in the project
- Incorrect Package Name: The
androidPackage specified in pubspec.yaml doesn't match the actual source code structure
- Wrong Directory Structure: The plugin source code may be located in a different directory than the plugin system expects
- Incomplete Plugin Setup: The plugin may not have been properly initialized with Android support
Steps to Reproduce
- Run
flutter pub get in the flutter project
- Attempt to build or run (First I tried in iOS and the plugin fails with this error) 🤔
- Flutter analyzes plugin configuration during build
- Build fails with the main class not found error
Impact
- ❌ Cannot build Example applications with this plugin
Scout Flutter Plugin - Missing Main Class Definition in Android Package
Description
The
scout_flutterFlutter plugin fails to initialize because the Android plugin main class is not found in the expected locations. The plugin configuration specifies an Android package but the corresponding main class file does not exist in either the Java or Kotlin source directories.Error Message
Environment
com.base14.scout_flutterandroid/src/main/java/com/base14/scout_flutter/ScoutFlutterPlugin.javaandroid/src/main/kotlin/com/base14/scout_flutter/ScoutFlutterPlugin.ktIssue Summary
pubspec.yamlmay not match actual source structurePossible Causes
androidPackagespecified inpubspec.yamldoesn't match the actual source code structureSteps to Reproduce
flutter pub getin the flutter projectImpact