fluttercommunity / fluttercommunity/flutter_downloader
Crash on release mode
- Dominant language
- Kotlin
- Stars
- 940
- Forks
- 561
- Avg merge
- 1h 18m
- Merged PRs (30d)
- 1
Description
On Android release mode app crashes after hitting download button (enqueue function call) with no log printed. Callback method has the `@pragma('vm:entry-point')` annotation but it still doesn't work. I should mention that this version on debug mode and previous version of app with the same exact code (flutter_downloader part of code) works perfectly fine but since then I have upgraded Flutter and also changed the version of package, however downgrading it didn't help.
```
class DownloadCallbackMethod {
DownloadCallbackMethod._();
@pragma('vm:entry-point')
static void downloadCallback(
String id,
DownloadTaskStatus status,
int progress,
) {
final send = IsolateNameServer.lookupPortByName(downloadSendPort);
send?.send(
DownloadCallbackResponseModel.fromCallback(
id: id,
progress: progress,
status: status,
),
);
}
}
```
```
await FlutterDownloader.registerCallback(
DownloadCallbackMethod.downloadCallback);
```
here's my enqueue function:
```
Future enqueue({
required String url,
required String saveDir,
required String fileName,
}) async {
log(url);
return FlutterDownloader.enqueue(
url: url,
savedDir: saveDir,
requiresStorageNotLow: true,
showNotification: false,
openFileFromNotification: false,
fileName: fileName,
);
}
```
my `flutter doctor -v` output:
```
[√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [Version 10.0.22621.1265], locale en-US)
• Flutter version 3.3.2 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e3c29ec00c (6 months ago), 2022-09-14 08:46:55 -0500
• Engine revision a4ff2c53d8
• Dart version 2.18.1
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\Mehrzad\AppData\Local\Android\Sdk
• Platform android-33, build-tools 33.0.0
• ANDROID_HOME = C:\Users\Mehrzad\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[√] VS Code (version 1.75.1)
• VS Code at C:\Users\Mehrzad\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.58.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.1265]
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.177
• Edge (web) • edge • web-javascript • Microsoft Edge 110.0.1587.57
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.