openponce / opencamera

Open Camera is a flutter project that provides a complete widget for shooting and recording videos.
BSD 3-Clause "New" or "Revised" License
16 stars 9 forks source link

This is likely todue to an incorrect `androidPackage: org.openponce.open_camera` or `mainClass` entry in the plugin's pubspec.yaml. #7

Open yuchao86 opened 4 years ago

yuchao86 commented 4 years ago

PS C:\Users\Administrator\Downloads\opencamera-master\example> flutter pub get Running "flutter pub get" in example... 2.4s The plugin open_camera doesn't have a main class defined in C:\Users\Administrator\Downloads\opencamera-master\android\src\main\java\org\openponce\open_camera\OpenCameraPlugin.java or C:\Users\Administrator\Downloads\opencamera-master\android\src\main\kotlin\org\openponce\open_camera\OpenCameraPlugin.kt. This is likely todue to an incorrect androidPackage: org.openponce.open_camera 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 locations used above. Otherwise,
please contact the author of this plugin and consider using a different plugin in the meanwhile.

jhanco07 commented 4 years ago

hi, I also have the same error, any solution?, this is my flutter doctor:

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Versión 10.0.18362.959], locale es-CO)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [√] Android Studio (version 4.0) [√] Connected device (1 available)

• No issues found!

Error:

The plugin open_camera doesn't have a main class defined in \main\java\org\openponce\open_camera\OpenCameraPlugin.java or \android\src\main\kotlin\org\openponce\open_camera\OpenCameraPlugin.kt. This is likely to due to an incorrect androidPackage: org.openponce.open_camera 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 locations used above. Otherwise, please contact the author of this plugin and consider using a different plugin in the meanwhile.

EightRice commented 4 years ago

So what's the deal? Does this work or not? I'm also getting that error that it doesn't have a main class. Who makes a plugin without a main class? What alternatives are there? I just want to record a video for crap sakes...

Badwritten commented 4 years ago

So what's the solution

DeadPixel-ANTH commented 3 years ago

The package is installed in the wrong directory for the Android version.

Go to your hidden .pub-cache directory, find the plugin, and change the name of the directory from 'kotlin' to 'java'. This fixes it.

TOKID commented 2 years ago

delete .pub-cache directory ,then ok