I have recorded SkSl script to warmup shaders. I use this build option to apply it for my Flutter app's release builds:
flutter build appbundle --release --bundle-sksl-path flutter_01.sksl.json
It works great, but it stops work when new Flutter version released. In that case I have an error:
Expected Flutter b8752bbfff0419c8bf616b602bc59fd28f6a3d1b, but found 2c956a31c0a3d350827aee6c56bb63337c5b4e6e
The SkSL bundle was produced with a different engine version. It must be recreated for the current Flutter version.
I want to detect this error without building my release app (as a merge check on CI).
The question: is it possible?
Related
the use case is as follows, I am trying to setup a pipeline for an app we are working on . I have noticed that when running the pipeline most of the time is consumed by downloading the relevant android SDKs for the app. since the allowed cache size is limited I was wondering if is a way to perform everything that is done at the start of flutter build appbundle so I can prepare a specific docker image to be used by the pipeline as the build goes much faster without the downloading of all of these sdks.
using flutter build appbundle is what I am doing right now but it makes the image building process slow.
something like :
flutter prepare
note that simply running pub get is not enough
asking here before I create a feature request on https://github.com/flutter/flutter
looked at flutter cli documentation but couldn't find anything.
I am using flutter version 1.22.6, I have already published my application and have to make minor changes in my application that is why I do not wish to upgrade flutter sdk in my application. But when I try to build my application it says:
Xcode build failed due to concurrent builds
It pops up till some time and then it displays the error:
unable to attach DB: error: accessing build database
database is locked Possibly there are two concurrent builds running in the same filesystem location.
I have tried the solutions such as closing the Xcode and building only from my VS Code editor, also tried flutter clean and then build. Can someone help me with this if I do not have to upgrade flutter?
Don't do anything, just wait another minute or two and then it works (for me, at least).
I get this error in my Flutter Project,
C:\src\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in source_code... 34.3s
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
The plugin firebase_core requires your app to be migrated to the Android embedding v2. Follow the steps on https://flutter.dev/go/android-project-migration and re-run this command.
Process finished with exit code 1
Flutter Embedding Error
Since Flutter 1.12 the way how Flutter plugins communicate with the native Android side has been improved. Allowing plugins to better integrate with the native Android lifecycle.
Some plugins support both the new and the old structure, however many plugins (like firebase_core) dropped support for the legacy structure to ensure optimal integration with the Android system.
Apps created using Flutter 1.12 and higher automatically generate the correct Android integration logic, however Flutter applications created with an earlier version of Flutter need to be manually migrated. There are two options to fix this for your app:
The easiest solution is to delete the android folder in your project and let Flutter (using Flutter 1.12 or higher) recreate it for you by running the following command in the root folder of the Flutter project: flutter create --platform=android . (don't forget the . at the end of the command). You should only do this if you haven't made any custom changes to the Android code and of course make sure to make a backup first.
The more safe option is to manually migrate the Android project using the instructions provided on the GitHub Wiki page mentioned in the error message.
When following the instructions on the GitHub Wiki page make sure to keep an eye on all the details. Personally I forgot to update the <application android:name="MyApp" to the recommended <application android:name="${applicationName}" which resulted in the same error you are reporting.
What helped me was to create a new "dummy" application with the latest version of Flutter (for example flutter create --platforms=android test_app) and compare the files in the Android folder with the files of my current App and make changes where necessary.
My web folder after building my Flutter Web app comes to 5.4MB which isn't too bad, but I might as well optimize.
I was wondering if anybody has any tips outside the obvious(removing unnecessary packages), to minimize the file size? I'll be hosting on Firebase.
Also, there is a NOTICES file which is about 1MB filled with random licenses/copyright disclaimers, are there any consequences to deleting this?
Is flutter build web all you do to build a release version? Is there anything else that should be done other than flutter clean?
According to flutter document, There is a option available for all platforms
but not available for web so far. Read the full document
This command will help you to get a minimized size of build except web
flutter build apk --analyze-size
flutter build appbundle --analyze-size
flutter build ios --analyze-size
flutter build linux --analyze-size
flutter build macos --analyze-size
flutter build windows --analyze-size
While trying to build flutter ios app for release I am getting this error every time
Failed to find snapshot: /var/containers/Bundle/Application/19D78607-A03B/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin
I have tried these things to correct it but failed
running flutter clean and then flutter run --release
changing flutter channel to beta and master
deleting build folder and then flutter clean and flutter run --release
flutter clean > flutter build ios > archive in Xcode to test on the test flight
Does anyone know how to fix it?
I've been seeing this issue frequently over the last few days. I recreated my ios directory which fixed the issue temporarily, but it came back.
What I learned is that it is expected that kernel_blob.bin is not present in release builds, because that file contains your Dart sources in bytecode form ready for JIT, but release builds don't use JIT, they use AOT and your Dart files are compiled into a binary that is placed under App.framework. Rather, this error happens because the release build of the app is incorrectly incorporating the debug (i.e. JIT) version of the Flutter engine.
The best solution I've found so far is to move the build folder to the trash (flutter clean is not working and hangs indefinitely on deleting the build folder for some reason), run flutter clean, run flutter build ios --release from the command line first, then (in my case) create the archive in Xcode.
Run flutter doctor -v
I have resolved this problem, if someone happened, you can try this.
Remove Flutter.framework, build again. Make sure Flutter.framework and App.framework are the same debug or release mode.
Run the following from a terminal, this removes "ios/Flutter/App.framework" and everything underneath it:
rm -rf ios/Flutter/App.framework
and then rebuild your app from xCode. This solved this problem for me.