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_file_downloader/MethodCallHandlerImpl.java uses unchecked or unsafe operations. #8

Open
ajmaltechgentsia opened this issue Mar 29, 2023 · 12 comments
Labels
enhancement New feature or request

Comments

@ajmaltechgentsia
Copy link

ajmaltechgentsia commented Mar 29, 2023

flutter_file_downloader/MethodCallHandlerImpl.java uses unchecked or unsafe operations.

@abdallah-odeh
Copy link
Owner

Can you please provide more info about your issue?
logs, device info & your flutter doctor & version info would be helpful

@khubabcreation
Copy link

downloadFile error: MissingPluginException(No implementation found for method downloadFile on channel com.abdallah.libs/file_downloader)

@khubabcreation
Copy link

now this error apear !
i think you ought to review your code ! when i look into the Example* it shows me only a tab_bar code . So Please check your code . On the Other hand when we run our project after getting your package it show this kind of error

@abdallah-odeh
Copy link
Owner

downloadFile error: MissingPluginException(No implementation found for method downloadFile on channel com.abdallah.libs/file_downloader)

Since this is a plugin (contains native code), you need to do a Hot restart, thus, Hot reload will give you such error
Can you please try to do a Hot restart or kill the app and perform a normal run and tell me the results?

Thank you for helping me making this plugin better & bugs free

@abdallah-odeh
Copy link
Owner

abdallah-odeh commented Apr 10, 2023

now this error apear !
i think you ought to review your code ! when i look into the Example* it shows me only a tab_bar code . So Please check your code . On the Other hand when we run our project after getting your package it show this kind of error

I believe that you mean this warning? I will be working on it this weekend to figure out what is deprecated in the native code, but the example app works fine even when it appears (it did not appear with me every time I performed a run)
Screen Shot 2023-04-10 at 9 18 08 AM

also for the second issue you have,

i think you ought to review your code ! when i look into the Example* it shows me only a tab_bar code . So Please check your code .

did you try to run it and it gave you blank screen? It is indeed a Tabbar because it contains [SettingsTab, SingleDownload, Bulk download], also I tried to download it and run it on a different machine and it worked as intended.
Please try to download the example code & run it, and if the issue persists, provide logs, your flutter version & preferably the device type you tried the code on

Thank you again

@Ajoz101
Copy link

Ajoz101 commented Apr 15, 2023

Hi I use this package just fine in my flutter app, but I have faced an issue, whenever I cancel a download, the app crashes every time, So can you please provide me with a proper solution... Thanks in advance

Here is my terminal output during the error:

E/AndroidRuntime( 3282): FATAL EXCEPTION: Thread-8
E/AndroidRuntime( 3282): Process: com.example.college_access, PID: 3282
E/AndroidRuntime( 3282): android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
E/AndroidRuntime( 3282): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:515)
E/AndroidRuntime( 3282): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:138)
E/AndroidRuntime( 3282): at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:76)
E/AndroidRuntime( 3282): at android.database.CursorWrapper.getLong(CursorWrapper.java:131)
E/AndroidRuntime( 3282): at android.database.CursorWrapper.getLong(CursorWrapper.java:131)
E/AndroidRuntime( 3282): at android.app.DownloadManager$CursorTranslator.getLong(DownloadManager.java:2317)
E/AndroidRuntime( 3282): at android.app.DownloadManager$CursorTranslator.getInt(DownloadManager.java:2307)
E/AndroidRuntime( 3282): at com.odehbros.flutter_file_downloader.core.DownloadTask$1.run(DownloadTask.java:66)
E/AndroidRuntime( 3282): at java.lang.Thread.run(Thread.java:919)
I/Process ( 3282): Sending signal. PID: 3282 SIG: 9

@abdallah-odeh
Copy link
Owner

@Ajoz101 Oh, didn't test that!
I'll investigate that today and let you know the results

@abdallah-odeh
Copy link
Owner

@Ajoz101
The bug is now solved, please test it out on version flutter_file_downloader: ^1.1.2
if you encountered any issue please let me know

@Ajoz101
Copy link

Ajoz101 commented Apr 15, 2023

@abdallah-odeh
Thank you so Much! I tested the new version and the bug is now solved ✔️👏
Keep on the great progress 👏

@abdallah-odeh
Copy link
Owner

@Ajoz101
That's great to hear,
thank for helping in making this plugin better.

@abdallah-odeh abdallah-odeh added the enhancement New feature or request label Apr 19, 2023
@HitogiriSama
Copy link

Exception java.lang.NullPointerException:
at com.odehbros.flutter_file_downloader.MethodCallHandlerImpl$1.onProgress (MethodCallHandlerImpl.java)
at com.odehbros.flutter_file_downloader.core.DownloadTask.lambda$trackDownload$1 (DownloadTask.java)
at android.os.Handler.handleCallback (Handler.java:739)
at android.os.Handler.dispatchMessage (Handler.java:95)
at android.os.Looper.loop (Looper.java:145)
at android.app.ActivityThread.main (ActivityThread.java:6145)
at java.lang.reflect.Method.invoke
at java.lang.reflect.Method.invoke (Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1194)

@amdkholil
Copy link

hallo @abdallah-odeh

I am using the latest version, but I still encounter this issue :
image

The application still runs well on my device, but there are concerns that it won't work properly on other devices

thanks for the update

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

No branches or pull requests

6 participants