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

Problem while using schedule notification #673

Closed
adarshbalu opened this issue Jun 21, 2020 · 19 comments
Closed

Problem while using schedule notification #673

adarshbalu opened this issue Jun 21, 2020 · 19 comments

Comments

@adarshbalu
Copy link

adarshbalu commented Jun 21, 2020

The app stops abruptly when setting scheduled notifications.


E/flutter (22447): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.AssertionError: java.lang.NoSuchFieldException: DrawableResource
E/flutter (22447): 	at c.e.f.y.n.n$j0.<init>(:792)
E/flutter (22447): 	at c.e.f.y.n.n$w.a(:818)
E/flutter (22447): 	at c.e.f.f.a(:458)
E/flutter (22447): 	at c.e.f.y.n.i.a(:117)
E/flutter (22447): 	at c.e.f.y.n.i.a(:166)
E/flutter (22447): 	at c.e.f.y.n.i.a(:102)
E/flutter (22447): 	at c.e.f.f.a(:458)
E/flutter (22447): 	at c.e.f.f.a(:696)
E/flutter (22447): 	at c.e.f.f.a(:683)
E/flutter (22447): 	at c.e.f.f.a(:638)
E/flutter (22447): 	at c.e.f.f.a(:618)
E/flutter (22447): 	at com.dexterous.flutterlocalnotifications.b.b(:261)
E/flutter (22447): 	at com.dexterous.flutterlocalnotifications.b.f(:818)
E/flutter (22447): 	at com.dexterous.flutterlocalnotifications.b.onMethodCall(:754)
E/flutter (22447): 	at d.a.c.a.j$a.a(:226)
E/flutter (22447): 	at io.flutter.embedding.engine.e.b.a(:85)
E/flutter (22447): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(:631)
E/flutter (22447): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (22447): 	at android.os.MessageQueue.next(MessageQueue.java:336)
E/flutter (22447): 	at android.os.Looper.loop(Looper.java:182)
E/flutter (22447): 	at android.app.ActivityThread.main(ActivityThread.java:7822)
E/flutter (22447): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter (22447): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/flutter (22447): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026)
E/flutter (22447): Caused by: java.lang.NoSuchFieldException: DrawableResource
E/flutter (22447): 	at java.lang.Class.getField(Class.java:1604)
E/flutter (22447): 	at c.e.f.y.n.n$j0.<init>(:781)
E/flutter (22447): 	... 23 more
E/flutter (22447): 
F/flutter (22447): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env). 
F/libc    (22447): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 22447 (ect.elderly_app), pid 22447 (ect.elderly_app)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Realme/RMX1825/RMX1825:10/QP1A.190711.020/1588181793:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2020-06-21 13:06:21+0530
pid: 22447, tid: 22447, name: ect.elderly_app  >>> app.csminiproject.elderly_app <<<
uid: 10248
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env). 
'
    x0  0000000000000000  x1  00000000000057af  x2  0000000000000006  x3  0000007ffdbdbf30
    x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  0080000000000000
    x8  00000000000000f0  x9  00000075a8568760  x10 0000000000000000  x11 0000000000000001
    x12 000000000af47f20  x13 0000000000000003  x14 0000000000000001  x15 0000000000000010
    x16 00000075a86378c8  x17 00000075a8614cd0  x18 00000075ac008000  x19 00000000000000ac
    x20 00000000000057af  x21 00000000000000b2  x22 00000000000057af  x23 00000000ffffffff
    x24 0000007514fd02d8  x25 00000075ab7b9020  x26 0000000000000001  x27 000000000000004b
    x28 0000000000000001  x29 0000007ffdbdbfe0
    sp  0000007ffdbdbf10  lr  00000075a85c71f0  pc  00000075a85c7220
backtrace:
      #00 pc 0000000000083220  /apex/com.android.runtime/lib64/bionic/libc.so (abort+176) (BuildId: 6ea9d62fbffd5b8f56424b88eb1e2ba9)
      #01 pc 00000000012961c8  /data/app/app.csminiproject.elderly_app-60FVkF74qsZQBfwnTkDJig==/lib/arm64/libflutter.so!libflutter.so (offset 0x1280000) (BuildId: 4ada23421e134626e76e3868a3bf1a955729145f)
      #02 pc 0000000001287134  /data/app/app.csminiproject.elderly_app-60FVkF74qsZQBfwnTkDJig==/lib/arm64/libflutter.so!libflutter.so (offset 0x1280000) (BuildId: 4ada23421e134626e76e3868a3bf1a955729145f)
      #03 pc 000000000128560c  /data/app/app.csminiproject.elderly_app-60FVkF74qsZQBfwnTkDJig==/lib/arm64/libflutter.so!libflutter.so (offset 0x1280000) (BuildId: 4ada23421e134626e76e3868a3bf1a955729145f)
      #04 pc 00000000012d3da8  /data/app/app.csminiproject.elderly_app-60FVkF74qsZQBfwnTkDJig==/lib/arm64/libflutter.so!libflutter.so (offset 0x1280000) (BuildId: 4ada23421e134626e76e3868a3bf1a955729145f)
      #05 pc 0000000001296acc  /data/app/app.csminiproject.elderly_app-60FVkF74qsZQBfwnTkDJig==/lib/arm64/libflutter.so!libflutter.so (offset 0x1280000) (BuildId: 4ada23421e134626e76e3868a3bf1a955729145f)
      #06 pc 000000000129b774  /data/app/app.csminiproject.elderly_app-60FVkF74qsZQBfwnTkDJig==/lib/arm64/libflutter.so!libflutter.so (offset 0x1280000) (BuildId: 4ada23421e134626e76e3868a3bf1a955729145f)
      #07 pc 0000000000018024  /system/lib64/libutils.so (android::Looper::pollInner(int)+860) (BuildId: 5e9192365bf776aa8e372cdfad25f969)
      #08 pc 0000000000017c28  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+56) (BuildId: 5e9192365bf776aa8e372cdfad25f969)
      #09 pc 000000000013acb4  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44) (BuildId: 0025258b1774d52872cd8dff3460ef80)
      #10 pc 00000000002e6afc  /system/framework/arm64/boot-framework.oat (art_jni_trampoline+140) (BuildId: 57c34bd8b70796390aa25cd6d19b14fc0873148e)
      #11 pc 000000000200ee8c  /memfd:/jit-cache (deleted) (android.os.MessageQueue.next+204)
      #12 pc 0000000000136334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #13 pc 00000000001450ac  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #14 pc 00000000002e26d8  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #15 pc 00000000002dd764  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+900) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #16 pc 00000000005a0e70  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+648) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #17 pc 0000000000130814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #18 pc 0000000000340bf6  /system/framework/framework.jar (android.os.Looper.loop+182)
      #19 pc 00000000005a3d10  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #20 pc 0000000000130994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #21 pc 000000000019bc1e  /system/framework/framework.jar (android.app.ActivityThread.main+214)
      #22 pc 00000000002b3008  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.13987995488229374713+240) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #23 pc 0000000000592308  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1024) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #24 pc 000000000013f468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #25 pc 00000000001365b8  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #26 pc 00000000001450cc  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #27 pc 00000000004b13c0  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #28 pc 00000000004b2e08  /apex/com.android.runtime/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1472) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #29 pc 000000000043eb58  /apex/com.android.runtime/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+48) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #30 pc 00000000000c5c34  /system/framework/arm64/boot.oat (art_jni_trampoline+180) (BuildId: 4ef3d92d36de41994f7122e8928fba6554f7e3b0)
      #31 pc 0000000000136334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #32 pc 00000000001450ac  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #33 pc 00000000002e26d8  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #34 pc 00000000002dd764  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+900) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #35 pc 00000000005a0e70  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+648) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #36 pc 0000000000130814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #37 pc 00000000003f7386  /system/framework/framework.jar (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
      #38 pc 00000000002b3008  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.13987995488229374713+240) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #39 pc 0000000000592308  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1024) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #40 pc 000000000013f468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #41 pc 0000000000a9fb14  /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2260) (BuildId: 57c34bd8b70796390aa25cd6d19b14fc0873148e)
      #42 pc 00000000001365b8  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #43 pc 00000000001450cc  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #44 pc 00000000004b13c0  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #45 pc 00000000004b1020  /apex/com.android.runtime/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+408) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #46 pc 00000000003bbfe0  /apex/com.android.runtime/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+624) (BuildId: 23b4d5ba03a2bf45194d7fec82797f11)
      #47 pc 00000000000c158c  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+116) (BuildId: 0025258b1774d52872cd8dff3460ef80)
      #48 pc 00000000000c44f0  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+920) (BuildId: 0025258b1774d52872cd8dff3460ef80)
      #49 pc 00000000000034e0  /system/bin/app_process64 (main+1168) (BuildId: d0d68ecae54210cab45a561528d0b288)
      #50 pc 000000000007e8dc  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: 6ea9d62fbffd5b8f56424b88eb1e2ba9)

Lost connection to device.

@adarshbalu
Copy link
Author

There is no issue while using normal display notifications. Only when using this code shown in documentation

var scheduledNotificationDateTime =
        DateTime.now().add(Duration(seconds: 5));
var androidPlatformChannelSpecifics =
    AndroidNotificationDetails('your other channel id',
        'your other channel name', 'your other channel description');
var iOSPlatformChannelSpecifics =
    IOSNotificationDetails();
NotificationDetails platformChannelSpecifics = NotificationDetails(
    androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.schedule(
    0,
    'scheduled title',
    'scheduled body',
    scheduledNotificationDateTime,
    platformChannelSpecifics);

@MaikuB
Copy link
Owner

MaikuB commented Jun 21, 2020

If you come across a bug, please make sure to file a bug using the bug report template and include a link to a minimal app that can reproduce the problem. Currently, the information you've provided isn't sufficient and I won't be looking further into this as until this is done as I can only currently rely on guesswork.

Before you do so, please double check make sure you have followed all of the instructions in the readme very carefully. A lot of issues I've seen are often a result of steps that have been missed

@adarshbalu
Copy link
Author

adarshbalu commented Jun 21, 2020

If you come across a bug, please make sure to file a bug using the bug report template and include a link to a minimal app that can reproduce the problem. Currently, the information you've provided isn't sufficient and I won't be looking further into this as until this is done as I can only currently rely on guesswork.

Before you do so, please double check make sure you have followed all of the instructions in the readme very carefully. A lot of issues I've seen are often a result of steps that have been missed

I followed every instruction and I have tried it in multiple devices. Sorry about the reporting issue.
Followed from this as well.
Link

@MaikuB
Copy link
Owner

MaikuB commented Jun 21, 2020

You mentioned that you have followed all instructions but that repository belongs to another person in the community that did live coding tutorials

@MaikuB
Copy link
Owner

MaikuB commented Jun 21, 2020

Should add that the repo is old and the instructions have changed since then. Please provide a link to your own repo or this issue will be closed. There have been a number of cases where others have insisted that they have followed all instructions only for to find out that they haven't. For all I know, that might be the case again and there's an example app on this repository that doesn't have such issues

@MaikuB MaikuB closed this as completed Jun 21, 2020
@MaikuB MaikuB reopened this Jun 21, 2020
@adarshbalu
Copy link
Author

@adarshbalu
Copy link
Author

Should add that the repo is old and the instructions have changed since then. Please provide a link to your own repo or this issue will be closed. There have been a number of cases where others have insisted that they have followed all instructions only for to find out that they haven't. For all I know, that might be the case again and there's an example app on this repository that doesn't have such issues

Please check my repo.

@MaikuB
Copy link
Owner

MaikuB commented Jun 21, 2020

You haven't done everything needed for the release build configuration. A file needs to be added to make sure things like notifications are preserved by the compiler. Please re-read the readme and make use of the example app if needed to ensure that has been added

@adarshbalu
Copy link
Author

You haven't done everything needed for the release build configuration. A file needs to be added to make sure things like notifications are preserved by the compiler. Please re-read the readme and make use of the example app if needed to ensure that has been added

Can you tell me exactly what I missed ?
Because i don't have issues using show() method , only when any using schedule functions

@MaikuB
Copy link
Owner

MaikuB commented Jun 21, 2020

I already have. Please read the last paragraph of the release build configuration as I'd just be repeating myself and developers may need to tweak things based on what's in their app

@adarshbalu
Copy link
Author

adarshbalu commented Jun 21, 2020

I already have. Please read the last paragraph of the release build configuration as I'd just be repeating myself and developers may need to tweak things based on what's in their app

Did just as you said. I will let you know after i check it. Anyways thanks for your time.

@MaikuB
Copy link
Owner

MaikuB commented Jun 21, 2020

Another thing to add is that your app isn't using a drawable resource for the notification icon, which is the official way to do so. Whilst using the launcher icon works, it is the official way to refer to notification icons so you're doing so at your own risk

@adarshbalu
Copy link
Author

Another thing to add is that your app isn't using a drawable resource for the notification icon, which is the official way to do so. Whilst using the launcher icon works, it is the official way to refer to notification icons so you're doing so at your own risk

Okay. Thank you.

@adarshbalu
Copy link
Author

adarshbalu commented Jun 21, 2020

Checked it right now. Still has the same issue. Please check the repo.

@MaikuB
Copy link
Owner

MaikuB commented Jun 21, 2020

Your repo is still missing the file I mentioned earlier and in the readme. I'm going to copy and paste the exact paragraph from the readme. Please do not rush and go through things very carefully

⚠️ Ensure that you have configured the resources that should be kept so that resources like your notification icons aren't discarded by the R8 compiler by following the instructions here. Without doing this, you might not see the icon you've specified in your app's notifications. The configuration used by the example app can be found here where it is specifying that all drawable resources should be kept, as well as the file used to play a custom notification sound (sound file is located here).

@adarshbalu
Copy link
Author

Should add that the repo is old and the instructions have changed since then. Please provide a link to your own repo or this issue will be closed. There have been a number of cases where others have insisted that they have followed all instructions only for to find out that they haven't. For all I know, that might be the case again and there's an example app on this repository that doesn't have such issues

I cloned this repo and installed the app. It works. I don't know what the issue is.

@adarshbalu
Copy link
Author

Your repo is still missing the file I mentioned earlier and in the readme. I'm going to copy and paste the exact paragraph from the readme. Please do not rush and go through things very carefully

⚠️ Ensure that you have configured the resources that should be kept so that resources like your notification icons aren't discarded by the R8 compiler by following the instructions here. Without doing this, you might not see the icon you've specified in your app's notifications. The configuration used by the example app can be found here where it is specifying that all drawable resources should be kept, as well as the file used to play a custom notification sound (sound file is located here).

Did all that now the scheduling works on profile mode, app crashes on debug mode.

@MaikuB
Copy link
Owner

MaikuB commented Jun 21, 2020

Please check your application's settings for debug builds then.

Also as you're no longer actually reporting a bug and got the example app working, if you continue to run into issues then please make use of one of the sites listed as https://flutter.dev/community.

@MaikuB MaikuB closed this as completed Jun 21, 2020
@adarshbalu
Copy link
Author

It works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants