Flutter pub get Flutter version mismatch | podfile.lock flutter version mismatch - ios

I have updated my flutter version to 3.0.1 - Reference
I have one existing flutter project. When I hit flutter pub get command, inside ios/Flutter/Flutter.podspec file, it is showing flutter version 1.0.0.
s.version = '1.0.0'
Also in the iOS podfile.lock file is also showing flutter version 1.0.0. I tried updating pod, etc everything but same issue.
PODS:
Flutter (1.0.0)
Why it is showing 1.0.0 instead of 3.0.1. or this is not the correct way to check & update flutter version of existing project?

The flutter version depends on your environment (not the project), so you should be able to just run flutter --version to see which version you're running.
As for the project, it should normally build with any compatible flutter version. If you look at your pubspec.yaml, it should have the environment part which specifies the SDK. It should look something like the following to be compatible with the new Flutter version:
environment:
sdk: '>=2.17.0 <3.0.0'
I think (not entirely sure, though) that the 1.0.0 that you see is the app version, as specified in the pubspec.yaml version (usually right above the environment bit).

Related

AgoraRtcEngine_iOS and agora_rtc_engine version conflict

I am using AgoraRtcEngine_iOS version 3.7.0 as Screenshare exntension for iOS native and agora_rtc_engine 5.2.0 in flutter in Same flutter project. Issue is when I am performing pod install it shows as shown below. And for old version screen share is not working fine. Does anyone know the solution ?
The 'Pods-Runner' target has frameworks with conflicting names: agoraaidenoiseextension.xcframework, agoradav1dextension.xcframework, agoraciextension.xcframework, agorafullaudioformatextension.xcframework, agorafdextension.xcframework, agorareplaykitextension.xcframework, agoracore.xcframework, agorartckit.xcframework, agorasoundtouch.xcframework, agorafdkaac.xcframework, agoraffmpeg.xcframework, agorasuperresolutionextension.xcframework, agoravideoprocessextension.xcframework, and agoravideosegmentationextension.xcframework
You can use Agora iOS SDK version 3.6.2-fix.1 with your Flutter project

How to enable --control-flow-collections [duplicate]

I want to use the new spread syntax in Dart.
I'm using Android Studio for Flutter development and I receive this error.
This requires the --spread-collections experiment to be enabled
ListView(children: [...listTiles, MyWidget()])
However, I didn't find anywhere where I could specify this option.
I couldn't even make it work on the command line. flutter --spread-collections run gives Could not find an option named "spread-collections"..
flutter --version
Flutter 1.3.8 • channel beta • https://github.com/flutter/flutter.git
Framework • revision e5b1ed7a7f (4 weeks ago) • 2019-03-06 14:23:37 -0800
Engine • revision f4951df193
Tools • Dart 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
You need to create an analysis_options.yaml file in the root of your flutter app and write something like
analyzer:
enable-experiment:
- spread-collections
Also make sure to switch to the correct channel where the new feature is included eg (dev, beta or master)
flutter channel dev
And also make sure you have a recent enough version of flutter
flutter upgrade
Ensure you are on the right version of flutter and dart that allows that feature by running
flutter --version
you may also have to manually change your pubspec.yaml file to specify the correct dart sdk (if so rerun flutter upgrade)
environment:
sdk: ">=2.10.0-0 <3.0.0"
In my case, I have followed these two steps and It worked for me.
run "flutter upgrade"
changing the sdk in the environment in pubspec.yaml
environment:
sdk: ">=2.6.0 <3.0.0"
With the new version of flutter it became an error - but it can easily be fixed by updating the sdk version:
environment:
sdk: ">=2.7.0 <3.0.0"
Just don't forget to restart VisualStudio Code or whatever IDE you're using.
You are running an old version of flutter
Spreading is available starting at flutter 1.5 and dart 2.3
Run:
flutter upgrade
Here's some fix you can try out :
1) Keep the analysis_options.yaml in your root folder with this code:
analyzer:
enable-experiment:
- control-flow-collections
2) Don't use brackets {} in between your for loops
Ex:
<Widget>[
for (final category in categories)
CategoryWidget(category: category)
],
3) Important step which is probably why it's not working for you:
Change your Dart version constraint in the pubspec.yml file in your root folder to 2.5.2 or above.
environment:
sdk: ">=2.5.2 <3.0.0"
The current answer that is working in the latest Flutter 1.17.1 or Dart 2.8.2
Create a analysis_options.yaml in the directory of the pubspec.yaml file
Write this code inside the file:
include: package:pedantic/analysis_options.1.8.0.yaml
linter:
rules:
- prefer_spread_collections
For more information head to this documentation
Something completely different yet the same. Our code was built in Flutter v1.12.13hotfix9. when we did a new installation with flutter 1.17.1 the build broke with a similar error. It seems that the new release of Flutter is not backwards compatible on certain parts.
We fixed the problem by installing the older version.
Run this command from your project's root directory:
dart --enable-experiment=spread-collections lib
After updating the environment in pubspec.yml don't forget restart your IDE
environment:
sdk: ">=2.7.2 <3.0.0"

Building flutter tool... Because flutter_tools depends on sockjs_client 0.3.5 which doesn't match any versions, versio

My flutter isn't working any more.
Doesn't matter if I type:
flutter channel dev
flutter doctor
flutter update-packages --force-upgrade
All this commands shows this errror:
Building flutter tool...
Because flutter_tools depends on sockjs_client 0.3.5 which doesn't match any versions, version solving failed.
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
What can I do?
You have to revise your pubspec.yaml file to check for the package sockjs_client 0.3.5 which doesn't match any package at official dart packages which is the sole repository to get Dart packages for flutter. Check the name and version again, and if it doesn't match one you have to remove it from pubspec.yaml if you want the build process to be successful.

Xcode 10.2 support with the latest NativeScript?

Building an iOS project after using the default NativeScript Advanced Mac OS instructions does not work.
I have a fresh, new macbook, OSX Mojave 10.14.4, with the latest available Xcode Version 10.2 (10E125).
I followed the NativeScript instructions precisely:
https://docs.nativescript.org/start/ns-setup-os-x
After a few hiccups, I have Android working, but not iOS.
I first started with the issue and solution found here: Swift Version NativeScript
However, after following the steps to downgrade cocoapods from 1.6.0 to 1.5.3, I get errors about Swift 3.0 / 3.1 not being supported and again, a failed build.
After setting up NativeScript using the docs, you see this error:
[!] Unable to determine Swift version for the following pods (for each pod):
- `Socket.IO-Client-Swift` does not specify a Swift version and none of the targets (`<my-project>`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
After downgrading cocoapods, you see this error instead (for each pod):
error: SWIFT_VERSION '3.1' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'Socket.IO-Client-Swift')
I also tried opening the project in Xcode. You immediately see the same error from the command line.
Is there any way for the latest Xcode and the default NativeScript setup to work without any further configuration?
The problem is that Xcode 10.2 brings Swift 5 and deprecates Swift 3. Plugins that use outdated Swift code won't work.
Solution 1: Downgrade to Xcode 10.1.
Solution 2: Update the nativescript plugins that use Swift 3 pods.
Update to the latest nativescript-vue-devtools
npm uninstall nativescript-vue-devtools
npm install --save nativescript-vue-devtools
Replace the packages nativescript-socket.io with nativescript-socketio:
npm uninstall nativescript-socket.io
npm install --save nativescript-socketio
Replace the packages nativescript-toast with nativescript-toasty:
npm uninstall nativescript-toast
npm install --save nativescript-toasty

Facing flutter plugin issue

I'm trying to add flutter_svg: ^0.5.1 in my project pubspec.yaml and facing following issue.
depends on flutter_svg >=0.0.2 which requires Flutter SDK version >=0.3.6 <2.0.0, version solving failed.
You might be able to use something like this to override the dependency:
dependency_overrides:
flutter_svg: '0.5.1'
Open the flutter_console.bat (on window) or flutter_console.sh (on linux) file from your downloaded root flutter folder. This should bring up a terminal running Flutter locally.
Now type flutter upgrade
This should resolve your issue considering its a version compatibility issue.

Resources