Xcode build failed due to concurrent builds - flutter

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).

Related

Got the "Error launching application on" after flutter run

I am flowing the official tutorial to install flutter and run the default app on my iPhone Device. After I execute the flutter run, the app is installed and launched on my iPhone but the logs show the bellow error. How do I solve it?
Launching lib/main.dart on My iPhone 6 in debug mode...
Automatically signing iOS for device deployment using specified development team
in Xcode project: XXXXXXXXXX
Running Xcode build...
└─Compiling, linking, and signing... 50.2s
Xcode builds done. 90.1s
Installing and launching... 41.1s
Error launching the application on My iPhone 6. <-- Error Here
It happens that there are some process needed to Flutter plugin correctly run on physical devices. I struggled with that and finally found that the processes idevicesyslog and iproxy were being silently blocked by MacOS.
You may have noticed already a message liked this:
or a similar one for idevicesyslog.
Once I went to System Preferences -> Security & Privacy in General tab and allowed this apps, everything works. Note that this screen shows only the last app that you tried to run. So I'd recommend that you run flutter app with preferences opened so you can (hopefully) see the messages appearing and click allow.
MacOS may warn you one more time about the file being downloaded from the internet. Just click open and you're good.
The error do not show again after reboot the iPhone.
Same error -- Running fine through Xcode, when I ran with flutter CLI, the app would open, but the terminal log output would crash with the error as in the post.
I ran flutter update and simultaneously turned iPhone off and back on. After doing that, the below popup appeared (on mac).
I believe after the install finished, I ran the below (which I ran several times before updating flutter and installing the popup):
flutter clean
rm -rf ios/Pods
flutter pub get
cd ios && pod install && cd ..
run the flutter app using flutter run from command line, then the MacBook will ask for permission to open the app and app runs,
(lldb) warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance.
Error launching application on device-XXXXX.
Building & Replace with a newest version ios-deploy solved problems list aboved. Flutter SDK bundled a pre-built command ios-deploy in __PATH_TO_YOUR_Flutter_SDK_/bin/cache/artifacts/ios-deploy/, just replace it.
Please reference to: Flutter Error launching application on device issue .

When you start a finished project downloaded from the internet Running Gradle task 'assembleDebug'

When creating a new app in Android Studio, everything starts normally. But if you download an example of some kind, then the application does not start and shows an infinite download, how to fix it? That is, I downloaded a ready-made project, try to run it, and show me the Running Gradle task assembleDebug and nothing else happens. But if I create a new project myself, it starts. Could it be because I didn't install Dart and Flutter separately? and I installed them through Android Studio and use them
this is a ready-made project that I downloaded from the internet and it does not start. It doesn't show any errors.
Dart comes with Flutter. So, you don't need to install them both separately.
Since there is no error, it means that it is just slow. What happens is that the first build requires a lot of files. Some of the packages need to be downloaded and certain files needed to be built. So, it will take time. The speed may also be affected by the internet speeds.
In your case, when you're creating a new project. It is a basic project. So, very few files. So, it gets done quicker.

Can I check SkSL bundle engine version with Flutter?

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?

Different app version when beginning debug versus restarting already running app

I noticed when I first begin debugging a flutter app I'm developing I will get an old version of the app that I previously loaded. When I then restart the app without closing it out I will have the correct version.
Is there a cache that is not being cleared prior to when I begin debugging? Flutter clean works but I have to perform this manually every time. Possibly a setting in visual studio.

Flutter ios release build cannot find snapshot

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.