masashi-sutou / flutter_ios_voip_kit

One-to-one video call using CallKit and PushKit with flutter iOS app.
MIT License
67 stars 45 forks source link

Pub get warning #11

Open ghenry opened 4 years ago

ghenry commented 4 years ago
Running "flutter pub get" in SureVoIP-Talk...                       0.9s
The plugin `flutter_ios_voip_kit` doesn't have a main class defined in /home/ghenry/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/java/netkeepingblog/flutter_ios_voip_kit/FlutterIOSVoIPKitPlugin.java or /home/ghenry/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/kotlin/netkeepingblog/flutter_ios_voip_kit/FlutterIOSVoIPKitPlugin.kt. This is likely to due to an incorrect `androidPackage: netkeepingblog.flutter_ios_voip_kit` 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. 
ghenry commented 4 years ago

I see it here too:

flutter drive --target=test_driver/app.dart

The plugin `flutter_ios_voip_kit` doesn't have a main class defined in
/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/java/netkeepingblog/flutter_ios_voip_kit/FlutterIOSVoIPKitPlugin.java or
/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/kotlin/netkeepingblog/flutter_ios_voip_kit/FlutterIOSVoIPKitPlugin.kt. This is likely to due to an
incorrect `androidPackage: netkeepingblog.flutter_ios_voip_kit` 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.
masashi-sutou commented 4 years ago
ghenry commented 4 years ago

Thanks. I did that (delete my pub-cache), but still get:

rm -rf ~/.pub-cache/
rm -rf ~/development/flutter/.pub-cache/
flutter run

Running "flutter pub get" in SureVoIP-Talk...                      38.7s

The plugin `flutter_ios_voip_kit` doesn't have a main class defined in
.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/java/netkeepingblog/flutter_ios_voip_kit/FlutterIOSVoIPKitPlugin.java or
.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/kotlin/netkeepingblog/flutter_ios_voip_kit/FlutterIOSVoIPKitPlugin.kt. This is likely to due to an incorrect
`androidPackage: netkeepingblog.flutter_ios_voip_kit` 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.
ghenry commented 4 years ago

Also tried:

flutter pub cache repair

ghenry commented 4 years ago

Found it!!!! Typo:

/home/ghenry/.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/java/netkeepingblog/flutter_ios_voip_kit/FlutterIOSVoIPKitPlugin.java should be:

netkeepingblog/flutter_iOS_VoIP_kit so in your pubspec.yaml

swap this:

flutter:
  plugin:
    platforms:
      android:
        package: netkeepingblog.flutter_ios_voip_kit
        pluginClass: FlutterIOSVoIPKitPlugin
      ios:
        pluginClass: FlutterIOSVoIPKitPlugin

to

flutter:
  plugin:
    platforms:
      android:
        package: netkeepingblog.flutter_iOS_VoIP_kit
        pluginClass: FlutterIOSVoIPKitPlugin
      ios:
        pluginClass: FlutterIOSVoIPKitPlugin

Will that allow mixed case like that for a class/package name?

Thanks.

ghenry commented 4 years ago

So simply, change flutter_ios_voip_kit to flutter_iOS_VoIP_kit in your pubspec.yaml and release a new version to https://pub.dev

Actually, after doing this edit, flutter run fails with:

/AndroidStudioProjects/SureVoIP-Talk/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:27: error: package netkeepingblog.flutter_iOS_VoIP_kit does not exist
    flutterEngine.getPlugins().add(new netkeepingblog.flutter_iOS_VoIP_kit.FlutterIOSVoIPKitPlugin());
                                                                          ^
1 error                                                                 

FAILURE: Build failed with an exception.                                

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

So I think it's best you change the case of the folder containing the files or clean up the case throughout the project of flutter_iOS_VoIP_kit

Thanks.

ghenry commented 4 years ago

The folder rename fixes this issue:

.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/kotlin/netkeepingblog $ mv flutter_iOS_VoIP_kit/ flutter_ios_voip_kit/

Once you do that and publish a new version, we're all good.

ghenry commented 4 years ago

I'll I didn't need to do this on macOS, the issue with Case is on Linux.

ghenry commented 4 years ago

Any news? Still getting this:

The plugin `flutter_ios_voip_kit` doesn't have a main class defined in ~/.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/java/netkeepingblog/flutter_ios_voip_kit/FlutterIOSVoIPKitPlugin.java or ~/.pub-cache/hosted/pub.dartlang.org/flutter_ios_voip_kit-0.0.4+1/android/src/main/kotlin/netkeepingblog/flutter_ios_voip_kit/FlutterIOSVoIPKitPlugin.kt. This is likely to due to an incorrect `androidPackage: netkeepingblog.flutter_ios_voip_kit` 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. 
ghenry commented 4 years ago

Doing this, as explained, resolves the issue

https://github.com/masashi-sutou/flutter_ios_voip_kit/issues/11#issuecomment-663613924