My client app is already published on Google Play and it crashes
It maybe a stupid behavior from me , when I noted it works well for IOS,
I quickly deployed it for Android and published it
I tried to run it in my development environment using
sudo react-native run-android
it makes the below error
What's the potential errors ?
I'm using MAC High Sierra
my package.json file
{
"name": "WOFA",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"accordion-collapse-react-native": "^0.1.10",
"is-email": "^1.0.0",
"native-base": "^2.12.1",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-easy-grid": "^0.2.1",
"react-native-firebase": "~5.5.4",
"react-native-gesture-handler": "^1.3.0",
"react-native-grid-list": "^1.0.9",
"react-native-image-picker": "^1.0.1",
"react-native-image-slider-show": "^1.0.3",
"react-native-modal": "^11.1.0",
"react-native-paypal-lib": "^1.0.9",
"react-native-side-drawer": "^1.1.7",
"react-native-slider": "^0.11.0",
"react-native-snackbar": "^1.0.1",
"react-native-svg": "^9.5.1",
"react-native-touchable-safe": "^1.1.2",
"react-navigation": "^3.11.0"
},
"devDependencies": {
"#babel/core": "^7.5.0",
"#babel/runtime": "^7.5.1",
"babel-jest": "^24.8.0",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.54.1",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
the packages which need native linking are : [react-native-firebase , react-native-gesture-handler , react-native-image-picker , react-native-paypal-lib , react-native-svg]
I got similar error on Windows 10.
In my case the culprit was node v.12.
Uninstall node and install LTS version of node.
(Currently node v.10.16.0)
Best Luck. π
Related
The build was working fine before installing expo-image-picker. But it's not working now even after removing the package.
This is the build command.
eas build -p android --profile preview2
Both android and ios build failing.
It looks like an image error, i removed all the images from my app but the issue still persists
Here's my package.json
{
"name": "my-app",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#eva-design/eva": "^2.1.1",
"#expo/webpack-config": "~0.16.2",
"#react-native-async-storage/async-storage": "~1.17.3",
"#react-native-masked-view/masked-view": "^0.2.6",
"#react-navigation/bottom-tabs": "^6.3.1",
"#react-navigation/material-bottom-tabs": "^6.2.1",
"#react-navigation/native": "^6.0.10",
"#react-navigation/native-stack": "^6.6.2",
"#react-navigation/stack": "^6.2.1",
"#sentry/react-native": "^3.4.2",
"#ui-kitten/components": "^5.1.2",
"axios": "^0.27.2",
"expo": "~45.0.0",
"expo-application": "~4.1.0",
"expo-blur": "~11.1.0",
"expo-constants": "~13.1.1",
"expo-dev-client": "~0.9.6",
"expo-device": "~4.2.0",
"expo-image-picker": "~13.1.1",
"expo-linear-gradient": "~11.3.0",
"expo-localization": "~13.0.0",
"expo-notifications": "~0.15.2",
"expo-splash-screen": "~0.15.1",
"expo-status-bar": "~1.3.0",
"expo-updates": "~0.13.1",
"lodash": "^4.17.21",
"moment": "^2.29.3",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.68.2",
"react-native-gesture-handler": "~2.2.1",
"react-native-modern-datepicker": "^1.0.0-beta.91",
"react-native-reanimated": "^2.8.0",
"react-native-safe-area-context": "4.2.4",
"react-native-screens": "~3.11.1",
"react-native-svg": "12.3.0",
"react-native-vector-icons": "^9.1.0",
"react-native-web": "0.17.7",
"sentry-expo": "^4.2.0",
"styled-components": "^5.3.5"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#types/lodash": "^4.14.182",
"#types/react": "~17.0.21",
"#types/react-native": "~0.67.6",
"#types/react-native-vector-icons": "^6.4.10",
"#types/styled-components": "^5.1.25",
"#types/styled-components-react-native": "^5.1.3",
"ts-node": "^10.7.0",
"typescript": "~4.3.5"
},
"private": true
}
I ended up removing all the images I optimized with expo-optimize, deleted node_modules and rebuild yarn or npm install and that did the trick for me. Fortunately I had a back up of the images.
I have a little problem with postcss, i update this package because of audit issue.
First when i started my app, but i fixed this one by adding
"postcss-preset-env": "^7.2.3",
in my package.json resolutions.
But then, when i tried to build my app, i get the following one, and i dont find anything directly related to this specific
Cannot read properties of undefined (reading 'unprefixed')
complete error here:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
cssnano-util-raw-cache: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
Failed to compile.β βΈ© β § : timing npm:load Completed in 32ms
Cannot read properties of undefined (reading 'unprefixed')
CompileError: Begins at CSS selector undefined
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm timing command:run-script Completed in 16564ms
npm timing npm Completed in 16715ms
i know it because of
"resolutions": {
"postcss": "^8.2.13",
...
}
if i remove this, the error go away (but my 'yarn audit' rise vulnerabilities)
Can someone help me to understand the error? What kind of css issue can make this error? I found on google that sometimes, empty rules like
.myrules {
}
Can rise error, but not exactly the one i get, and even, i looked each scss file without finding empty rules.
my complete package.json:
{
"name": "x",
"version": "0.1.0",
"private": true,
"dependencies": {
"#redux-offline/redux-offline": "^2.6.0",
"#reduxjs/toolkit": "^1.6.2",
"#testing-library/dom": "^8.11.1",
"#testing-library/jest-dom": "^5.11.4",
"#testing-library/react": "^11.1.0",
"#testing-library/user-event": "^12.1.10",
"#types/jest": "^27.0.3",
"#types/node": "^12.0.0",
"#types/react": "^17.0.0",
"#types/react-dom": "^17.0.0",
"#types/react-router-dom": "^5.3.1",
"#yaireo/tagify": "^4.9.5",
"axios": "^0.24.0",
"date-fns": "^2.28.0",
"dompurify": "^2.3.3",
"dotenv": "^10.0.0",
"enzyme": "^3.11.0",
"i18next": "^21.6.3",
"i18next-browser-languagedetector": "^6.1.2",
"i18next-parser": "^5.4.0",
"jest-webpack-resolver": "^0.3.0",
"moment": "^2.29.1",
"moment-timezone": "^0.5.34",
"react": "^17.0.2",
"react-datepicker": "^4.6.0",
"react-dom": "^17.0.2",
"react-html-parser": "^2.0.2",
"react-i18next": "^11.15.1",
"react-redux": "^7.2.6",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"react-test-renderer": "^17.0.2",
"react-transition-group": "^4.4.2",
"redux": "^4.1.1",
"redux-mock-store": "^1.5.4",
"redux-thunk": "^2.4.0",
"sass": "^1.43.3",
"typescript": "^4.1.2",
"url-search-params-polyfill": "^8.1.1",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "REACT_APP_VERSION=$npm_config_vers REACT_APP_YMD=$npm_config_ymd REACT_APP_CUSTO=$npm_config_customer REACT_APP_ENV=$npm_config_env yarn startenv",
"build": "REACT_APP_VERSION=$npm_config_vers REACT_APP_YMD=$npm_config_ymd REACT_APP_CUSTO=$npm_config_customer REACT_APP_ENV=$npm_config_env yarn buildenv",
"startenv": "sh -ac '. .env.${REACT_APP_CUSTO}.${REACT_APP_ENV}; react-scripts start'",
"buildenv": "sh -ac '. .env.${REACT_APP_CUSTO}.${REACT_APP_ENV}; react-scripts build'",
"test": "jest test --watch --config=jest.config.js",
"trans-extract": "i18next",
"trans-convert-po-to-json": "node scripts/trans-po-to-json.js",
"trans-convert-json-to-po": "node scripts/trans-json-to-po.js"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"#types/dompurify": "^2.3.1",
"#types/enzyme": "^3.10.10",
"#types/react-datepicker": "^4.3.4",
"#types/react-html-parser": "^2.0.2",
"#types/react-test-renderer": "^17.0.1",
"#types/react-transition-group": "^4.4.4",
"#types/redux-mock-store": "^1.0.3",
"#types/yaireo__tagify": "^4.9.0",
"#wojtekmaj/enzyme-adapter-react-17": "^0.6.5",
"mock-local-storage": "^1.1.19",
"ts-jest": "26.4.2"
},
"resolutions": {
"node-forge": "^1.0.0",
"browserslist": "^4.16.5",
"glob-parent": "^5.1.2",
"immer": "^9.0.6",
"nth-check": "^2.0.1",
"ansi-regex": "^5.0.1",
"nanoid": "^3.1.31",
"postcss": "^8.2.13",
"postcss-preset-env": "^7.2.3",
"follow-redirects": "^1.14.7"
}
}
Following the guideline here: https://firebase.google.com/docs/functions/unit-testing
I'm trying to write unit tests to my TS functions.
here's my package.json:
{
"name": "functions",
"scripts": {
"lint": "tslint --project tsconfig.json",
"build": "tsc",
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log",
"test": "mocha --reporter spec"
},
"main": "lib/index.js",
"dependencies": {
"#types/algoliasearch": "^3.27.0",
"#types/axios": "^0.14.0",
"#types/nodemailer": "^4.6.0",
"#types/stripe": "^5.0.11",
"algoliasearch": "^3.27.1",
"axios": "^0.18.0",
"firebase-admin": "~5.12.0",
"firebase-functions": "^1.0.3",
"nodemailer": "^4.6.4",
"stripe": "^5.8.0",
"webpack": "^4.7.0"
},
"devDependencies": {
"#types/node": "^9.6.6",
"firebase-functions-test": "^0.1.2",
"mocha": "^5.2.0",
"ts-loader": "^4.2.0",
"tslint": "^5.8.0",
"typescript": "^2.8.3",
"webpack-cli": "^2.1.2",
"webpack-node-externals": "^1.7.2"
},
"private": true
}
and I have 1 problem and 1 question.
problem:
I can't import the firebase-functions-test
in my index.test.ts file.
it is looking for it in dependencies only and not in devDependencies...
(adding it inside dependencies solve it).
question:
Can I move all the #types to devDependencies?
Thanks.
If I am right you probably get error something like
Module 'firebase-functions-test' is not listed as dependency in package.json
In fact this is because you have enabled tslint rule no-implicit-dependencies. You can disable it and then you will not get error when importing devDependencies in your unit test.
You can change set tslint to consider dev,
{
...
"rules": {
"no-implicit-dependencies": [true, "dev"],
...
}
see https://github.com/houndci/hound/issues/1522#issuecomment-415760094
Output from ember version --verbose && npm --version:
ember-cli: 2.12.1
http_parser: 2.7.0
node: 6.10.2
v8: 5.1.281.98
uv: 1.9.1
zlib: 1.2.11
ares: 1.10.1-DEV
icu: 58.2
modules: 48
openssl: 1.0.2k
os: darwin x64
3.10.10
When I try ember s I have the following error,
Livereload server on http://localhost:49153
Serving on http://localhost:4200/
The Broccoli Plugin: [object Object] failed with:
Error: EISDIR: illegal operation on a directory, read
at Error (native)
at Object.fs.readSync (fs.js:732:19)
at tryReadSync (fs.js:487:20)
at Object.fs.readFileSync (fs.js:535:19)
at /Users/li-xinyang/Desktop/XX_MemoCycle_Firebase/node_modules/broccoli-flatiron/index.js:33:16
at Array.forEach (native)
at readDirectory (/Users/li-xinyang/Desktop/XX_MemoCycle_Firebase/node_modules/broccoli-flatiron/index.js:28:31)
at /Users/li-xinyang/Desktop/XX_MemoCycle_Firebase/node_modules/broccoli-flatiron/index.js:21:15
at tryCatch (/Users/li-xinyang/Desktop/XX_MemoCycle_Firebase/node_modules/rsvp/dist/rsvp.js:539:12)
at invokeCallback (/Users/li-xinyang/Desktop/XX_MemoCycle_Firebase/node_modules/rsvp/dist/rsvp.js:554:13)
The broccoli plugin was instantiated at:
undefined
Below is a list of devDependencies,
package.json File
{
"name": "memo-cycle",
"version": "0.0.0",
"description": "A study tool for serious learner",
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"repository": "",
"scripts": {
"build": "ember build",
"start": "ember server",
"test": "ember test"
},
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^2.4.1",
"ember-cli": "2.12.1",
"ember-cli-app-version": "^2.0.0",
"ember-cli-babel": "^5.1.7",
"ember-cli-dependency-checker": "^1.3.0",
"ember-cli-eslint": "^3.0.0",
"ember-cli-gravatar": "^3.8.1",
"ember-cli-htmlbars": "^1.1.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.6",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-qunit": "^3.1.0",
"ember-cli-sass": "^6.1.2",
"ember-cli-shims": "^1.0.2",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-export-application-global": "^1.0.5",
"ember-in-viewport": "^2.1.1",
"ember-inline-svg": "^0.1.10",
"ember-load-initializers": "^0.6.0",
"ember-paper": "^1.0.0-alpha.19",
"ember-power-select": "^1.6.1",
"ember-power-select-with-create": "^0.3.1",
"ember-resolver": "^2.0.3",
"ember-route-action-helper": "^2.0.2",
"ember-simple-auth": "^1.2.2",
"ember-source": "~2.12.0",
"loader.js": "^4.2.3"
},
"engines": {
"node": ">= 4"
},
"private": true
}
It was working fine before my last to commit. What I have done in the last two commits are I remove all .DS_Store files in the last commit and added Firebase deploy config files and install cloud function dependencies via Yarn in the last second commit.
What I have tried to resolve the issues, but the issue persists.
1) Delete all node modules via rm -rf node_modules and re-install them npm install (dependencies were installed via Yarn)
2) Remove the project and clone from the origin
3) Revert back to early commit (issue persists even I revert back to the initial commit and re-install all the dependencies of course)
4) Restart Mac π
5) Update .ember-cli file and re-run ember init setup process
The issues is caused by
That plugin looks like it was built for an older version of broccoli, but the basic problem seems that its write function doesn't handle symlinks to directories.
See this GitHub issue for more details
https://github.com/ember-cli/ember-cli/issues/6981
I upgraded embercli, emberjs and ember data. After I run ember init. Then when I ember server, I got below stuff. I have tried to redo everything (upgrading). Same result. There is no error. Only a couple warnings when I upgrade embercli. I attached the warning at the end. I am not sure if they are relevant.
[jusfeel#localhost hillwave-ember-js]$ ember serve
version: 2.4.2
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/user-guide/#watchman for more info.
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/vendor.js] failed with:
Error: ENOENT: no such file or directory, stat '/home/jusfeel/ember/hillwave-ember-js/tmp/source_map_concat-input_base_path-CxIUyeSW.tmp/0/bower_components/es5-shim/es5-shim.js'
at Error (native)
at Object.fs.statSync (fs.js:893:18)
at ConcatWithMaps.keyForFile (/home/jusfeel/ember/hillwave-ember-js/node_modules/broccoli-caching-writer/index.js:90:20)
at Array.map (native)
at ConcatWithMaps.CachingWriter._conditionalBuild (/home/jusfeel/ember/hillwave-ember-js/node_modules/broccoli-caching-writer/index.js:112:65)
at /home/jusfeel/ember/hillwave-ember-js/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/read_compat.js:61:34
at lib$rsvp$$internal$$tryCatch (/home/jusfeel/ember/hillwave-ember-js/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/home/jusfeel/ember/hillwave-ember-js/node_modules/rsvp/dist/rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (/home/jusfeel/ember/hillwave-ember-js/node_modules/rsvp/dist/rsvp.js:1019:11)
at lib$rsvp$asap$$flush (/home/jusfeel/ember/hillwave-ember-js/node_modules/rsvp/dist/rsvp.js:1198:9)
The broccoli plugin was instantiated at:
at ConcatWithMaps.Plugin (/home/jusfeel/ember/hillwave-ember-js/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/index.js:10:31)
at ConcatWithMaps.CachingWriter [as constructor] (/home/jusfeel/ember/hillwave-ember-js/node_modules/broccoli-caching-writer/index.js:21:10)
at new ConcatWithMaps (/home/jusfeel/ember/hillwave-ember-js/node_modules/broccoli-concat/concat.js:22:17)
at module.exports (/home/jusfeel/ember/hillwave-ember-js/node_modules/broccoli-concat/index.js:26:10)
at EmberApp.concatFiles (/home/jusfeel/ember/hillwave-ember-js/node_modules/ember-cli/lib/broccoli/ember-app.js:329:10)
at EmberApp.javascript (/home/jusfeel/ember/hillwave-ember-js/node_modules/ember-cli/lib/broccoli/ember-app.js:1190:12)
at EmberApp.toArray (/home/jusfeel/ember/hillwave-ember-js/node_modules/ember-cli/lib/broccoli/ember-app.js:1542:10)
at EmberApp.toTree (/home/jusfeel/ember/hillwave-ember-js/node_modules/ember-cli/lib/broccoli/ember-app.js:1564:30)
at module.exports (/home/jusfeel/ember/hillwave-ember-js/ember-cli-build.js:38:14)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/home/jusfeel/ember/hillwave-ember-js/node_modules/ember-cli/lib/models/builder.js:55:19)
My bower.json
{
"name": "hillwave-ember-js",
"dependencies": {
"ember": "2.4.2",
"ember-cli-shims": "0.1.0",
"ember-cli-test-loader": "0.2.2",
"jquery": "~2.1.0",
"bootstrap": "~3.3.6",
"showdown": "~1.3.0",
"fastclick": "^1.0.6"
},
"resolutions": {
"ember": "2.3.1"
},
"devDependencies": {
"blanket": "~1.1.5",
"ember-qunit-notifications": "0.1.0"
}
}
My package.json
{
"name": "hillwave-ember-js",
"version": "0.0.0",
"description": "Small description for hillwave-ember-js goes here",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "ember build",
"start": "ember server",
"test": "ember test"
},
"repository": "",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.2.0",
"ember-ajax": "0.7.1",
"ember-cli": "^2.4.2",
"ember-cli-app-version": "^1.0.0",
"ember-cli-babel": "^5.1.5",
"ember-cli-blanket": "0.8.0",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-deploy": "0.5.1",
"ember-cli-deploy-build": "0.1.1",
"ember-cli-deploy-display-revisions": "0.1.1",
"ember-cli-deploy-revision-data": "0.1.1",
"ember-cli-deploy-rsync": "0.0.4",
"ember-cli-deploy-ssh-index": "0.2.0",
"ember-cli-document-title": "0.3.0",
"ember-cli-es5-shim": "^0.1.1",
"ember-cli-fastclick": "1.1.0",
"ember-cli-flash": "1.3.8",
"ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.2.1",
"ember-cli-release": "0.2.8",
"ember-cli-showdown": "2.5.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.4.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-i18n": "4.2.0",
"ember-infinity": "0.2.1",
"ember-lazy-image": "https://github.com/twokul/ember-lazy-image.git",
"ember-load-initializers": "^0.5.0",
"ember-page-object": "1.1.1",
"ember-resolver": "^2.0.3",
"ember-route-history": "0.1.3",
"ember-simple-auth": "1.0.1",
"ember-suave": "1.2.3",
"emberx-select": "2.0.2",
"fastclick": "1.0.6",
"graceful-fs": "^4.1.3",
"memory-scroll": "0.2.0"
},
"dependencies": {
"fonts.css": "^1.4.0",
"loader.js": "^4.0.0"
}
}
Some warnings when upgrade embercli from 2.2.0 to 2.4.2.
npm WARN deprecated lodash-node#2.4.1: This package has been discontinued in favor of lodash#^4.0.0.
npm WARN deprecated graceful-fs#3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs#^4.0.0 as soon as possible.
npm WARN prefer global marked#0.3.5 should be installed with -g
npm WARN prefer global npm#2.14.21 should be installed with -g
Edit
/*jshint node:true*/
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add options here
minifyCSS: {
enabled: true,
compatibility: '-properties.backgroundSizeMerging'
}
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
app.import('bower_components/bootstrap/dist/css/bootstrap.css');
app.import('bower_components/bootstrap/dist/css/bootstrap.css.map',{
destDir: 'assets'
});
app.import('vendor/royal_preloader/royal_preloader.css');
app.import('bower_components/bootstrap/dist/js/bootstrap.js');
app.import('vendor/royal_preloader/royal_preloader.min.js');
app.import('vendor/jquery.qrcode.min.js');
app.import('vendor/royal_preloader/config.js');
return app.toTree();
};
It's a mistake I made. When I do ember init, I didn't pay attention to remove es5-shim from package.json and left it there. That's why this issue caught me.
I guess I should be much much more careful when I do ember init like the release doc actually had warned.
The most common source of upgrade pain is missing changes in this
step.