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

null pointer dereference on FlutterDownloader.open #178

Closed
Gicminos opened this issue Nov 18, 2019 · 1 comment
Closed

null pointer dereference on FlutterDownloader.open #178

Gicminos opened this issue Nov 18, 2019 · 1 comment

Comments

@Gicminos
Copy link

Gicminos commented Nov 18, 2019

Hello guys, sorry for this question but I am getting a weird problem with my code:

``D/skia (24326): --- SkAndroidCodec::NewFromStream returned null
E/NotificationManager(24326): notifyAsUser: tag=null, id=5, user=UserHandle{0}
D/DownloadWorker(24326): File downloaded
I/WM-WorkerWrapper(24326): Worker result SUCCESS for Work [ id=ea7d6b1a-ee43-4c8d-a227-25de6da0d8b5, tags={ flutter_download_task, vn.hunghd.flutterdownloader.DownloadWorker } ]
F/libc (24326): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x1 in tid 24412 (Thread-6)


Build fingerprint: 'HUAWEI/WAS-LX1A/HWWAS-H:8.0.0/HUAWEIWAS-LX1A/372(C55):user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 24326, tid: 24412, name: Thread-6 >>> com.ndwebsolutions.itsec <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1
Cause: null pointer dereference
x0 0000000000000001 x1 00000075ea8fd3a0 x2 00000075ea800000 x3 0000000000000002
x4 00000000000000fd x5 0000000000000000 x6 00000075edb41ef0 x7 0000000000000000
x8 000000760337c160 x9 000000760337c160 x10 00000000000000fd x11 0000000000000000
x12 00000075eff5d108 x13 0000000000000010 x14 00000000004c0238 x15 00000075edb41ef0
x16 000000760e0d9cb8 x17 000000760e0781b0 x18 00000000000000ec x19 00000075e2cbf420
x20 00000075eff48260 x21 00000075e4c292b0 x22 00000075e4c292e0 x23 00000075e2fb0918
x24 000000000000004a x25 00000075edb42248 x26 0000000000000000 x27 0000000000000001
x28 000000000000004a x29 00000075edb423a0 x30 00000075eef24c58
sp 00000075edb420f0 pc 00000075eef20990 pstate 0000000080000000
backtrace:
#00 pc 00000000011d3990 /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#1 pc 00000000011d7c54 /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#2 pc 00000000011cf744 /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#3 pc 00000000011d5a78 /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#4 pc 00000000011d6154 /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#5 pc 00000000011d55b0 /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#6 pc 00000000011da7c8 /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#7 pc 0000000000015f18 /system/lib64/libutils.so (_ZN7android6Looper9pollInnerEi+808)
#8 pc 0000000000015b68 /system/lib64/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+108)
#9 pc 0000000000013944 /system/lib64/libandroid.so (ALooper_pollOnce+92)
#10 pc 00000000011da74c /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#11 pc 00000000011d54fc /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#12 pc 00000000011d86a0 /data/app/com.ndwebsolutions.itsec-0DdWkC6eLGy4wYkE1ffz3A==/lib/arm64/libflutter.so (offset 0x11c0000)
#13 pc 0000000000066a20 /system/lib64/libc.so (_ZL15__pthread_startPv+36)
#14 pc 000000000001ee64 /system/lib64/libc.so (__start_thread+68)``

This is the code I am trying to execute:

                try {
                  await FlutterDownloader.initialize();
                } catch (ignored) {}

                Directory externalDirectory = await getExternalStorageDirectory();
                Directory saveDir = await new Directory(externalDirectory.path + '/itsec').create(recursive: true);
                String path = saveDir.path;
                String taskId = await FlutterDownloader.enqueue(
                    url: file.downloadLink,
                    savedDir: path,
                    showNotification: true,
                    // show download progress in status bar (for Android)
                    openFileFromNotification: true,
                    // click on notification to open downloaded file (for Android)
                    fileName: file.originalName);
                FlutterDownloader.open(taskId: taskId);

Thank you for your help in advance!

@Gicminos
Copy link
Author

I think the problem was that I cannot call FlutterDownloader.open(taskId: taskId); just like that because I don't know if the download has been completed yet or not

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

1 participant