HomeX-It / open-mail-app-flutter

This library provides the ability to query the device for installed email apps and open those apps.
MIT License
36 stars 91 forks source link

problem opening the Gmail application from a Samsung S21 #54

Open monta85 opened 1 year ago

monta85 commented 1 year ago

Hello, The problem is that I can't open the Gmail application from my Samsung S21 (Android version 13) even though the application is well installed on my phone but it works fine on Samsung Galaxy S10e (Android version 12) and it works fine on Samsung OnePlus 6 (Android version 11) I'm sending you the error logs that I have: I/flutter (20768): at com.homex.open_mail_app.OpenMailAppPlugin.composeNewEmailInSpecificEmailAppIntent(OpenMailAppPlugin.kt:208) I/flutter (20768): #0 StandardMethodCodec.decodeEnvelope package:flutter/…/services/message_codecs.dart:653 I/flutter (20768): #1 MethodChannel._invokeMethod package:flutter/…/services/platform_channel.dart:296 I/flutter (20768): <asynchronous suspension> I/flutter (20768): #2 OpenMailApp.composeNewEmailInSpecificMailApp package:open_mail_app/open_mail_app.dart:200 I/flutter (20768): <asynchronous suspension>

I hope we will have a correction very soon because I need correction and also your Lib is the best compared to the other Libs which have the same context

monta85 commented 1 year ago

@MisterJimson can you help me to resolve this problem please and update the lib version ?

MisterJimson commented 1 year ago

I no longer am a maintainer of this library and no longer work at the company who owns it. I suggest you use the example app to debug the issue on your device.

monta85 commented 1 year ago

@diskwriter can you help me to resolved this problem i will put more log when i have this problem :

E/MethodChannel#open_mail_app(31993): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) E/flutter (31993): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Unable to find explicit activity class {com.google.android.gm/com.google.android.gm.ComposeActivityGmailExternal}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?, null, android.content.ActivityNotFoundException: Unable to find explicit activity class {com.google.android.gm/com.google.android.gm.ComposeActivityGmailExternal}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>? E/flutter (31993): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2171) E/flutter (31993): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1805) E/flutter (31993): at android.app.ContextImpl.startActivity(ContextImpl.java:1145) E/flutter (31993): at android.app.ContextImpl.startActivity(ContextImpl.java:1116) E/flutter (31993): at android.content.ContextWrapper.startActivity(ContextWrapper.java:441) E/flutter (31993): at com.homex.open_mail_app.OpenMailAppPlugin.composeNewEmailInSpecificEmailAppIntent(OpenMailAppPlugin.kt:208) E/flutter (31993): at com.homex.open_mail_app.OpenMailAppPlugin.onMethodCall(OpenMailAppPlugin.kt:64) E/flutter (31993): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262) E/flutter (31993): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/flutter (31993): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319) E/flutter (31993): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/flutter (31993): at android.os.Handler.handleCallback(Handler.java:942) E/flutter (31993): at android.os.Handler.dispatchMessage(Handler.java:99) E/flutter (31993): at android.os.Looper.loopOnce(Looper.java:226) E/flutter (31993): at android.os.Looper.loop(Looper.java:313) E/flutter (31993): at android.app.ActivityThread.main(ActivityThread.java:8757) E/flutter (31993): at java.lang.reflect.Method.invoke(Native Method) E/flutter (31993): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) E/flutter (31993): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) E/flutter (31993): ) E/flutter (31993): #0 StandardMethodCodec.decodeEnvelope package:flutter/…/services/message_codecs.dart:653 E/flutter (31993): #1 MethodChannel._invokeMethod package:flutter/…/services/platform_channel.dart:296 E/flutter (31993): <asynchronous suspension> E/flutter (31993): #2 OpenMailApp.composeNewEmailInSpecificMailApp package:open_mail_app/open_mail_app.dart:202 E/flutter (31993): <asynchronous suspension> E/flutter (31993):

diskwriter commented 1 year ago

@monta85 Looking at the error message, did you check this part? have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>

monta85 commented 1 year ago

@diskwriter I don't add any activity but when i use composeNewEmailInSpecificMailApp from your lib i have this problem with Android 13 beause it work fine with android 11 and android 12 but with android 13 i have this problem can you check lib please because i think you have a problem with Android 13. looking forward to your reply

monta85 commented 1 year ago

@diskwriter I think the problem is in your OpenMailAppPlugin.kt private fun composeNewEmailInSpecificEmailAppIntent(@NonNull name: String, @NonNull contentJson: String): Boolean {... } and exactly in setClassName(specificEmailActivity.activityInfo.packageName, specificEmailActivity.activityInfo.name)
because when i comment this line and i build again application and open Dialog and if you have outlook and gmail and yahoo apps, when you click in app it is outlook that will be open

can you correct this please and update the lib ?

diskwriter commented 1 year ago

@monta85 I am not (and have never been) a maintainer of this library. I suggest you open a PR and start contributing yourself.