How to use old version of Flutter and Dart - ios

I'm a new developer and I'm trying to work with an existing IOS application built with Flutter. Some of the pubspec.yaml files show:
version 1.0.2+1
environment sdk ">=2.3.0 <3.0.0
And then various dependencies of other apps.
If I use the latest version of flutter, the application doesn't build. It needs to be built with flutter v1.0.0. But when I install that specific version, flutter pub get doesn't get the rest of the dependencies.
I'm guessing that I'm doing something wrong, but I don't know what.
Please help!
Thank you,
Thomas

Related

Flutter giving errror in old sdk files although I have upgraded the sdk

I created project using flutter sdk version 1.7.8. After long time when I run the build it was giving me errors in sdk files. So I just downloaded new version of flutter sdk (2.2). I have changed environment path to latest sdk version, but when I run project it still giving me error related to older sdk version.
Here is the error
/C:/flutter_windows_v1.7.8+hotfix.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_slidable-0.4.9/lib/src/widgets/slidable.dart:786:46: Error: Method not found: 'TypeMatcher'.
return context.ancestorStateOfType(const TypeMatcher());
This is my environment variable
Why it is giving error related to version 1.78, although I have provided version 2.2 in my environment variable.
I think the one of the plugins that you are using is deprecated when you upgrade flutter you mostly need to upgrade the plugins as well.
and you need to change your pubspec.yaml file also and change the dart version .
so run flutter clean first.
change dart version. then try to run if it doesnt work still you need to upgrade plugins and remove the deprecated plugin.
OR
You might have the old Path in your IDE (Android Studio, VS CODE ) ETC.

Using ES6 on Electron app with io.js

I am writing cross-platform application with electron.
I want to be enable ES6 arrow-function feature in main process using like iojs --harmony_arrow_functions.
Electron already installed successfully on io.js 3.1.0 .
How I can do it with io.js?
If you go to the electron releases, in major/minor release notes you can see which version of nodejs it is using:
https://github.com/atom/electron/releases/tag/v0.36.0
Upgrade to Node 5.1.1.
I'm not totally sure which version of node arrow functions first became available but I can confirm that they are available in the latest version, 5.2.0.
Relatedly, to easily switch between versions of node I highly recommend using nvm:
https://github.com/creationix/nvm
That way you can easily switch to match updated versions of electron and you can automate it quite easily as well.
Electron was switched to nodejs, currently 5.1 see here - https://github.com/atom/electron/releases/tag/v0.36.0

Visual Studio 2015 RTM Cordova IOS Build Error - Could not find module 'Q'

I am using Visual Studio 2015 RTM, and I am working on a Cordova project. My project works fine for Android, but I cannot get it to build for IOS. I have figured out what the problem is, but I cannot figure out how to fix it.
When I build for IOS it is sending the build to the remote build agent installed on my Mac computer, but it is returning the following error:
Could not find module 'Q'. Please Go to Tools --> Options --> Tools
for Apache cordova --> Cordova Tools --> Clear Cordova Cache and try
building again.
Following it's suggestion and clearing the Cordova cache does not help. I did some research and have found that it is a bug in the cordova_ios library. Here is a link to the commit that fixed the error https://github.com/apache/cordova-ios/commit/ed272032878959c90eb28ccc1490e96fb7b69287.
Basically what the issue is that the check_reqs.js file is require 'Q' (uppercase) instead of 'q' (lowercase).
I can work around the problem (and confirm that this is the problem) by doing the following:
Copy my Cordova project over to my Mac computer.
At the command line add IOS as a Cordova platform.
Go to the /platforms/ios/cordova/lib/check_reqs.js file and change line 25 to be a lowercase 'q'.
Build and run the project on the Mac.
What I don't know is how to fix this in Visual Studio so I can build from Visual Studio? I have tried doing NPM updates on the computer that Visual Studio is installed on, but that has not fixed it. I have also tried to manually add the IOS platform to my project via the Cordova command line, and then changing the same file that I change on the Mac, but that does not fix it either.
It looks like this issue if fixed in the latest version of the cordova_ios library, I just cannot figure out how to get Visual Studio and/or the remote build agent on my Mac to use the latest version of the cordova_ios library.
Update
It looks like this is a bug that other people are seeing with Cordova. There are discussion about it here and here. I can reproduce this on my Mac computer. If I create a new Cordova project and add the iOS platform and try to build it for iOS I receive this error. I can then correct the issue by opening the check_reqs.js file and changing the uppercase 'Q' to a lowercase 'q'. However when I build from Visual Studio it sends the project across to the Mac with the incorrect check_req.js file and the build fails. I cannot figure out how to correct this issue when doing a iOS build from Visual Studio.
If your OSX machine has case a case sensitive filesystem you can hit this though a fix is in the works. (Most people do not turn on case sensativity.)
The fix you reference has not yet been released publicly. You can watch for a "platform" release here: http://cordova.apache.org/
Once the platform is released it is very likely a Cordova CLI update will also occur (ex: 5.1.2) so you can just update to that version via the config designer.
However, as an alternative you can add the following into your config.xml file to cause Cordova to use a different iOS platform version and then do a "clean" in VS to force it to take effect:
<engine name="ios" spec="3.9.0" />
3.8.0 is the currently released version.
A "DISCUSS" thread is already going for an iOS release - it should be out in the next couple of weeks.
You can try using the Git URI to get edge - but that could be buggy so exercise care:
<engine name="ios" spec="https://github.com/apache/cordova-ios.git" />
I think we should simply do a patch release of Cordova with this bug fix. Will start a thread on the mailing list to see if a quick release is possible.
Did you already try re-installing vs-tac? Here's the doc:
https://msdn.microsoft.com/library/dn771551(v=vs.140).aspx#vstac
What version of node do you have installed on the MAC machine? I have 0.12.2 and the require(Q) gets satisfied without any errors. Can you try installing a newer version of Node? Let me know.

How can I test the latest Polymer lib when it requires an older SDK?

I wanted to give the latest Dart Polymer lib a spin, so I updated the pubspec file and ran a pub install. However, the install fails with the following message:
Pub install failed, [1] Resolving dependencies.........
Package polymer requires SDK version >=0.8.1+1 but the current SDK is
0.7.6+4.r28108
Is it somehow possible to use the latest Polymer version via pubspec, or do I need to build the SDK myself from the sources?
https://www.dartlang.org/tools/editor/ has links to the bleeding edge, continuous build DartEditor
https://storage.googleapis.com/dart-editor-archive-continuous/latest/darteditor-win32-32.zip
https://storage.googleapis.com/dart-editor-archive-continuous/latest/darteditor-win32-64.zip
As of today, you should be able to upgrade 0.8.1.2 if you go to Help > About Dart Editor.
It seems pretty common that the libraries update a day or two before the SDK, so normally when I run into this problem I put in the pubspec something like the following until I can update the SDK:
dependencies:
polymer: "< 8.0.0"

Update old Cordova/PhoneGap project with new version of Cordova

I have an app I made a year ago I wish to update. I want to use the latest version of cordova (2.7.0). The existing app runs 1.7.0. Can I simply replace the cordova .js files in my project with the new ones?
I have tried to follow the command line rules of updating a project but I just cannot do it with with my limited knowledge of command line.
Any help would be greatly appreciated! Thanks!
Here is the Upgrade Guide of Cordova (for iOS).
To upgrade a Phonegap's Android project:
phonegap platform update android

Resources