EddieKamau / sms_advanced

This is an SMS library for Flutter. Its allow to send, receive, query sms messages, sms delivery and query contacts info. Currently supporting only android
MIT License
30 stars 64 forks source link

Error : Duplicate interface definition #36

Open toliko-coding opened 11 months ago

toliko-coding commented 11 months ago

Hi , I’m using Flutter 3.13.7 and I’m trying to add the sms_advanced plugin version 1.1.0 to my project, when I run the app using Flutter run I get an error from the Xcode 15 build that says Semantic Issue (Xcode): Duplicate interface definition for class 'SmsAdvancedPlugin', after the error I can’t run the emulator in the project even if I delete the plugin im using Macbook pro m1 / VScode / iphone 15 pro max emulator

I tried to install the plugin using flutter pub get sms_advanced , and tried to install using the dependencies way and flutter pub get

2.Reinstalled Xcode and make sure that the app is updated

3.I tried to delete the duplication in the ms_advanced-Swift.h file but when i run the app the definition that i just deleted come back .

4.flutter clean / clean build in Xcode and rebuild

5.start new flutter projects

faslurajan commented 11 months ago

Hi , I’m using Flutter 3.13.7 and I’m trying to add the sms_advanced plugin version 1.1.0 to my project, when I run the app using Flutter run I get an error from the Xcode 15 build that says Semantic Issue (Xcode): Duplicate interface definition for class 'SmsAdvancedPlugin', after the error I can’t run the emulator in the project even if I delete the plugin im using Macbook pro m1 / VScode / iphone 15 pro max emulator

I tried to install the plugin using flutter pub get sms_advanced , and tried to install using the dependencies way and flutter pub get

2.Reinstalled Xcode and make sure that the app is updated

3.I tried to delete the duplication in the ms_advanced-Swift.h file but when i run the app the definition that i just deleted come back .

4.flutter clean / clean build in Xcode and rebuild

5.start new flutter projects

I'm facing same issue here. Same error coming up and I followed the same steps as you. Nothing worked

faslurrajah commented 11 months ago

I solved it by editing pubspec.yaml of "sms_advanced" plugin. (Not App's pubspec.yaml)

Edit from this

plugin: platforms: android: package: com.elyudde.sms_advanced pluginClass: SmsAdvancedPlugin ios: pluginClass: UssdAdvancedPlugin web: pluginClass: SmsAdvancedPlugin fileName: sms_advanced_web.dart

To this

plugin: platforms: android: package: com.elyudde.sms_advanced pluginClass: SmsAdvancedPlugin

jvegaseg commented 3 weeks ago

Same problem, @faslurajan where is located that pubspec.yaml?

faslurrajah commented 3 weeks ago

Same problem, @faslurajan where is located that pubspec.yaml?

  1. First download the sms_advanced repository and put it on your Flutter project
  2. Add the sms_advanced plugin using local path. Lets say you have added sms_advanced directory on your flutter on _root/custom_plugins/sms_advancedmaster

added sms_advavanced on root/pubspec.yaml file like below

  sms_advanced:
    path: ../custom_plugins/sms_advanced_master
  1. Now go to _root/custom_plugins/sms_advancedmaster/pubbspec.yaml and change like below from this
plugin:
platforms:
android:
package: com.elyudde.sms_advanced
pluginClass: SmsAdvancedPlugin
ios:
pluginClass: UssdAdvancedPlugin
web:
pluginClass: SmsAdvancedPlugin
fileName: sms_advanced_web.dart

To this

plugin:
platforms:
android:
package: com.elyudde.sms_advanced
pluginClass: SmsAdvancedPlugin
jvegaseg commented 3 weeks ago

thanks for your help. No luck, same results.

faslurrajah commented 3 weeks ago

thanks for your help. No luck, same results.

Try doing a flutter clean

jvegaseg commented 3 weeks ago

thanks, flutter clean was the solution