I am using the current version of Dart 1.7.0_dev. When I attempt to add a pub package I am getting the attached dialogue - an old version.
Even with a new install of Dart, I am getting it. I would like to use the new one that gave me a the previous dialogue that suggest the package while the name of the package is being entered.
It appears as if this is cached and I can' seem to get rid of it.
Related
I want to make my app, can print so I have run npm install react-native-bluetooth-escpos-printer --save
as enter link description here documentation.
after that I want to make it sure that my project running well after it,
but I found error like , and when I try to link the project the error using this command react-native link react-native-bluetooth-escpos-printer
it also bring me to the another error like Unrecognized command "link".
i dont have idea hot to fix it, please anyone can tell what am I suppose todo
Since no one is maintaining this package. I used https://github.com/januslo/react-native-bluetooth-escpos-printer/pull/114 which is one of the PR for this package which resolved the insecure protocols and used https://www.npmjs.com/package/patch-package to keep the changes. Hope it helps!
I developed a flutter app on an Ubuntu machine and it works without problems on Android. Now I am trying to run it on iOS from a Mac but when I start debugging, I get several errors like the following:
/opt/flutter/.pub-cache/hosted/pub.dartlang.org/entry-0.0.2_2/ios/Classes/SwiftAnimateInPlugin.swift:4:14: error: invalid redeclaration of 'SwiftEntryPlugin'
public class SwiftEntryPlugin: NSObject, Flutter Plugin {
^
flutter doctor passes for Flutter, Xcode, and Connected device.
Flutter 2.2.0 - channel stable
Tools - Dart 2.13.0
I have checked this question but they are not using Flutter and the answers are not relevant as far as I can tell. What would cause this error and how might I resolve it?
Taking Nisanth Reddy's advice from the comment above and grepping for SwiftEntryPlugin: NSObject my search was narrowed down to 2 files. The files were ./my-app/ios/.symlinks/plugins/entry/ios/Classes/SwiftEntryPlugin.swift and ./my-app/ios/.symlinks/plugins/entry/ios/Classes/SwiftAnimateInPlugin.swift. After some trial and error, it seems like both files are required (the redundant one being required by a particular Flutter package I'm using, I think) but both had the exact same code in them so I removed all the code from one of the files but left the empty file sitting there in the directory and the problem was resolved.
Similar to how you get your apps version kCFBundleVersionKey how does one get the version of the package you are working in?
I don't think it's possible at the moment to get the value easily.
You can either read the Package.resolved file or you can set up a public constant where you would define the version of your library.
public let version = "0.0.1"
import MyLibrary
print(MyLibrary.version)
There isn't a standard way how to do this, every package could have a different constant (or not have it at all)
You can check package version rules in project package dependencies tab. Check screenshot below. Propably it would be sufficient for most use cases.
Edit: The context has changed, the question was to get the version of MyPackage I'm working on via code. There isn't any documented or recommended method as of now. Though this can be achieved by a hack through reading the Package.resolved file as mentioned by Malcolm.
I'm not deleting this answer for any future users who are looking for answer on how to get the exact latest version of a Package.
You can give the same major version number and give Update to latest package version option on Xcode. eg: If current version is 2.4.5 you just need to provide 2.0.0 and update. There is also an option to provide the exact version of swift package you need.
I am using Xcode 9.4 and current react native version #0.54.4 I want to upgrade the version to 0.55.4.
As I upgrade my project using react-native-git-upgrade, I see some un merged conflicts in the project.pbxproj. Some of the settings are my own that are conflicting with the changes in the new version.
I tried all the possible ways in which I could resolve the conflicts. But still X-code shows the error could not load the project, and it does not allow me to build my project.
How do I understand what those conflicts are referring to and how can I safely resolve the conflicts?
Unfortunately there is no magic way to resolve conflicts. I wish there was. The file is managed by Xcode and from personal experience I have found that you can easily mess it up performing merges.
Git is definitely your best-friend. Make sure that before you start any merge you are on a new branch and fully committed so that if you mess-up you can easily get back to your original version.
What I usually do is keep the original version of the project.pbxproj and then make the changes manually in Xcode. I know this doesn't sound ideal but it does mean you should be able to open the project in Xcode, though your project may not run - just yet.
If you’re unclear about which version to keep, I would keep ours as that is the original version of your project.pbxproj. From the documentation:
You can think of "ours" as "your team" and "theirs" as "the React Native dev team".
Then I would make the changes manually as detailed below. As that will show their changes and the should hopefully not be that many.
To help me find the changes that I have to make I find that React Native Upgrade Helper is an invaluable resource. There you can find a git diff of any two versions of react-native that you choose. (This saves you having to create two projects and then compare them yourself, a big timesaver.)
Currently you are upgrading from 0.54.4 to 0.55.4 this link shows the diff between those versions
https://react-native-community.github.io/upgrade-helper/?from=0.54.4&to=0.55.4
For additional help you could create a project in a specific react-native version, using the following will create a project for version 0.55.4.
react-native init newproject --version react-native#0.55.4
That way you can look inside the Xcode project to see what has been added, and where it was added from, as the git diff doesn't always tell where it came from.
I have never had much luck using react-native-git-upgrade and I have come to prefer doing it manually, as I have had much more success doing it that way.
After updating react native to version 0.55 from 0.51, everything seemed to function normally in the local mode. But the production build fails.
I fixed this by upgrading react native once again from 0.51, and keeping my changes instead of theirs almost all the time.
May be there should be more detailed explanation in the documentation regarding the kind of issues one run into, by picking the wrong changes.
I have a project that was building fine a few days ago, since then I haven't changed my dart-sdk or any library dependencies or update dart editor to my knowledge, I just made a very small change to one of my polymer elements to use paper-buttons instead of standard buttons, the change can be seen here
Now when I run pub build I get the following errors, and I have no idea why, if I look in packages polymer/polymer.dart does exist and dart editor doesn't show any warnings in the project. similarly if I undo my latest changes and go back to my last working version I still get this exact same error, so I'm not sure how to debug this, any hints would be much appreciated.
Can't read 'package:polymer/polymer.dart' (Could not find asset polymer|lib/polymer.dart.).
import 'package:polymer/polymer.dart';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For such weird problems it's often a good idea to try pub cache repair.
I found an open issue with the same error message: http://dartbug.com/20285
Check if pub get or pub upgrade show some warnings, errors, ...