how to solve unexpected child found in flutter? - flutter-dependencies

Unexpected child "example" found under "flutter".
Please correct the pubspec.yaml file at C:\Users\Manoj gurung\Desktop\Flutter\DamodarLohaniSir\dependencymanager\pubspec.yaml
when i add new dependency and image assets through pubspec.yaml in flutter project, then this error occoured.

Related

React native link fails with no package found

I'm not sure what exactly is happening but I am unable to run react-native link without errors occuring
CLI Output:
react-native link --verbose
debug Available platforms: iOS, Android
debug Targeted platforms: iOS, Android
debug Getting project config for iOS...
debug Getting project config for Android...
error No package found. Are you sure this is a React Native project?
error Unexpected close tag
Line: 22
Column: 24
Char: >
debug Error: Unexpected close tag
Line: 22
Column: 24
Char: >
at error (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:666:10)
at strictFail (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:692:7)
at closeTag (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:885:9)
at SAXParser.write (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:1447:13)
at new XmlDocument (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/lib/xmldoc.js:199:15)
at readManifest (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/tools/android/readManifest.js:44:10)
at Object.projectConfig (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/tools/android/index.js:66:46)
at Object.keys.forEach.platform (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/commands/link/getProjectConfig.js:25:62)
at Array.forEach (<anonymous>)
at getProjectConfig (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/commands/link/getProjectConfig.js:22:35)
This randomly started happening after attempting to npm install react-native-firebase.
What I've tried
clear-caches
remove node_modules and npm install
Checking out my code back to a previous commit
Adding my package name to the manifest locaed in /android/app/src/debug/AndroidManifest.xml
Removing the app from my computer and cloning it from github
Running react-native link on another project, which works, but i just can't run react-native link on this specific project.
So the answer to my question was that in my android manifest xml file, there was an incorrect closing brace for one of my intent filters.
So for anyone that this happens to ensure that all of your Android files have correct syntax.
I fixed this problem by closing some unclosed tag in android/app/src/main/androidManifest.xml. Try checking the file line by line.

Libraries installed but didn't work in react-native environment

Anytime I install Library, whether it is, native base or react-native text-input effects.it gives the same error every time..
I don't know what's causing an issue here.
error: bundling failed: Error: While trying to resolve module
native-base` from file `/home/jas/Hopper/screen/Home.js`, the package `
/home/jas/Hopper /node_modules/native-base/package.json` was successfully
found. However, this package itself specifies a `main` module field that
could not be resolved (`/home/jas/Hopper/node_modules/native-base/dist
/src/index.js`. Indeed, none of these files exist:
Delete the build folder in /node_modules/native-base/android/app

aurelia - error using material-components-web with skelton-esnext project

I've successfully used the material-components-web library from within my aurelia skeleton-esnext-webpack projects but I am strugling to get them working in a skeleton-esnext project.
The problem seems to be with the fact that the skeleton-esnext project uses jspm with system.js as its module loader.
I have added "#material/textfield": "npm:#material/textfield#^0.3.6" to the jspm dependencies section of my package.json which seems to install the correct #material libraries to my jspm_modules/npm/#material.
Now, when I try to access any class from this library from within any my aurelia view models
import {MDCTextfieldFoundation} from '#material/textfield';
I get the following error in the browser when I run the project:
Error: (SystemJS) Unexpected token import
SyntaxError: Unexpected token import
at eval (<anonymous>)
at Object.eval (http://localhost:9000/jspm_packages/npm/#material/textfield#0.3.6.js:1:123)
at eval (....
Any suggestions to whats most likely causing this issue?
SystemJS is importing the raw source file of the plugin instead of the transpiled one (you can see this if you look into jspm_packages/npm/#material/textfield#0.3.6.js.
You can fix it by changing the location in there to point to the dist directory of the directory textfield#0.3.6. However, it gets overriden all the time on potential updates. And it is not saved in CVS.
Another, more simpler approach, would be to import the correct file in your view model:
import {MDCTextfieldFoundation} from '#material/textfield/dist/mdc.textfield';

"Unable to resolve module path" in React Native

After adding a new dependency, I get the error message "Unable to resolve module path" in a red screen in my React Native app. I've tried clearing the cache as the screen instructs.
(question is brief as I'm answering it myself)
The error message:
Unable to resolve module path
Should really be:
Unable to resolve module "path"
path is the name of the module it can't load! I was reading the error message as "can't resolve a path to the module".
So the root cause is, the file it lists in the error message is importing the native Node module path, which isn't available on React Native.
The solution is to npm install -D path, which is a replica implementation.
Any imports from #babel/core package is causing this error.
Some code editors are inserting the import line automatically.
For example, import { types } from '#babel/core' is inserted by Visual Studio Code when you enter types.
If you remove the imports from #babel/core in the codes, it will be fixed.
Quote from chronikum on react-native github issues for future readers
Just check if you somewhere accidentally imported something from
#babel/core.
Here is the original link
https://github.com/facebook/react-native/issues/27522#issuecomment-568306279
None of the answers are really helpful, I found that the problem in my case was that the macros plugin was missing in my babel configuration file.
This is what I had in my babel.config.js
module.exports = {
presets: ["module:metro-react-native-babel-preset"],
};
After adding the macros plugin
module.exports = {
plugins: ["macros"],
presets: ["module:metro-react-native-babel-preset"],
};
If you get this error, most like you are missing a plugin in your babel config.
I have solved my issue by the below steps.
Read the error message carefully, the error is node modules path(mentioned as NO: 1 in below image). In my case, I have the "just-cli/" module (Mentioned NO: 2).
search the module (just-cli) you have imported somewhere in your project and just Remove it. The problem will be solved.

react native watchmanResponse unable to resolve root

There is an error when I build my react-native project with the version 0.20.0:
Looking for JS files in
/Users/rockyl/WorkSpaces/react-native/TinySNS
[13:55:06] <START> Building Dependency Graph
[13:55:06] <START> Crawling File System
[13:55:06] <START> Loading bundles layout
[13:55:06] <END> Loading bundles layout (1ms)
[Hot Module Replacement] Server listening on /hot
React packager ready.
ERROR unable to resolve root /Users/rockyl/WorkSpaces/react-native/TinySNS: failed to opendir(/Users/rockyl/WorkSpaces/react-native/TinySNS): No such file or directory
{"watchmanResponse":{"version":"4.4.0","error":"unable to resolve root /Users/rockyl/WorkSpaces/react-native/TinySNS: failed to opendir(/Users/rockyl/WorkSpaces/react-native/TinySNS): No such file or directory"}}
Error: unable to resolve root /Users/rockyl/WorkSpaces/react-native/TinySNS: failed to opendir(/Users/rockyl/WorkSpaces/react-native/TinySNS): No such file or directory
at BunserBuf.<anonymous> (/Users/rockyl/WorkSpaces/react-native/TinySNS/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/index.js:95:23)
at emitOne (events.js:77:13)
at BunserBuf.emit (events.js:169:7)
at BunserBuf.process (/Users/rockyl/WorkSpaces/react-native/TinySNS/node_modules/react-native/node_modules/bser/index.js:289:10)
at /Users/rockyl/WorkSpaces/react-native/TinySNS/node_modules/react-native/node_modules/bser/index.js:244:12
at doNTCallback0 (node.js:419:9)
at process._tickCallback (node.js:348:13)
See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
here is the logs:
and here is the real-time logs:
But the root path truly exists.
Thanks for posting those logs; what's happening here is an issue with the casing of the WorkSpaces directory in that path that is being watched. There's some complicated background to this that results in watchman needing to know the exact casing of the file names so that we can report on case-change-only-renames.
The TL;DR is that you should either ask React Native to watch the path using Workspaces as the directory name, or rename the directory so that it is actually WorkSpaces (in other words, make sure that the path you're asking for exactly matches that of the filesystem).
There are a couple of watchman bugs here that I'll work on fixing in the meantime:
We should canonicalize this path using our strict canon at the earlier stage in watching (should make this use case "just work")
We should surface this error with this explanation when such a mismatch occurs
In short: Just rename the containing folder where your project is located to workspaces (All in lowercase), an example here: