Can't Generating the release APK - React Native - javascript

I want to Generate an APK, I follow these steps In Docs but still have A Build Failed
1. cd android
2. gradlew clean "build Successful"
3. gradlew assembleRelease "BUILD FAILED" with this
Could not read path '\node_modules#babel\parser.bin\parser'.
Here is package.json File
Package.Json
{
"name": "DemoApp",
"version": "1.12.3",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#turf/distance": "^6.0.1",
"#turf/helpers": "^6.1.4",
"#turf/invariant": "^6.1.2",
"#turf/turf": "^5.1.6",
"lodash": "^4.17.11",
"react": "16.8.6",
"react-native": "0.59.8",
"react-native-datepicker": "^1.7.2",
"react-native-fcm": "^16.2.4",
"react-native-firebase": "5.3.1",
"react-native-gesture-handler": "1.2.1",
"react-native-image-picker": "^0.28.0",
"react-native-linear-gradient": "^2.5.4",
"react-native-maps": "^0.24.2",
"react-native-svg": "^9.3.3",
"react-native-vector-icons": "^6.4.2",
"react-navigation": "3.11.0"
},
"devDependencies": {
"#babel/parser": "^7.4.4",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.8.0",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.54.1",
"react-devtools": "^3.6.1",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}

I also faced the same problem and solved by downgrading yarn version to 1.10.1, then it works. May it work for you as well.
Uninstall yarn 1.12.3
Install yarn 1.10.1
Go to project folder and execute yarn install
Build my project and the error is gone

Delete the node_module folder and then run npm install.

Related

Vue app not working day after working normaly

So, the problem is that my Vue app was working just fine last night, i turned of the server and went to sleep, nothing was changed or updated and i woke up this morning wanted to continue what i was doing and go for the yarn serve to open it up, and i got the error : "'vue-cli-service' is not recognized as an internal or external command, operable program or batch file.". Anyone encountered something similar?
Thanks for answering!
The package.json:
{
"name": "rails-front",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"#fortawesome/fontawesome-free": "^6.2.1",
"axios": "^1.2.5",
"bootstrap": "^5.2.3",
"bootstrap-vue": "^2.23.1",
"core-js": "^3.8.3",
"vue": "^3.2.45",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
},
"devDependencies": {
"#babel/core": "^7.12.16",
"#babel/eslint-parser": "^7.12.16",
"#vue/cli-plugin-babel": "~5.0.0",
"#vue/cli-plugin-eslint": "~5.0.0",
"#vue/cli-plugin-router": "~5.0.0",
"#vue/cli-plugin-vuex": "~5.0.0",
"#vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.0.3",
"prettier": "^2.4.1"
}
}
So instinctively i tried reinstaling the vue cli, and i done that and again it gives me the same error, so im locked in place rn
Follow the instructions step by step:
Open cmd and run the command npm uninstall -g #vue/cli
then npm install -g #vue/cli
Open your project and remove node_modules.
Re-install the packages.
This must fix your problem.

Can't start metro server "attachToServer is not a function"

Looking at the original docs, I ran npx react-native init AwesomeProject and didn't change anything.
I get attachToServer is not a function error when I run npx react-native start or yarn start. Both don't work. I didn't have this issue before I don't know what might be causing it. Using expo I can start metro so this is probably react-native cli issue.
Here are the package versions.
"dependencies": {
"react": "17.0.2",
"react-native": "0.67.2"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},

Cannot run Vue app after multiple npm audit fix

I wanted to solve a problem vulnerabilities problem and now my app does not run.
I get this error message:
This dependency was not found:
firebase in ./src/main.js, ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/Navigation.vue?vue&type=script&lang=js and 1 other
To install it, you can run: npm install --save firebase
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'
Here is my package.json:
{
"name": "poker-app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"chart.js": "^3.6.2",
"core-js": "^3.6.5",
"firebase": "^9.6.1",
"generatorics": "^1.1.0",
"itertools": "^1.7.1",
"vue": "^3.0.0",
"vue-chartkick": "^0.6.1",
"vue-echarts": "^6.0.0",
"vue-router": "^4.0.11"
},
"devDependencies": {
"#vue/cli-plugin-babel": "~4.5.0",
"#vue/cli-plugin-eslint": "~4.5.0",
"#vue/cli-plugin-router": "~4.5.0",
"#vue/cli-service": "~4.5.0",
"#vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0"
}
}
Anyone know what is it?
Try deleting the node_modules folder then running:
npm cache clean --force
npm install
Take a look on the warnings during the install as they can give you some clue about version incompatibility between packages

I am unable to install my project packages

I was getting error installing expressJs to my packages. I have had to do an npm cache clean --force no sucess, then I deleted my node_modules and package-lock.json, I try to reinstall packages using npm i I still got an error.
Now I deleted node.js from my pc windows 10 and downloaded and installed the latest node and tried to reinstall the project packages again. Now the error I get is this
$ npm i
npm ERR! Unexpected end of JSON input while parsing near '...ncies":{"autoprefixer'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Chioma Onyepere\AppData\Roaming\npm-cache\_logs\2019-05-28T20_26_29_676Z-debug.log
My app is built on nextJs
Here's the package.json
{
"name": "ratethis",
"version": "1.0.2",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "next",
"build": "next build",
"now-build": "next build",
"start": "next start -p %PORT%"
},
"repository": {
"type": "git",
"url": "git+https://github.com/infinity-web-development/ratethis"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/infinity-web-development/ratethis/issues"
},
"homepage": "https://github.com/infinity-web-development/ratethis#readme",
"dependencies": {
"#zeit/next-css": "^1.0.1",
"antd": "^3.15.1",
"faker": "^4.1.0",
"next": "^8.0.3",
"next-images": "^1.1.1",
"next-redux-wrapper": "^3.0.0-alpha.2",
"now": "^15.0.6",
"prop-types": "^15.7.2",
"react": "^16.8.5",
"react-dom": "^16.8.5",
"react-polls": "^1.2.0",
"react-redux": "^7.0.1",
"redux": "^4.0.1",
"redux-saga": "^1.0.2",
"shallow-equal": "^1.1.0",
"uuid": "^3.3.2"
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"babel-plugin-import": "^1.11.0",
"babel-plugin-inline-import": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-standard": "^4.0.0",
"next-antd-aza-less": "^1.0.2"
}
}
Apparently error is from my pc cause it works just fine on another pc.
I don't know much about npm, but I'd suggesting trying to have it verify the installs it's already done and somehow rewrite the package.json file from the existing installs.
https://docs.npmjs.com/cli/cache.html
Even though the install failed and the package.json doesn't show any traces of the install, there could be some artifact that only npm knows about that's getting in the way.

React Native: App is getting disconnected right after getting installed into emulator

react-native run-android
after thing command app is getting installed into emulator succesfully but getting disconnected from terminal.
Package.json
{
"name": "AppName",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"clean": "npm cache verify && cd android && ./gradlew clean && cd ..",
"android": "npm run install && npm run start"
},
"dependencies": {
"react": "16.2.0",
"react-native": "0.53.0",
"react-native-facebook-login": "^1.6.0",
"react-native-splash-screen": "^3.0.6",
"react-navigation": "git+https://github.com/react-community/react-navigation.git",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-actions": "2.2.1",
"redux-promise": "^0.5.3",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"babel-jest": "22.1.0",
"babel-preset-react-native": "4.0.0",
"jest": "22.1.4",
"react-test-renderer": "16.2.0"
},
"jest": {
"preset": "react-native"
}
}
below image of Logcat in Android Studio.
I dint see anything suspicions. Thanks
Tried:
mkdir android/app/src/main/assets
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
react-native run-android
and
cd android && ./gradlew clean && cd .. && react-native run-android

Categories

Resources