After my app failed on iOS 17, I had to do a lot of upgrading, including buying a new Macbook, just so I can do a build for iOS 17. It turned out that the TextFormField in Flutter didn't work with Autocorrect in iOS 17.
So, after upgrading Macbook, XCode and Android Studio, I had a lot of packages to update as well (my app was only 2 years old). I am now using Android Studio Giraffe. Getting my app to work again because of all the updates to the packages took quite a while, but I have it all working now.
I normally develop on my Windows computer, so I copied all my changes to Windows, upgraded Android Studio to Giraffe, ran Flutter Pub Upgrade to get latest version of Flutter and Dart and attempted a build, but this is where I have stalled.
I am getting error...
/C:/Users/me/AppData/Local/Pub/Cache/hosted/pub.dev/pdfx-2.5.0/lib/src/viewer/pdf_page_image_provider.dart:24:55: Error: Type 'DecoderCallback' not found. ImageStreamCompleter load(PdfPageImageProvider key, DecoderCallback decode) =>
^^^^^^^^^^^^^^^ /C:/Users/me/AppData/Local/Pub/Cache/hosted/pub.dev/pdfx-2.5.0/lib/src/viewer/pdf_page_image_provider.dart:40:7: Error: Type 'DecoderCallback' not found.
DecoderCallback decode) async {
^^^^^^^^^^^^^^^ /C:/Users/me/AppData/Local/Pub/Cache/hosted/pub.dev/pdfx-2.5.0/lib/src/viewer/pdf_page_image_provider.dart:24:55: Error: 'DecoderCallback' isn't a type. ImageStreamCompleter load(PdfPageImageProvider key, DecoderCallback decode) =>
^^^^^^^^^^^^^^^ /C:/Users/me/AppData/Local/Pub/Cache/hosted/pub.dev/pdfx-2.5.0/lib/src/viewer/pdf_page_image_provider.dart:40:7: Error: 'DecoderCallback' isn't a type.
DecoderCallback decode) async {
^^^^^^^^^^^^^^^ Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
* Where: Script 'E:\Dev\flutter-new\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1350
* What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'E:\Dev\flutter-new\bin\flutter.bat'' 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 7s Exception: Gradle task assembleDebug failed with exit code 1
I am a bit stuck, and there is very little I can find to resolve this.
My flutter doctor is...
[√] Flutter (Channel stable, 3.16.0, on Microsoft Windows [Version 10.0.22621.2715], locale en-GB)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[!] Visual Studio - develop Windows apps (Visual Studio Community 2017 15.9.48)
X Visual Studio 2019 or later is required.
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.2)
X Unable to determine bundled Java version.
[√] Android Studio (version 2022.3)
[√] Android Studio (version 4.2)
[√] Connected device (4 available)
[√] Network resources
! Doctor found issues in 2 categories.
I am not writing for Windows, so the reason for VS2019 is not required. I have Java version 8 installed.
When I try to upgrade Gradle using the AGP Ugrade Assistant... nothing happens.
I don't know where else to turn to find out how to get beyond this.
Currently, pdfx package has a problem due to flutter upgrading to version 3.16 as mentioned in this issue https://github.com/ScerIO/packages.flutter/issues/448
There is a temporary way to fix it by changing the pdfx package inside your pubspec.yaml
from
pdfx: ^2.4.0
to
pdfx:
git:
url: 'https://github.com/ScerIO/packages.flutter'
ref: '4be9de9ffed5398fd7d5f44bbb07dcd3d3f1711b'
path: packages/pdfx
I had a similar issue when I upgraded my Flutter version to 3.16.5, and I was able to resolve it by following these steps:
Run the command flutter pub upgrade to upgrade the packages in your Flutter project. This ensures that you have the latest versions of the dependencies.
Next, run flutter clean to remove the build artifacts and temporary files. This step helps to ensure a clean build environment.
Finally, run flutter pub get to fetch and update the required packages based on your pubspec.yaml file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With