Flutter: Local module descriptor class for providerinstaller not found

Viewed 8331

I have been trying to develop an app which works with firebase and I am not a professional of coding.

Actually, my app is working well on the emulator but after 3-5 seconds I get an error message as you can see below:

W/DynamiteModule(11855): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(11855): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(11855): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
W/DynamiteModule(11855): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(11855): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(11855): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.

And you can see my dependencies below:

dependencies:

  flutter:
    sdk: flutter
  cloud_firestore: ^0.14.0+2
  image: ^2.0.7
  animator: 0.1.4
  image_picker: ^0.6.7+7
  google_sign_in: ^4.5.3
  timeago: 2.0.17
  cached_network_image:
  firebase_auth: ^0.18.0+1
  geolocator: 5.0.1
  uuid: ^2.0.0
  cupertino_icons: ^0.1.2
  path_provider: ^1.6.16
  firebase_messaging: ^7.0.0
  firebase_storage: ^4.0.0
  firebase_core: ^0.5.0
  flutter_svg: ^0.19.0

In addition to providerinstaller issue above when I try to upload an image with camera, I get additional error below:

E/flutter (11855): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: NoSuchMethodError: The getter 'path' was called on null.
E/flutter (11855): Receiver: null
E/flutter (11855): Tried calling: path
E/flutter (11855): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter (11855): #1      _UploadPageState.pickImageFromGallery (package:buddiesgram/pages/UploadPage.dart:37:38)
E/flutter (11855): <asynchronous suspension>
E/flutter (11855): #2      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:992:19)
E/flutter (11855): #3      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1098:38)
E/flutter (11855): #4      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:184:24)
E/flutter (11855): #5      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:524:11)
E/flutter (11855): #6      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:284:5)
E/flutter (11855): #7      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:219:7)
E/flutter (11855): #8      PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:477:9)
E/flutter (11855): #9      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:78:12)
E/flutter (11855): #10     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:124:9)
E/flutter (11855): #11     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
E/flutter (11855): #12     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:122:18)
E/flutter (11855): #13     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:108:7)
E/flutter (11855): #14     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:220:19)
E/flutter (11855): #15     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22)
E/flutter (11855): #16     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:158:7)
E/flutter (11855): #17     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:104:7)
E/flutter (11855): #18     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:88:7)
E/flutter (11855): #19     _rootRunUnary (dart:async/zone.dart:1206:13)
E/flutter (11855): #20     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (11855): #21     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (11855): #22     _invoke1 (dart:ui/hooks.dart:267:10)
E/flutter (11855): #23     _dispatchPointerDataPacket (dart:ui/hooks.dart:176:5)
E/flutter (11855): 

You can see my code of my upload page below:

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';

class UploadPage extends StatefulWidget {
  @override
  _UploadPageState createState() => _UploadPageState();
}

class _UploadPageState extends State<UploadPage> {

  PickedFile file;

  captureImageWithCamera() async {
    Navigator.pop(context);
    final picker = ImagePicker();
    PickedFile imageFile = await picker.getImage(
      source: ImageSource.camera,
      maxHeight: 680,
      maxWidth: 970,
    );
    imageFile = PickedFile(imageFile.path);
    setState(() {
      this.file = imageFile;
    });
  }

  pickImageFromGallery() async {

    Navigator.pop(context);
    final picker = ImagePicker();
    PickedFile imageFile = await picker.getImage(
      source: ImageSource.gallery,
      maxHeight: 680,
      maxWidth: 970,
    );
    imageFile = PickedFile(imageFile.path);
    setState(() {
      this.file = imageFile;
    });
  }

  takeImage(mContext){
    return showDialog(
        context: mContext,
        builder: (context){
          return SimpleDialog(
            title: Text("New Post", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),),
            children: [
              SimpleDialogOption(
                child: Text("Capture image with camera", style: TextStyle(color: Colors.white),),
                onPressed: captureImageWithCamera,
              ),
              SimpleDialogOption(
                child: Text("Select image from gallery", style: TextStyle(color: Colors.white),),
                onPressed: pickImageFromGallery,
              ),
              SimpleDialogOption(
                child: Text("Cancel", style: TextStyle(color: Colors.white),),
                onPressed: () => Navigator.pop(context),
              ),

            ],
          );
        }
    );
  }

  displayUploadScreen(){
    return Container(
      color: Theme.of(context).accentColor.withOpacity(0.5),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Icon(Icons.add_a_photo, color: Colors.grey,size: 200.0,),
          Padding(
            padding: EdgeInsets.only(top: 20.0),
            child: RaisedButton(
              shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(9.0),),
              child: Text("Upload Image", style: TextStyle(color: Colors.white, fontSize: 20.0),),
              color: Colors.green,
              onPressed: () => takeImage(context),
            ),
          ),
        ],
      ),
    );
  }


  @override
  Widget build(BuildContext context) {
    return displayUploadScreen();
  }
}

If you would like to see my code or other files I would like to share with you. Can you please guide me?

Thank you in advance.

Regards, Ekin.

3 Answers

Updated July 2021:

There are no defined answers to why these warnings are coming but can follow some steps.

  1. make sure that <uses-permission android:name="android.permission.INTERNET"/> is defined in all the three AndroidManifest.xml files that i.e debug/main/profile.

for some, having <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> in main AndroidManifest file also helps.

  1. Sometimes outdated google play services can also cause these warnings so update google play services this happens mostly in the case of an emulator.

  2. if you are running your app on older device make user that multi-dex is enabled.

to enable multi-dex support add the following code in

app/build.gradle file

defaultConfig {
        applicationId "com.example.flutter_test_firebase"
        minSdkVersion 16
        targetSdkVersion 30
        multiDexEnabled true  //<= add this line
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

and inside the same file add following dependencies

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation("com.android.support:multidex:1.0.3") // for multi-dex
}

Also make sure that you are using latest firebase plugins.

i don't know where you accessed the firestore package but in my case i was trying to update data but i was actually deleting and creating a new one which don't have the data i need to access in my code. So my only advice is gone be make sure you are not accidently deleting data or trying to access data you don't or will not have by some unknown reason go to your firestore database and make sure your data is as you want it. I have seen answers saying you need to update your google service in your emulator so maybe that might be your case but its not mine if you go to your google play service app in setting and see deactivate that means your emulator is already updated plus it will say update your google play service.

I got the same error when my app starts in emulator, also when I clicked add new data button. Actually my problem is exactly to add new data to Firebase Firestore in Flutter.

I updated the Google Play Services, and it worked for me.

To update the Google Play Services, following:

File > Settings > Appearance & Behavior > System Settings > Android SDK > SDK Tools, and select the Google Play Services and update.

Hope it works.

Related