react-native linking firestack error - android

I am trying to use firestack in my react-native application.
I did:
npm install react-native-firestack --save
but then when I try to link:
react-native link react-native-firestack
I get the error:
rnpm-install ERR! It seems something went wrong while linking. Error: spawn UNKNOWN
Do you have any ideas why is this?

As per my understanding try this:
First use rnpm link react-native-firestack
if it does not work then try this:
You can remove these lines from package.json:
"rnpm": {
"commands": {
"prelink": "node_modules/react-native-lock/bin/prepare.sh",
"postlink": "node_modules/react-native-lock/bin/cocoapods.sh"
}
}

Related

Jenkins doesn't recognize IONIC as command

I'm currently setting up Jenkins for a IONIC Project of mine.
I've got a Jenkinsfile with the following content:
pipeline {
agent any
stages {
stage ('NPM Setup'){
steps{
bat 'npm install'
}
}
stage('Android Build'){
steps{
bat 'ionic cordova build android --release'
}
}
}
}
Jenkins causes an Error with the following Errormessage:
The "ionic" command is either misspelled or could not be found.
What am i doing wrong here or is there anything i didn't configure for it to run?
The code is stored in a git-repo if this is anything interesting.
Kind regards
Crooky
add ionic cli to your package.json dependencies.
use npx. This command line is bundled with node since version 5.2.0
stage('Android Build'){
steps{
bat 'npx ionic cordova build android --release'
}
}

"Missing app.json" when start an expo project, while the app.json already exists

I try run a blank project from hours, and I do not understand what is wrong.
I have the file app.json in my project folder :
{
"sdkVersion" : "19.0.0"
}
and when I try :
expo start
I have this message :
PS D:\Projects\VSCode\AwesomeProject> expo start
Starting project at D:\Projects\VSCode\AwesomeProject
Expo DevTools is running at http://localhost:19002
Error: Missing app.json. See https://docs.expo.io/
No Expo configuration found. Are you sure this is a project directory?
PS D:\Projects\VSCode\AwesomeProject>
If I try
expo android
I get this :
PS D:\Projects\VSCode\AwesomeProject> expo android
Error: Missing app.json. See https://docs.expo.io/
There is an error with your project. See above logs for information.
Set EXPO_DEBUG=true in your env to view the stack trace.
- Making sure project is set up correctly...
PS D:\Projects\VSCode\AwesomeProject>
This is a blank project, i do not understand what is going wrong. How can I found sdkversion in use ? I thought It was the error, but I am not sure.
Thank you for your help
looks like that was generated with react-native init and not expo, because it doesn't have an "expo" section. we should provide a better error message in this case.
{
"expo": {
"sdkVersion": "32.0.0"
...
}
}
It's part of the project I just made.
I solved this problem by adding sdkVersion, as you can see in the image

RNFetchBlob.mkdir got 1 arguments, expected 2

When i try to setup ongoing react-native project in that one of the plugin is react-native-fetch-blob i'll try many but can't resolve this issue.
also i remove that plugin from app and resetup all step from npm react-native-fetch-blob
after following all step getting same issue.
`RNFetchBlob.fetch('POST', 'api', {
'Content-Type': 'application/multipart/form-data'
}, [
{name: 'file', filename: filename, data: RNFetchBlob.wrap(PictureURI)}
])
.then((responseData) => {
// console.log("image uploaded",responseData);
// console.log("----------Upload Image Test---RESPONSE---------");
})
.catch(err => {
// console.log(err);
// console.log("----------Upload Image Test---RESPONSE--ERROR-------");
})`
in this plugin i'm only used the fetch method but my project gives me error mkdir method.
Resolve this issue following steps:
react-native unlink react-native-fetch-blob
npm uninstall react-native-fetch-blob --save
yarn add react-native-fetch-blob (assuming your system already
installed yarn)
RNFB_ANDROID_PERMISSIONS=true react-native link
then uninstall app from device/simulator/emulator and run command
react-native run-android
work perfect.
:)

Module not found: Error: Can't resolve 'nativescript-sound'

I am trying to use nativescript-sound package in my nativescript/vue-cli based app.I install nativescript-sound using
npm install --save nativescript-sound
After installing this i run npm clean and than try to call nativescript-sound on my project's main.js file
require("nativescript-vue").registerElement("sound", () => require("nativescript-sound").sound);
When i try to run
npm run watch:android
compiler showing me error.
Error
ERROR in ./src/main.js
Module not found: Error: Can't resolve 'nativescript-sound' in
'/home/darahat/Desktop/Rhymes/src'
# ./src/main.js
My Question is why it showing error?
Is nativescript-sound support nativescript/vue cli?
If not support which plugin i can use to add background sound and
click button sound?
I changed in
node_modules/nativescript-sound/package.json
"main": "sound.js",
to
"main": "sound",
and it works!
let Sound = require("nativescript-sound");

Migrating to react native 0.49

Recently I tried to update react native version from 0.48.4 to 0.49.0. I have read documentation about breaking changes.I installed react-native v0.49.0. When I am trying to run I got error like this
node_modules\react-native\local-cli\util\findSymlinkedModules.js:37
ignoredRoots? = [])
^
SyntaxError: Unexpected token ?
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at loader (\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (node_modules\babel-register\lib\node.js:154:7)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
I tried to upgrade using react-native-git-upgrade and react-native upgrade.But getting errors like not recognized as an internal or external command.
I found one change in New features and Enhancements change log in RN 0.49.0 like this
Refactor how symlinks are discovered in local-cli, support scoped modules.
Is there anything to do with this
If you're using a git repo, try deleting the project folder then re-clone the repo. This worked for a friend who was having the same issue.
I found this solution here:
https://github.com/facebook/react-native/issues/16458
To fix this thing I had to use babel-plugin-transform-flow-strip-types plugin.
Steps :
npm install --save-dev babel-plugin-transform-flow-strip-types
In .babelrc
{
"plugins": ["transform-flow-strip-types"]
}
More details https://www.npmjs.com/package/babel-plugin-transform-flow-strip-types
Upgrading to "react-native": "0.54.1", fixed this for me.
Ran into the same issue updating to 0.54.
The root cause here is that Node is trying to interpret JS code with Flow types (in this case, ignoredRoots?).
Normally Babel would have removed these types via babel-plugin-transform-flow-strip-types, as Dinesh suggested. But that transform is contained in the standard react-native Babel preset, which does a bunch of other things too.
So what you really have to do is to make sure you have that preset setup. It should be under a devDependency in package.json:
"devDependencies": {
"babel-preset-react-native": "^4.0.0",
And then configured in .babelrc:
{
"presets": ["react-native"]
}
After that's setup you still may need to reset the packager cache:
npm start -- --reset-cache
This is what did it for me, hope it helps.
removing ? from findSymlinkedModules.js line no 37 worked for me

Categories

Resources