_Fighter 2024-08-17 01:43 采纳率: 0%
浏览 792
已结题

flutter 错误RROR:flutter/runtime/dart_vm_initializer.cc(41)

我在开发flutter plugin 插件后,插件提供的测试都没有问题,但是我把插入导到flutter 项目后报了如下错误,

[  +40 ms] E/flutter ( 7370): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method checkPermissionStatus on channel flutter.baseflow.com/permissions/methods)
[   +1 ms] E/flutter ( 7370): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:320:7)
[        ] E/flutter ( 7370): <asynchronous suspension>
[        ] E/flutter ( 7370): #1      MethodChannelPermissionHandler.checkPermissionStatus (package:permission_handler_platform_interface/src/method_channel/method_channel_permission_handler.dart:17:20)
[        ] E/flutter ( 7370): <asynchronous suspension>
[        ] E/flutter ( 7370): #2      checkPermission (package:monitorx_app/main.dart:35:16)
[        ] E/flutter ( 7370): <asynchronous suspension>
[        ] E/flutter ( 7370): 

我现在程序分两部分:
第一部分是flutter 项目,主要是页面展示业务处理;
第二部分是flutter plguin 主要是调用原生代码,原生里面调用的是so 文件。

以上问题是引入到flutter 项目后的某一个错误,我在使用存储插件时也会报错,但是flutter 项目在不引用其他插件时一切都正常。这个flutter 打印的日志感觉没头没尾,着实不知道怎么处理, 于是我执行:flutter run -v 把详细信息打出来发现里面有这么一段信息:


 
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x22
               A: android:compileSdkVersionCodename(0x01010573)="14" (Raw: "14")
               A: package="com.yjl.monitorx_app" (Raw: "com.yjl.monitorx_app")
               A: platformBuildVersionCode=(type 0x10)0x22
               A: platformBuildVersionName=(type 0x10)0xe
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x13
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x21
               E: uses-permission (line=16)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: uses-permission (line=18)
                 A: android:name(0x01010003)="android.permission.READ_EXTERNAL_STORAGE" (Raw: "android.permission.READ_EXTERNAL_STORAGE")
               E: uses-permission (line=19)
                 A: android:name(0x01010003)="android.permission.WRITE_EXTERNAL_STORAGE" (Raw: "android.permission.WRITE_EXTERNAL_STORAGE")
               E: uses-permission (line=21)
                 A: android:name(0x01010003)="android.permission.ACCESS_NETWORK_STATE" (Raw: "android.permission.ACCESS_NETWORK_STATE")
               E: uses-permission (line=23)
                 A: android:name(0x01010003)="android.permission.ACCESS_COARSE_LOCATION" (Raw: "android.permission.ACCESS_COARSE_LOCATION")
               E: uses-permission (line=25)
                 A: android:name(0x01010003)="android.permission.CAMERA" (Raw: "android.permission.CAMERA")
               E: uses-permission (line=28)
                 A: android:name(0x01010003)="android.permission.MOUNT_FORMAT_FILESYSTEMS" (Raw: "android.permission.MOUNT_FORMAT_FILESYSTEMS")
               E: uses-permission (line=29)
                 A: android:name(0x01010003)="android.permission.MANAGE_EXTERNAL_STORAGE" (Raw: "android.permission.MANAGE_EXTERNAL_STORAGE")
               E: uses-permission (line=30)
                 A: android:name(0x01010003)="android.permission.POST_NOTIFICATIONS" (Raw: "android.permission.POST_NOTIFICATIONS")
               E: uses-permission (line=31)
                 A: android:name(0x01010003)="android.permission.WAKE_LOCK" (Raw: "android.permission.WAKE_LOCK")
               E: uses-permission (line=32)
                 A: android:name(0x01010003)="com.google.android.c2dm.permission.RECEIVE" (Raw: "com.google.android.c2dm.permission.RECEIVE")
               E: application (line=34)
                 A: android:label(0x01010001)="monitorx_app" (Raw: "monitorx_app")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="android.app.Application" (Raw: "android.app.Application")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=40)
                   A: android:theme(0x01010000)=@0x7f0b0000
                   A: android:name(0x01010003)="com.yjl.monitorx_app.MainActivity" (Raw: "com.yjl.monitorx_app.MainActivity")
                   A: android:exported(0x01010010)=(type 0x12)0xffffffff
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: meta-data (line=55)
                     A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
                     A: android:resource(0x01010025)=@0x7f0b0001
                   E: intent-filter (line=59)
                     E: action (line=60)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=62)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=69)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
                 E: uses-library (line=73)
                   A: android:name(0x01010003)="androidx.window.extensions" (Raw: "androidx.window.extensions")
                   A: android:required(0x0101028e)=(type 0x12)0x0
                 E: uses-library (line=76)
                   A: android:name(0x01010003)="androidx.window.sidecar" (Raw: "androidx.window.sidecar")
                   A: android:required(0x0101028e)=(type 0x12)0x0
                 E: receiver (line=80)
                   A: android:name(0x01010003)="com.google.firebase.iid.FirebaseInstanceIdReceiver" (Raw: "com.google.firebase.iid.FirebaseInstanceIdReceiver")
                   A: android:permission(0x01010006)="com.google.android.c2dm.permission.SEND" (Raw: "com.google.android.c2dm.permission.SEND")
                   A: android:exported(0x01010010)=(type 0x12)0xffffffff
                   E: intent-filter (line=84)
                     E: action (line=85)
                       A: android:name(0x01010003)="com.google.android.c2dm.intent.RECEIVE" (Raw: "com.google.android.c2dm.intent.RECEIVE")
                 E: service (line=92)
                   A: android:name(0x01010003)="com.google.firebase.messaging.FirebaseMessagingService" (Raw: "com.google.firebase.messaging.FirebaseMessagingService")
                   A: android:exported(0x01010010)=(type 0x12)0x0
                   A: android:directBootAware(0x01010505)=(type 0x12)0xffffffff
                   E: intent-filter (line=96)
                     A: android:priority(0x0101001c)=(type 0x10)0xfffffe0c
                     E: action (line=97)
                       A: android:name(0x01010003)="com.google.firebase.MESSAGING_EVENT" (Raw: "com.google.firebase.MESSAGING_EVENT")
                 E: service (line=100)
                   A: android:name(0x01010003)="com.google.firebase.components.ComponentDiscoveryService" (Raw: "com.google.firebase.components.ComponentDiscoveryService")
                   A: android:exported(0x01010010)=(type 0x12)0x0
                   A: android:directBootAware(0x01010505)=(type 0x12)0xffffffff
                   E: meta-data (line=104)
                     A: android:name(0x01010003)="com.google.firebase.components:com.google.firebase.messaging.FirebaseMessagingRegistrar" (Raw: "com.google.firebase.components:com.google.firebase.messaging.FirebaseMessagingRegistrar")
                     A: android:value(0x01010024)="com.google.firebase.components.ComponentRegistrar" (Raw: "com.google.firebase.components.ComponentRegistrar")
                   E: meta-data (line=107)
                     A: android:name(0x01010003)="com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar" (Raw: "com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar")
                     A: android:value(0x01010024)="com.google.firebase.components.ComponentRegistrar" (Raw: "com.google.firebase.components.ComponentRegistrar")
                   E: meta-data (line=110)
                     A: android:name(0x01010003)="com.google.firebase.components:com.google.firebase.datatransport.TransportRegistrar" (Raw: "com.google.firebase.components:com.google.firebase.datatransport.TransportRegistrar")
                     A: android:value(0x01010024)="com.google.firebase.components.ComponentRegistrar" (Raw: "com.google.firebase.components.ComponentRegistrar")
                 E: activity (line=115)
                   A: android:theme(0x01010000)=@0x01030010
                   A: android:name(0x01010003)="com.google.android.gms.common.api.GoogleApiActivity" (Raw: "com.google.android.gms.common.api.GoogleApiActivity")
                   A: android:exported(0x01010010)=(type 0x12)0x0
                 E: provider (line=120)
                   A: android:name(0x01010003)="com.google.firebase.provider.FirebaseInitProvider" (Raw: "com.google.firebase.provider.FirebaseInitProvider")
                   A: android:exported(0x01010010)=(type 0x12)0x0
                   A: android:authorities(0x01010018)="com.yjl.monitorx_app.firebaseinitprovider" (Raw: "com.yjl.monitorx_app.firebaseinitprovider")
                   A: android:initOrder(0x0101001a)=(type 0x10)0x64
                   A: android:directBootAware(0x01010505)=(type 0x12)0xffffffff
                 E: meta-data (line=127)
                   A: android:name(0x01010003)="com.google.android.gms.version" (Raw: "com.google.android.gms.version")
                   A: android:value(0x01010024)=@0x7f060000
                 E: service (line=131)
                   A: android:name(0x01010003)="com.google.android.datatransport.runtime.backends.TransportBackendDiscovery" (Raw: "com.google.android.datatransport.runtime.backends.TransportBackendDiscovery")
                   A: android:exported(0x01010010)=(type 0x12)0x0
                   E: meta-data (line=134)
                     A: android:name(0x01010003)="backend:com.google.android.datatransport.cct.CctBackendFactory" (Raw: "backend:com.google.android.datatransport.cct.CctBackendFactory")
                     A: android:value(0x01010024)="cct" (Raw: "cct")
                 E: service (line=138)
                   A: android:name(0x01010003)="com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService" (Raw: "com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService")
                   A: android:permission(0x01010006)="android.permission.BIND_JOB_SERVICE" (Raw: "android.permission.BIND_JOB_SERVICE")
                   A: android:exported(0x01010010)=(type 0x12)0x0
                 E: receiver (line=144)
                   A: android:name(0x01010003)="com.google.android.datatransport.runtime.scheduling.jobscheduling.AlarmManagerSchedulerBroadcastReceiver" (Raw: "com.google.android.datatransport.runtime.scheduling.jobscheduling.AlarmManagerSchedulerBroadcastReceiver")
                   A: android:exported(0x01010010)=(type 0x12)0x0
[   +3 ms] Stopping app 'app-debug.apk' on sdk gphone64 x86 64.

在网上找了很多资料,也没找到如何解决该问题,看那位可以帮看一下

以下是我的配置信息

main[AdroidManifest.xml]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.baseflow.permissionhandler.example">

      <!--允许程序打开网络套接字-->
      <uses-permission android:name="android.permission.INTERNET" />
      <!--允许程序设置内置sd卡的读写权限-->
      <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
      <!--允许程序获取网络状态-->
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
      <!--允许程序访问CellID或WiFi热点来获取粗略的位置-->
      <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
      <!--允许程序打开相机-->
      <uses-permission android:name="android.permission.CAMERA" />
    <application
        android:label="monitorx_app"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">  
        <activity
            android:name=".MainActivity"
            android:exported="true"
            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">
            <!-- 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"
              />
            <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>




debug[AdroidManifest.xml]
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
>
    <!-- The INTERNET permission is required for development. Specifically,
         the Flutter tool needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
     <!--允许程序打开网络套接字-->
     <uses-permission android:name="android.permission.INTERNET" />
     <!--允许程序设置内置sd卡的读写权限-->
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <!--允许程序获取网络状态-->
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <!--允许程序访问CellID或WiFi热点来获取粗略的位置-->
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
     <!--允许程序打开相机-->
     <uses-permission android:name="android.permission.CAMERA" />

</manifest>


profile[AdroidManifest.xml]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.permissionhandlerexample">    <!-- The INTERNET permission is required for development. Specifically,
         the Flutter tool needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <!--允许程序打开网络套接字-->
    <uses-permission android:name="android.permission.INTERNET" />
    <!--允许程序设置内置sd卡的读写权限-->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!--允许程序获取网络状态-->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!--允许程序访问CellID或WiFi热点来获取粗略的位置-->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <!--允许程序打开相机-->
    <uses-permission android:name="android.permission.CAMERA" />
    
</manifest>

pubspec.yaml

name: monitorx_app
version: 1.0.0
publish_to: none
description: A new Flutter project.
environment: 
  sdk: '>=3.2.2 <4.0.0'

dependencies: 
  cupertino_icons: ^1.0.2
  flutter: 
    sdk: flutter
  # 多彩图标 "^2.0.9"e
  flutter_svg: ^1.1.6
  # getx 路由 ,状态管理,吐司
  get: 4.6.6
  # getx 存储
  #get_storage: ^2.1.1    
  # 存储
  #shared_preferences: ^2.2.3
  # 权限
  permission_handler: ^11.3.1
  # 网络
  dio: ^5.5.0+1
  # 网络请求日志
  pretty_dio_logger: ^1.3.1
  # 应用日志
  logger: ^2.3.0
  # 核心插件  这个插件是自己开发的,插件内部测试都是可以通的 
  monitorx:
      path: /Users/FlutterPlugin/monitorx
  collection: ^1.18.0 
dev_dependencies: 
  flutter_lints: ^2.0.0
  flutter_test: 
    sdk: flutter

flutter: 
  uses-material-design: true

  assets:
    - assets/images/learn.png
    - assets/images/ic_logo.png
  fonts:
    - family: ctmIcons
      fonts:
      - asset: assets/icon_fonts/iconfont.ttf

  • 写回答

25条回答 默认 最新

报告相同问题?

问题事件

  • 系统已结题 8月25日
  • 创建了问题 8月17日