Giter VIP home page Giter VIP logo

Comments (9)

AndreyMolochko avatar AndreyMolochko commented on July 26, 2024 3

I had the same problem. For solving this problem you should apply permissions on write data in contacts. It's a dangerous permissions, so add permission only in manifest is not enough. For call window applying or dinying permissions you can use permission_handler 4.2.0 .

await PermissionHandler().requestPermissions([PermissionGroup.contacts]);

After calling this method you can apply permission and contact will be added. By the way, this solution is needed only for android devices with Android 6.0 (API level 23) or higher. In lower versions you apply all permissions, when install your app.

This question is on StackOverFlow. You can raise a question and answer this on StackOverFlow to inform more people.
https://stackoverflow.com/questions/57969216/getting-this-error-unhandled-exception-formatexception-invalid-envelope-wh/59891554#59891554

from flutter_contacts.

COCPORN avatar COCPORN commented on July 26, 2024

I am getting the same issue. Let me know if you need help to reproduce.

from flutter_contacts.

hsul4n avatar hsul4n commented on July 26, 2024

Same problem here!!

from flutter_contacts.

lukasgit avatar lukasgit commented on July 26, 2024

@Rajeshhmuthyala @COCPORN @hsult4n please post steps / code to reproduce. Thanks

from flutter_contacts.

COCPORN avatar COCPORN commented on July 26, 2024

Disclaimer: I am totally new to flutter. I can provide a full repo that compiles and runs, but this here is the offending code:

  void _saveNumber() {
    debugPrint('Saving number ${numberController.text}'); 
    PostalAddress address = PostalAddress(label: "Home");
    Contact contact = Contact(
      displayName: nameController.text,
      givenName: nameController.text,
      phones: [Item(label: 'mobile', value: numberController.text)],
      postalAddresses: [address]      
    );
    ContactsService.addContact(contact);
    setState(() {
      numberController.text = '';
      nameController.text = '';
    });
  }

from flutter_contacts.

Sthefanny avatar Sthefanny commented on July 26, 2024

same problem... any solutions?

from flutter_contacts.

AndreyMolochko avatar AndreyMolochko commented on July 26, 2024

The same problem

from flutter_contacts.

isojtouano avatar isojtouano commented on July 26, 2024

@AndreyMolochko 's answer worked for me, thanks!

from flutter_contacts.

lukasgit avatar lukasgit commented on July 26, 2024

#60 (comment) looks like the working solution here. Closing this issue.

from flutter_contacts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.