Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter mailer issue in android #25

Closed
0xdhu opened this issue May 7, 2020 · 2 comments
Closed

Flutter mailer issue in android #25

0xdhu opened this issue May 7, 2020 · 2 comments
Labels
Android android related issues bug Something isn't working question Further information is requested

Comments

@0xdhu
Copy link

0xdhu commented May 7, 2020

Hello.
I wanted to send email to other person in flutter
so I was using flutter_mailer package for this.
I was thinking code has no issue but when I try to send email. i had issue like this.
please help me.

E/Flutter_mailer Size==1( 4356): Attempt to invoke virtual method 'void android.app.Activity.startActivityForResult(android.content.Intent, int)' on a null object reference
E/flutter ( 4356): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'void android.app.Activity.startActivityForResult(android.content.Intent, int)' on a null object reference, null)
E/flutter ( 4356): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter ( 4356): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter ( 4356): <asynchronous suspension>
E/flutter ( 4356): #2      FlutterMailer.send (package:flutter_mailer/flutter_mailer.dart:9:21)
E/flutter ( 4356): #3      MailService.sendMailToClient (package:billsender/service/mailservice.dart:16:25)

This is my flutter doctor -v

Flutter (Channel dev, v1.16.4-pre.132, on Mac OS X 10.15.4 19E287, locale
    en-CN)
    • Flutter version 1.16.4-pre.132 at /Users/kk/Developer/flutter
    • Framework revision 727552e5ca (4 weeks ago), 2020-04-06 13:38:41 -0700
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/kk/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
    • Xcode at /Users/kk/Downloads/Xcode.app/Contents/Developer
    • Xcode 11.0, Build version 11A420a
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)

[!] IntelliJ IDEA Ultimate Edition (version 2020.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.44.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.10.1

[✓] Connected device (1 available)

This is my script

import 'package:flutter_mailer/flutter_mailer.dart';

class MailService {

  void sendMailToClient(String path) async{
    final MailOptions mailOptions = MailOptions(
      body: 'The new Folder with some bills arrived.',
      subject: 'From Bills App',
      recipients: ['myemail@163.com'],
      isHTML: true,
      bccRecipients: ['other@example.com'],
      ccRecipients: ['third@example.com'],
//    attachments: [ 'path/to/image.png', ],
    );
    await FlutterMailer.send(mailOptions);
  }
}
@taljacobson
Copy link
Owner

Probably related to #19.

Do you mind trying out 0.5.0-dev.7.

@taljacobson taljacobson added Android android related issues bug Something isn't working labels May 7, 2020
@taljacobson
Copy link
Owner

do you still experience this issue with 0.5.0 and flutter 1.17.0.

did you upgrade your android project based off Upgrading-pre-1.12-Android-projects?

@taljacobson taljacobson added the question Further information is requested label Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android android related issues bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants