简体   繁体   English

无法加载 providerinstaller 模块:找不到可接受的模块。 本地版本为0,远程版本为0报错flutter

[英]Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0 error flutter

I am getting this warning in my run console.我在运行控制台中收到此警告。 Baically, my chatRoomTile is not been showed on the screen.基本上,我的 chatRoomTile 没有显示在屏幕上。 It just shows blank screen, even after i have had chat with 10 persons.它只是显示空白屏幕,即使在我与 10 个人聊天之后也是如此。

It is just showing the main screen, and the red container for 2 seconds, as in conditional statement.它只显示主屏幕和红色容器 2 秒,如条件语句所示。

This is the output in run -这是运行中的 output -

Performing hot restart...
Syncing files to device sdk gphone x86...
Restarted application in 1,522ms.
W/eyansh.whatsap( 6057): Accessing hidden method Ldalvik/system/CloseGuard;->close()V (greylist,core-platform-api, linking, allowed)
W/DynamiteModule( 6057): Local module descriptor class for providerinstaller not found.
I/DynamiteModule( 6057): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller( 6057): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
Lost connection to device.

Here is my code -这是我的代码 -

import 'package:flutter/material.dart';
import 'package:whatsapp/helper/authenticate.dart';
import 'package:whatsapp/helper/constants.dart';
import 'package:whatsapp/helper/helperFunctions.dart';
import 'package:whatsapp/screens/search.dart';
import 'package:whatsapp/services/auth.dart';
import 'package:whatsapp/services/database.dart';

class ChatRoom extends StatefulWidget {
  @override
  _ChatRoomState createState() => _ChatRoomState();
}

class _ChatRoomState extends State<ChatRoom> {

  AuthMethods authMethods = new AuthMethods();
  DatabaseMethods databaseMethods = new DatabaseMethods();
  Stream chatRoomStream;

  Widget chatRoomList(){
    return StreamBuilder(
      stream: chatRoomStream,
      builder: (context, snapshot) {
        return snapshot.hasData ? ListView.builder(
        itemCount: snapshot.data.documents.length,
        itemBuilder: (context, index) {
          return ChatRoomTile(
              snapshot.data.documents[index]["chatRoomId"],
          );
       }) : Container(color: Colors.red,);
      },
    );
  }

  @override
  void initState() {
   getUserInfo();
    super.initState();
  }

  getUserInfo() async{
    Constants.myName = await HelperFunctions.getUserNameSharedPreference();
    databaseMethods.getChatRooms(Constants.myName).then((val){
      setState(() {
        chatRoomStream = val;
      });
    });
    setState(() {

    });
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        appBar: AppBar(
          backgroundColor: Color(0xff161517),
          title: Text(
            'WhatsApp',
            style: TextStyle(
              color: Colors.white54,
              fontSize: 20.0,
            ),
          ),
          actions: [
            Container(
              height: 25.0,
              width: 25.0,
              child: FloatingActionButton(
                heroTag: "btn1",
                backgroundColor: Color(0xff161517),
                child: Icon(Icons.search, color: Colors.white54,),
                onPressed: (){
                },
              ),
            ),
            GestureDetector(
              onTap: (){
                authMethods.signOut();
                Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => Authenticate()));
              },
              child: Container(
                  padding: EdgeInsets.symmetric(horizontal: 15.0),
                  child: Icon(
                    Icons.exit_to_app,
                    color: Colors.white54,
                  ),
              ),
            ),
            GestureDetector(
              onTap: (){
              },
              child: Container(
                padding: EdgeInsets.symmetric(horizontal: 1.0),
                child: Icon(
                  Icons.more_vert,
                  color: Colors.white54,
                ),
              ),
            ),
          ],
        ),
        body: chatRoomList(),
        floatingActionButton: FloatingActionButton(
          heroTag: "btn2",
          backgroundColor: Colors.green[700],
          onPressed: (){
            Navigator.push(context, MaterialPageRoute(builder: (context) => SearchScreen()));
          },
          child: Icon(
            Icons.message,
            color: Colors.white,
          ),
        ),
      ),
    );
  }
}

class ChatRoomTile extends StatelessWidget {

  final String userName;
  ChatRoomTile(this.userName);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        children: [
          Container(
            decoration: BoxDecoration(
              shape: BoxShape.circle,
               image: DecorationImage(
                  image: AssetImage("assets/images/DefaultPhoto.png"),
                  fit: BoxFit.fill,
               ),
              borderRadius: BorderRadius.circular(40.0),
            ),
          ),
          SizedBox(width: 8.0,),
          Text(
            userName,
            style: TextStyle(
              color: Colors.white,

            ),
          ),
        ],
      ),
    );
  }
}

If anyone wants details for any widget, you can ask me.如果有人想要任何小部件的详细信息,可以问我。

<application>启动之前,将以下权限添加到android/app/src/main/AndroidManifest.xml

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

I had the same error.我有同样的错误。 I looked through my code and found that I had given the wrong collection name while I was calling firebasefirestore.我查看了我的代码,发现我在调用 firebasefirestore 时给出了错误的集合名称。 Please do check that you are providing the right reference names to collections and docs.请务必检查您是否为集合和文档提供了正确的参考名称。

I see this error when wireless is active but the connection to Firestore fails.当无线处于活动状态但与 Firestore 的连接失败时,我会看到此错误。 For example, when debugging I connect to the local emulators, if I forget to start the emulator I get this message, but the app still works from cache.例如,在调试时我连接到本地模拟器,如果我忘记启动模拟器,我会收到此消息,但该应用程序仍然可以从缓存中运行。

just make sure you are calling the right instance name from firestore for me i was calling medicinal product in the instace and i had defined MedicineProductData int the firebase database so correcting it to the MedicineProductData solved my issue只要确保你从firestore为我调用了正确的实例名称我在instace中调用了医药产品,我已经在firebase数据库中定义了MedicineProductData,因此将其更正为MedicineProductData解决了我的问题

code: QuerySnapshot value = await FirebaseFirestore.instance.collection("MedicineProductData").get();代码:QuerySnapshot 值 = 等待 FirebaseFirestore.instance.collection("MedicineProductData").get();

Yes, I solve this.是的,我解决了这个问题。 I have also face this probelem.我也遇到过这个问题。

Why it comes?为什么会来? It's because your emulator doesn't have internet connection.这是因为您的模拟器没有互联网连接。 Though it is showing wifi connection.虽然它显示wifi连接。

Solution:解决方案:

  1. first of all check your internet connection status.首先检查您的互联网连接状态。
  2. Goto Emulator and turn off wifi and then again turn on wifi.转到模拟器并关闭wifi,然后再次打开wifi。 That's it.而已。

Hope insa allah it work for you also.希望 insa allah 它也对你有用。

Also don't forget to add below code to Manifest也不要忘记将以下代码添加到清单

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

beofore <android><android>之前

module.exports = {
parser: "vue-eslint-parser",
parserOptions: {
ecmaVersion: 2022,
sourceType: "module",
},
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"google",
],
rules: {
quotes: ["error", "double"],
},
};

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到 com.google.android.gms.providerinstaller.dynamite 的本地模块描述符 class。 Flutter Firebase - Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found. Flutter Firebase Flutter on IOS:致命错误:找不到模块“cloud_firestore” - Flutter on IOS: fatal error: module 'cloud_firestore' not found `Firebase` package 已成功找到。 但是,这个 package 本身指定了一个无法解析的“主”模块字段 - `Firebase` package was successfully found. However, this package itself specifies a `main` module field that could not be resolved 预期 2 个位置参数,但找到 0 个。 Flutter - 2 positional argument(s) expected, but 0 found. Flutter 无法从源加载 function 定义:无法从 function 源生成清单:错误:找不到模块“firebase-admin/auth” - Failed to load function definition from source: Failed to generate manifest from function source: Error: Cannot find module 'firebase-admin/auth' 未找到模块:错误:无法解析“./Firebase” - Module not found: Error: Can't resolve './Firebase' Firebase 模块在部署功能时需要旧版本的节点 - Firebase module requires an older version of node while deploying the functions 找不到 Notifee 本机模块 - Notifee native module not found 错误:gcloud 加载失败:没有名为“googlecloudsdk.third_party.apis.binaryauthorization.v1alpha2.binaryauthorization_v1alpha2_messages”的模块 - ERROR: gcloud failed to load: No module named 'googlecloudsdk.third_party.apis.binaryauthorization.v1alpha2.binaryauthorization_v1alpha2_messages' 远程:ImportError:没有名为 gitlab 的模块 - remote: ImportError: No module named gitlab
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM