I am trying to connect a IOS Firebase app to my flutter and the packages I am importing come up with the error "The library 'package:firebase_auth_web/firebase_auth_web.dart' is legacy, and should not be imported into a null safe library.
Try migrating the imported library".
There is more than one problem as per your description and comments.
The easiest solution is to upgrade the dart, flutter, and all the dependencies you are using because it seems that you are using all the things which are older.
First, in your command prompt (terminal), run:
> flutter upgrade
This will upgrade your flutter and dart both. Secondly, run:
> flutter pub upgrade
This will upgrade all the dependencies. Finally, run:
> flutter pub upgrade --major-version
This will also upgrade all the dependencies.
Doing these will make your application up to date with the dependencies. Now, try to run the app again. Most probably it will work, if it doesn't then it might tell you to upgrade your compileSdkVersion in build.gradle to something larger number. If so, upgrade that number in your app>build.gradle file.
Related
I'm currently upgrading one of my projects built in React Native v0.56 to latest v0.60. Created a new project with version v0.60 and updated all the packages used in previous version of app, but now facing weird errors.
I've already tried all the possible solutions mentioned in Git and Stack overflow. None of them worked for me. I've also tried to remove plugins one by one and then adding them but not able to find cause of the error.
iOS:
In iOS, all the packages by default autolinks as per v0.60, but I got error of linking in very first package, I've tried manual linking too, not working.
After manual linking do cd ios and then pod install. This will not be done by autolinking and you have to do it yourself. On iOS on my project i had to manual link on iOS almost every library and almost all of them needed a pod install
use upgrade helper from react native community Upgrade Helper
i have been using flutter recently and i really wanted to use Jaguar for my project. But here is the catch, the flutter sdk brought dart with version 2.0.0-dev-58.0 but jaguar said they need dart sdk with version 2.0.0-dev-65.0
Okay, so i get myself dart with sdk version of 2.1.0-dev.1.0, but my vscode can't seem to recognize that i have installed the sdk.
Any ideas on how to change that?
The Dart Code plugin has a setting dart.sdkPath
The location of the Dart SDK to use for analyzing and executing code.
If blank, Dart Code will attempt to find it from the PATH environment
variable. When editing a Flutter project, the version of Dart included
in the Flutter SDK is used in preference.
There's also dart.sdkPaths which allows quick switching between alternatives.
For Flutter projects, use dart.flutterSdkPath(s)
It's quite easy if you use VSCode:
Clone flutter repo to a new folder:
mkdir ~/flutter_dev
cd ~/flutter_dev
git clone https://github.com/flutter/flutter.git .
Open your workspace preferences and update dart.flutterSdkPath setting:
"settings": {
"dart.flutterSdkPath": "/Users/youruser/flutter_dev"
}
Restart VSCode and you're good to go.
See more info in Dart Code - Quickly Switching Between SDK Versions
I want to add one more things to #Andrey, you can use FVM to install as much as you want versions and channels, it's easy to install and manage versions. It hold all versions on your home directory, I think it's easier than managing with Git.
This is a long shot, but I've taken over a project done in RN v .38 and I need to update a library and resolve the build issues without updating the version of react native. I'm trying to update the react-native-aws-cognito-js library and while it looks to be compatible with the formatting change of import statements, I'm still not able to get it to build on IOS. Android is fine.
To reproduce my issue I did the following:
react-native init sample --version 0.38.0
cd sample
npm install react-native-aws-cognito-js
react-native link react-native-aws-cognito-js
react-native run-ios
Which fails with:
/node_modules/react-native-aws-cognito-js/ios/RNAWSCognito.h:4:9:
fatal error: 'React/RCTBridgeModule.h' file not found #import
Mobile and RN development is not my wheelhouse, but I'm hoping there is some sort of xcode configuration or tricks I can do to get this working and avoid a major overhaul. Running an upgrade to >.40 would probably take too long and also cause other compatibility issues that I don't have the time to resolve.
Note: I have tried the suggestions in `React/RCTBridgeModule.h` file not found
I have been using React Native for the past 4 of months working both on Android and IOS. According to React Native Docs there will be an updated version of React Native every month. So, I keep updating it every month which is good, but the problem is I am using a couple of npm packages which is getting outdated due to react-native update which in-turn causes errors in my project.
For Android, we can lock the react-native version by specifying the version number in gradle. And for the Javascript part we can lock it in package.json. But for IOS I am not able to find anything like that.
So, is there way to lock the react-native version in IOS xcode?
Yes, make your package.json file at root path - react-native version to fixed number. for example:
"dependencies": {
"react-native": "0.50.4",
}
So every time you do npm install, that given version will be installed. without postfix ^ it will never be upgraded.
The react-native version of iOS is just a project / static library import from node_module/react-native/Libraries folder, via react-native link.
Update 1:
Take RCTAnimation.xcodeproj in project for example,
you can find it locate at node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj.
I have an application which was developed in Xcode 7.3 and Swift 2. Now I am trying to convert it to Swift 3.0.2, as the dependency manager I am using is Carthage. Now I am updating my Carthage so that all the frameworks should support swift 3.0.2. For this, first I have used the following command:
"carthage update --platform iOS"
It now fetches all the dependencies and check out all the dependencies but then after checkout it starts to build the dependencies and while building the dependency it just fails with an error.
Here is a attached screenshot of the error. I am totally blank on what I am missing in this case:
When I faced the problem , this is how I resolved it:
I deleted everything that was checked out and got all new fetches and builds
Ran carthage update --no-build && carthage bootstrap
This problem mainly occurs in Xcode 7.3 beta2 (7D129n) toolchain. Carthage version0.12 will build the cartfile successfully if you set xcselect to 7.2.1.
Version v0.11 didn't have this problem. The problem occurs during the build, maybe because all the versions of Carthage dependencies don't match too. I also read a few posts which asked me to supply with sudo carthage update --platform iOS --no-use-binaries.
And you're using a really old version of Xcode. I'll suggest you to upgrade.