首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我在颤振中错误地使用了flutter_sim_country_code软件包

我在颤振中错误地使用了flutter_sim_country_code软件包
EN

Stack Overflow用户
提问于 2021-11-19 09:36:40
回答 2查看 377关注 0票数 0

当我运行我的颤振项目或运行pub get命令时,我得到了这个错误。我研究了我的颤振项目中的代码,我没有使用这个插件,但是我找不到flutter_sim_country_code插件的用法。下面提到了错误。

代码语言:javascript
复制
The plugin `flutter_sim_country_code` doesn't have a main class defined in E:\flutter_windows_2.0.2-stable\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_sim_country_code-0.1.1\android\src\main\java\com\example\flutter_sim_country_code\FlutterSimCountryCodePlugin.java or E:\flutter_windows_2.0.2-stable\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_sim_country_code-0.1.1\android\src\main\kotlin\com\example\flutter_sim_country_code\FlutterSimCountryCodePlugin.kt. This is likely to due to an incorrect `androidPackage: com.example.flutter_sim_country_code` 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. 

pubspec.yaml版本: 1.0.0+1

代码语言:javascript
复制
environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
    

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.0
  flutter_svg: ^0.22.0
  flutter_map: ^0.13.1
  textfield_search: ^0.7.0
  autocomplete_textfield: ^1.7.3
  flutter_tags: ^0.4.9+1
  datetime_picker_formfield: ^1.0.0
  lottie: ^0.7.0+1
  #qr_code_scanner: ^0.3.1
  dotted_border: ^2.0.0+1
  flutter_credit_card: ^0.1.3
  image_picker: ^0.8.3+2
  flutter_image_compress: ^1.1.0
  toast: ^0.1.5
  shared_preferences: ^2.0.6
  firebase_core: ^1.1.1
  firebase_auth: ^1.1.4
  firebase_messaging: ^9.1.4
  google_sign_in: ^5.0.7
  google_maps_flutter: ^2.0.6
  carousel_pro: ^1.0.0
  readmore: ^1.0.1
  maps_launcher: ^2.0.1
  flutter_html: ^2.0.0
  location: ^4.3.0
  geocoder: ^0.2.1 
  stripe_payment: ^1.0.9
  dio: ^4.0.0
  flutter_facebook_auth: ^3.0.0
  sign_in_with_apple: ^2.5.4
  crypto: ^2.1.5
  apple_sign_in: ^0.1.0
  connectivity: ^3.0.6
  flutter_native_timezone: ^1.0.4
  #flutter_barcode_scanner: ^0.1.7
  flutter_barcode_scanner: ^2.0.0
  colorful_safe_area: ^0.2.1
  flutter_share: ^2.0.0
  in_app_review: ^2.0.2
  get_version: ^0.2.2
  country_calling_code_picker: ^2.0.0
  flutter_local_notifications: ^5.0.0+4
  facebook_app_events: ^0.13.4
  flutter_email_sender: ^5.0.2
  
dev_dependencies:
  flutter_test:
    sdk: flutter
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-11-26 07:11:02

在我的例子中,我对包名"androidPackage: com.example.flutter_sim_country_code"有异议,这与我的实际包名"androidPackage: com.myappbuilder.flutter_sim_country_code"不匹配。所以这不是工作。

如果有人面临同样的问题,那么您必须在您的项目中首先检查您的包名。

票数 0
EN

Stack Overflow用户

发布于 2021-11-19 09:43:49

好像是插件的问题。相反,我建议你使用替代插件。

使用

代码语言:javascript
复制
String carrierInfo = await CarrierInfo.isoCountryCode;  // The ISO country code for the user’s cellular service provider.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70032690

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档