Running old code on new flutter and dart version - windows

I abandoned a project I was working on for a while I came back to open it on upgraded flutter and dart plugin in visual studio code windows 10.now I get so many problems. is there a way to automatically update code to solve these errors?

do these steps:
delete build folder
delete .idea folder
run flutter clean
run flutter pub get
run flutter pub upgrade
then try to run your project.

The simple answer is it depends.
Judging by the comments from a reasonably good answer by Hasan Abbasi, this wasn't enough.
Depending on how old your project is, there are 2 choices before or after doing what that answer said:
If it's any more than 2 or 3 years old, I'd probably rewrite it from scratch. In that time, Flutter and Dart have matured greatly, which involves many breaking changes. Also, null-safety has been introduced. Creating a new project after updating Flutter will also fix those Gradle issues because the configuration files will be reset.
If it's less than that, try to fix those Gradle issues either by hand or just deleting the '/android' or '/ios' etc. folders and letting Flutter/Dart automatically recreate them when you run the app next. You'll probably need to migrate to null-safety: read about null-safety so you understand it properly, then try using the dart migrate tool. You will likely need to spend some time changing dependencies for null-safe versions. Then you can try the flutter fix tool to automatically resolve SOME issues.
Hope you can get your app to work soon!

Related

Cypress freezing (Your tests are loading)

Cypress for me is often stuck in the "Your tests are loading" screen. I am really confused as to why it happens, and restarting Firefox/crome doesn't help either. It doesn't depend on any code, happens completely randomly and today my luck was down so I was looking more at that then at my code. any help is welcome, and thank you in advance.
Late reply, but are you using webpack-preprocessor? I am and the same issue happened to me when I upgraded to Webpack 5 lately.
The solution was to downgrade to Webpack 4.
In this case it is a known issue, there is an open Pull Request on Cypress github that should hopefully fix it: https://github.com/cypress-io/cypress/pull/15611
If you're coding a project that's using another version and you install the project without using nvm use it will install the latest dependencies which may break the code that doesn't support the new dependencies version.
Check the original code Webpack version and be sure it is the same installed locally

in Xcode12 beta the Swift package manager fails to load dependencies

Recently the SPM has started to give me errors. Was working before.
I'm trying to use the AlamofireImage library but xcode fails to resolve de dependency and doesn't give any good explanation.
Does anybody know why and how to make it work?
this was once happened to me, maybe you can try to go ahead to File > Swift Packages > Update to Latest Package Versions. Let's see if that works
I ran into a similar issue when I was trying to arrange the files inside the project folder, and when I put them back to their old position the problem was resolved and the app run successfully.
I found something that's not ideal, but works for now. In your main xCode project file, go under Project not Target and find Package Dependencies. After finding it, remove the SDK, and then right click on the name of your project and add a package. This time when adding Firebase, use Minor version. It should hopefully resolve and install.

Unable to do refactoring on my Swift file in Xcode 9

I am using Xcode 9 and I am trying to do Refactoring on my Swift based file but every time I am getting below error:
Refactoring engine ranges didn't match initial ranges
Why isn't it matching the initial range?
Workaround: Restart Xcode.
This has not been resolved yet as of January 2018 (Xcode 9.2).
Build your project (Command ⌘ + B) and it will fix the error. After doing it, I could rename my file successfully.
I have Xcode's project created using Xcode8 long time ago. For some reason I have to upgrade to Xcode9 (9.4.1 exactly). Then I experienced that error only on that old project, not the new one created using Xcode9.
So i think that error related to project issue. So I decided to compare the settings between old and new one. There are some differences, and after several tries, by changing Optimization Level for Debug solved refactor issue.
In project editor, select your Target, Build Settings
Set Optimization Level (Debug) = No optimization [-Onone]
Delete DerivedData folder related to your project in /Users/YourMacUsername/Library/Developer/Xcode/DerivedData
Clean project shiftcommandk.
Build project commandb.
Update For some reason, it's not happening for me anymore. I noticed also whenever I don't let indexing finishes before trying to start doing a refactor or tap on refactor many times, still see the error, but not permanent anymore.
I asked an engineer at WWDC 2018 about this issue. This issue was happening for me in only one project in my workspace. Other projects in the same workspace works fine. At the moment, there's no solution to this issue. If you want to help Apple to fix this, you can close your Xcode and run following command in terminal:
SOURCEKIT_SERVICE_LOG=3 /Applications/Xcode.app/Contents/MacOS/Xcode 2>&1 | tee /tmp/sk-log.txt
And then try to reproduce the issue and send them the log file (/tmp/sk-log.txt) so they can narrow it down and hopefully fix it in future Xcode versions.
Notice This is project related issue and won't be fixed with OS updates, Xcode updates, or any number of restarting applications, at least the one that I'm having.
I have the same issue in Xcode 10.3.
Refactoring didn't work when I right clicked → refactor → rename on the class name in the class definition. However it did work when I did the same somewhere in code where I use that class.
Product -> Clean Build Folder -> Quit Xcode -> Reopen Project -> Build
I update to Xcode 10 and finally refactoring now it works again after a year without refactoring
I am on Mac M1 and using Xcode Version 12.5 beta 3.
I was facing the same issue when trying to rename ViewController.
Before renaming it, I moved it to a new group, and my code was in a running state. Not sure if that was the reason for the issue.
But I restarted the Xcode and the issue was resolved for me.
I was experiencing the exact same issue. It turned out that I had my build configuration set to Release mode. Changing it to Debug, cleaning build folder and recompiling fixed the issue for me.
Remove DerivedData
This worked for me for this error and other kind of refactoring errors.
Close Xcode
Remove DerivedData:
rm -rf ~/Library/Developer/Xcode/DerivedData
I experienced this on a Mac M1, using Xcode Version 14.1 (14B47b).
This helped:
Clean project: shift-command-k.
Build project: command-b.

What is the right approach to include Xlab packages for development?

I am new to xamarin and using XLab packages. I can see that Xlab packages are not stable yet however community is strongly supporting. In test
project I have added packages using Nugets. Now I found one issue in camera API of it so, how should I fix it. I have just
library files so, I can see code or fix it immediately.
Should I include the code of it? Because I can't wait for community to fix the issue and get the updated package of it? Yes If I will fix something then
I would love to contribute to open source community.
FYI: I am using PCL approach for development.
Best option would be to fork the GitHub repository and work on the sample application.
You can also get a copy of the source without cloning but then you cannot create a pull request for any code fixes. You can still report any bugs you find but it will be easier to contribute to the project by forking the project.

What happens to my project when updating from xCode 5.1 to xCode6?

I'm currently using xCode 5.1 and Objective-C to learn how to make apps and I'm wondering what would happen to my projects if I update from 5.1 to 6. Will my projects still run or will I have to code everything in Swift?
Your projects should still run if they were running in previous versions. What will most likely happen is that you will be bombarded by warnings and alerts about deprecated code and syntax. You're going to get a lot of them with an upgrade that big.
For the most part, XCode should tell you exactly what needs to be upgraded. It shouldn't change any of your code. But it's always good practice to back up your project.
Good luck!
See also : https://stackoverflow.com/a/24005402/4329655

Resources