Can't able to complie the app when advance_pdf_viewer and firebase_storage package is used. At first it works fine but later its version changed and i dont know the exact version which matches.
Publicspec.yaml file
cupertino_icons: ^1.0.3
flutter_svg: ^0.22.0 # help us to use SVG in our app
provider: ^5.0.0 # for State management
getwidget: ^2.0.2
shared_preferences: ^2.0.5
firebase_auth: ^1.0.1
firebase_core: ^1.0.2
cloud_firestore: ^1.0.3
firebase_storage: ^8.0.1
advance_pdf_viewer:
date_time_picker: ^2.0.0
file_picker:
intl: ^0.17.0
path: ^1.8.0
http:
Error message
Running "flutter pub get" in appT...
Launching lib/main.dart on SDKPhone in debug mode...
Running Gradle task 'assembleDebug'...
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
../../flutter/.pub-cache/hosted/pub.dartlang.org/advance_pdf_viewer-2.0.0/lib/src/document.dart:64:14: Error: The class 'File' is abstract and can't be instantiated.
file = File("${dir.path}/file.pdf");
^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/advance_pdf_viewer-2.0.0/lib/src/document.dart:72:26: Error: Non-nullable variable 'file' must be assigned before it can be used.
document._filePath = file.path;
^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/advance_pdf_viewer-2.0.0/lib/src/document.dart:75:58: Error: Non-nullable variable 'file' must be assigned before it can be used.
.invokeMethod('getNumberOfPages', {'filePath': file.path});
^^^^
FAILURE: Build failed with an exception.
* Where:
Script '/home/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 48s
Exception: Gradle task assembleDebug failed with exit code 1