Skip to content

Example Bug Report: Missing Android Plugin Main Class #4

Description

@xojixho

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

  1. Missing Plugin Implementation: The Android plugin implementation files were not generated or included in the project
  2. Incorrect Package Name: The androidPackage specified in pubspec.yaml doesn't match the actual source code structure
  3. Wrong Directory Structure: The plugin source code may be located in a different directory than the plugin system expects
  4. Incomplete Plugin Setup: The plugin may not have been properly initialized with Android support

Steps to Reproduce

  1. Run flutter pub get in the flutter project
  2. Attempt to build or run (First I tried in iOS and the plugin fails with this error) 🤔
  3. Flutter analyzes plugin configuration during build
  4. Build fails with the main class not found error

Impact

  • ❌ Cannot build Example applications with this plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions