社区首页 >问答首页 >android上的颤动运行错误未处理异常:MissingPluginException(找不到方法的实现)

android上的颤动运行错误未处理异常:MissingPluginException(找不到方法的实现)
EN

Stack Overflow用户
提问于 2021-03-01 09:13:49
回答 1查看 430关注 0票数 0

我的代码在iOS上运行得很好。但是android我犯了一些错误。我该怎么解决它呢?应用程序在ios上工作正常。但当我尝试在android上运行时,我在调试控制台上看到错误,我的flutter版本是1.22,flutter doctor给出了任何错误。我尝试了颤动清理和删除旧版本的设备。但是仍然有同样的错误

错误列表如下:

代码语言:javascript
代码运行次数:0
复制
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationSupportDirectory on channel
plugins.flutter.io/path_provider)
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method configure on channel plugins.flutter.io/firebase_messaging)
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel dexterous.com/flutter/local_notifications)

我的pubspec.yaml

代码语言:javascript
代码运行次数:0
复制
name: doctorfinder_new
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  intl:
  intl_translation:
    
  google_fonts: ^1.1.2
  flutter_local_notifications: ^4.0.1+1
  google_maps_flutter: ^1.2.0
  geocoder: ^0.2.1
  geolocator: ^6.2.1
  toast: ^0.1.5
  masked_text_input_formatter: "0.0.1"
  http: ^0.12.2
  cached_network_image: ^2.5.0
  shared_preferences: ^0.5.12+4
  url_launcher: ^5.7.10
  firebase_messaging: ^7.0.3
  image_picker: ^0.6.7+22
  email_validator: ^1.0.6
  loadmore: ^1.0.4
  paging: ^0.1.0
  flutter_facebook_login: ^3.0.0
  google_sign_in: ^4.5.9


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.0

dev_dependencies:
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true


  assets:
    - assets/
    - assets/homeScreenImages/
    - assets/moreScreenImages/
    - assets/loginScreenImages/
    - assets/detailScreenImages/
    - assets/specialityScreenImages/
    - assets/makeAppointmentScreenImages/
  #   - images/a_dot_ham.jpeg

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

我的AndroidManifest.xml

代码语言:javascript
代码运行次数:0
复制
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.doctorfinder_new">
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="doctorfinder_new"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
              <action android:name="FLUTTER_NOTIFICATION_CLICK" />
              <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

最后是我的Mainactivity.java

代码语言:javascript
代码运行次数:0
复制
package com.example.doctorfinder_new;

import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
}

这是我的GeneratedPluginRegistrant.java

代码语言:javascript
代码运行次数:0
复制
package io.flutter.plugins;

import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin;
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin;
import com.roughike.facebooklogin.facebooklogin.FacebookLoginPlugin;
import com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin;
import io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin;
import com.aloisdeniel.geocoder.GeocoderPlugin;
import com.baseflow.geolocator.GeolocatorPlugin;
import io.flutter.plugins.googlemaps.GoogleMapsPlugin;
import io.flutter.plugins.googlesignin.GoogleSignInPlugin;
import io.flutter.plugins.imagepicker.ImagePickerPlugin;
import io.flutter.plugins.pathprovider.PathProviderPlugin;
import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin;
import com.tekartik.sqflite.SqflitePlugin;
import io.flutter.plugins.urllauncher.UrlLauncherPlugin;

/**
 * Generated file. Do not edit.
 */
public final class GeneratedPluginRegistrant {
  public static void registerWith(PluginRegistry registry) {
    if (alreadyRegisteredWith(registry)) {
      return;
    }
    FlutterFirebaseCorePlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin"));
    FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
    FacebookLoginPlugin.registerWith(registry.registrarFor("com.roughike.facebooklogin.facebooklogin.FacebookLoginPlugin"));
    FlutterLocalNotificationsPlugin.registerWith(registry.registrarFor("com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin"));
    FlutterAndroidLifecyclePlugin.registerWith(registry.registrarFor("io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin"));
    GeocoderPlugin.registerWith(registry.registrarFor("com.aloisdeniel.geocoder.GeocoderPlugin"));
    GeolocatorPlugin.registerWith(registry.registrarFor("com.baseflow.geolocator.GeolocatorPlugin"));
    GoogleMapsPlugin.registerWith(registry.registrarFor("io.flutter.plugins.googlemaps.GoogleMapsPlugin"));
    GoogleSignInPlugin.registerWith(registry.registrarFor("io.flutter.plugins.googlesignin.GoogleSignInPlugin"));
    ImagePickerPlugin.registerWith(registry.registrarFor("io.flutter.plugins.imagepicker.ImagePickerPlugin"));
    PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
    SharedPreferencesPlugin.registerWith(registry.registrarFor("io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin"));
    SqflitePlugin.registerWith(registry.registrarFor("com.tekartik.sqflite.SqflitePlugin"));
    UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin"));
  }

  private static boolean alreadyRegisteredWith(PluginRegistry registry) {
    final String key = GeneratedPluginRegistrant.class.getCanonicalName();
    if (registry.hasPlugin(key)) {
      return true;
    }
    registry.registrarFor(key);
    return false;
  }
}
EN

回答 1

Stack Overflow用户

发布于 2021-03-01 09:16:30

这是因为你安装了一个新的插件,从设备上卸载应用程序,然后再次运行它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66419360

复制
相关文章
Android Studio 运行项目遇到的错误
版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/lyhhj/article/details/47416153
Hankkin
2018/09/06
1.9K0
termux – Android上运行的Linux
Github地址:https://github.com/termux/termux-app/releases
收心
2022/11/16
6.3K0
termux – Android上运行的Linux
.net捕捉全局未处理异常的3种方式
 我们在实际项目开发中,经常会遇到一些不可预见的异常产生,有的异常在程序运行时就对其进行处理(try) 但是,有的程序不需要每一个地方都用try进行处理,那么针对这种情况,可以参照下面的方式,实现对异常的统一抓取处理
小小许
2018/09/20
1.4K0
关于Android报找不到arm-linux-androideabi的错误
上面错误的意思是,在ABI的NDK工具链文件夹中没有找到带有前缀:arm-linux-androideabi的工具链,对于这个问题,解决的方法是给项目添加ndk配置即可。
xiangzhihong
2022/10/28
3.2K0
关于Android报找不到arm-linux-androideabi的错误
PHP 错误和异常处理(上)
在 PHP 5 中,程序错误会被划分为多种级别:https://www.php.net/manual/zh/errorfunc.constants.php,然后可以通过 error_reporting 函数设置报告的错误级别:
学院君
2020/07/24
6170
PHP 错误和异常处理(上)
python常见错误与异常处理(上)
本系列课程是针对无基础的,争取用简单明了的语言来讲解,学习前需要具备基本的电脑操作能力,准备一个已安装python环境的电脑。如果觉得好可以分享转发,有问题的地方也欢迎指出,在此先行谢过。
叶子陪你玩
2020/03/25
5280
python常见错误与异常处理(上)
Flutter 异常捕获详解
Flutter 异常指的是,Flutter 程序中 Dart 代码运行时意外发生的错误事件。我们可以通过与 Swift 类似的 try-catch
大发明家
2021/12/15
8.1K0
Android-Picasso 库中找不到 .with() 方法
最后附上源码:https://github.com/FishInWater-1999/AndroidClockDemo
圆号本昊
2021/09/24
8220
Android-Picasso 库中找不到 .with() 方法
Android平台基于异常的Hook实现[转载]
Android下面有很多Hook的思路,如果要获取执行到某地址的寄存器信息或者某地址的访问者信息,那么异常Hook将会是一个较优的手段,本章节会介绍Android平台下异常Hook的方法,包括原理,流程和实际的代码。
用户2930595
2018/08/23
1.3K0
Android平台基于异常的Hook实现[转载]
visual studio发生了未处理的异常_打印显示灾难性故障
故障说明:使用vs2010时,由于文件创建MFC类时,移除文件后重新创建正确的基类,覆盖之前创建的文件造成,在“解决方案资源管理器”点击“cpp”文件弹出该提示。
全栈程序员站长
2022/09/29
9250
visual studio发生了未处理的异常_打印显示灾难性故障
点击加载更多

相似问题

颤动:未处理的异常:MissingPluginException(在通道上找不到方法的实现)

115

颤动/Dart-未处理的异常: MissingPluginException

160

未处理的异常:MissingPluginException(在通道lyokone/位置上找不到方法getLocation的实现)

35

未处理的异常:MissingPluginException(在通道测试中找不到方法日志的实现)

1139

未处理的异常: MissingPluginException

23
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文