I have some problems when i try to run my app on phones that have iOS, but in Android don't have this problem. I'm coding in Sublime Text, not in XDE and executing my project in terminal, with commands npm start and reading the QR Code. I'm coding in Windows 10.
I build the project with create-react-native-app
The erro that appears is
C:/Users/adria/Desktop/App/src/Imgs/image.png: Cannot find module
'C:/Users/adria/Desktop/App/node_moduless/expo/tools/hashAssetFiles'
In the first time i did think that image is with wrong name or wrong directory, and i go to the code and certify that is correctly. So, i resolve to try in my Android and for my surprise, work correctly.`
My project:
[https://snack.expo.io/HyKP1hyjz][1]
My package.json
{
"name": "App",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.11.1",
"jest-expo": "25.0.0",
"react-test-renderer": "16.2.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js" },
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^25.0.0",
"react": "16.2.0",
"react-native": "0.52.0",
"react-navigation": "^1.5.8"
}
}
I try to remove the image from my project and try run again, and have the same problem but with another image, from react-navigation
C:\Users\adria\Desktop\App\node_modules\react-navigation\src\views\assets\back-icon.png
You'll need to have the exponent package installed, see: https://github.com/expo/expo/issues/72
Related
After building the electron application using electron-builder, I cannot open the application from the dist folder. I did change all my links to use path.join(__dirname, "relative_path/") as what I have seen in some answers here. But I can't open the application even though the packaging process is successful.
File structure for the electron app project
Here's an image of my file structure, and this is the package.json file of the project
{
"name": "my_little_reminder",
"version": "0.5.0",
"description": "A simple time reminder app",
"main": "src/index.js",
"scripts": {
"start": "electron .",
"test": "jest --coverage",
"build": "electron-builder --dir"
},
"author": "Leonlit",
"license": "MIT",
"dependencies": {
"node-notifier": ">=8.0.1",
"node-schedule": "^1.3.2",
"sqlite3": "^5.0.0",
"electron-log": "^4.3.1"
},
"devDependencies": {
"electron": "^11.2.1",
"electron-builder": "^22.9.1",
"jest": "^26.6.3"
}
}
Finally, here's a link to the repository if the information here is not enough, https://github.com/Leonlit/My-Little-Reminder/tree/development
Resolved the issue by adding and using the npm script "postinstall": "electron-builder install-app-deps".
Then, using path.join(app.getPath('userData'), '/tasks.db') instead of path.join(__dirname, '/tasks.db') for the sqlite database storage location.
Finally, changed a link in the index file which caused the application to always request for saving a ASAR file on app launch if left unfixed.
I'm trying to build a React Native project from another developer and he didn't commit the ios directory. Now I need to run the app on iOS and tried to use react-native upgrade to recreate the iOS config. When I run react-native run-ios after npm install, I'm getting "Application has not been registered error".
What do I have to change or what is the right way to recreate the iOS settings?
I'm running these commands on a MacOS High Sierra with Xcode 10.
Here's the package.json:
{
"name": "thefeedback-app",
"version": "1.0.0",
"description": "Project",
"main": "app.js",
"scripts": {
"start": "react-native start",
"postinstall": "node ./android-release-gradle-fix.js",
"clean":" #powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./preBuilding.ps1",
"android": "npm run clean && react-native run-android",
"ios": "react-native run-ios",
"test": "node node_modules/jest/bin/jest.js",
"bundle": "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"
},
"keywords": [
"react",
"native"
],
"license": "ISC",
"dependencies": {
"axios": "0.18.0",
"moment": "2.22.2",
"react": "16.4.0 ",
"react-native": "0.55.4",
"react-native-background-job": "2.1.1",
"react-native-easy-toast": "1.1.0",
"react-native-material-dropdown": "0.11.1",
"react-native-material-textfield": "0.12.0",
"react-native-onesignal": "3.2.5",
"react-native-push-notification": "3.0.2",
"react-native-sqlite-storage": "3.3.6",
"react-native-vector-icons": "4.6.0",
"react-navigation": "2.3.0",
"react-redux": "5.0.7",
"redux": "3.7.2",
"render-if": "0.1.1"
},
"devDependencies": {
"react-native-scripts": "1.14.1",
"react-test-renderer": "16.3.0-alpha.1"
}
}
The index.js:
import { AppRegistry } from 'react-native';
import App from './app/app';
import data from './app.json';
AppRegistry.registerComponent(data.displayName, () => App);
console.disableYellowBox = true;
And the app.json:
{
"expo": {
"sdkVersion": "25.0.0"
},
"name": "TheFeedbackApp",
"displayName": "TheFeedbackApp"
}
It seems that's something related to the name having a hyphen.
well i am not getting any answers to this error ..
npm update to latest and downgrade also tried.
nothing works
package.json so it i get some help ...
{
"name": "kelsnew",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "~27.0.0",
"react-native-scripts": "^1.14.1",
"react-test-renderer": "16.3.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "jest"
},
"dependencies": {
"expo": "^28.0.0",
"jest": "^23.4.1",
"react": "16.3.1",
"react-native": "^0.56.0"
}
}
I tried several things and several things in combination, but ultimately when I added #babel to my .babelrc plugin line without any other changes. I then deleted node_modules, package-lock.json and ran npm install.
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["#babel/transform-react-jsx-source"]
}
}
}
I also upgraded from Nodejs 8 to 10 along the way (and stayed there). I don't think it material, but I mention it just in case, check your node --version.
Check your app.js for any calls to the property filename such as someObject.filename, this is most likely due to some object not being instantiated and thus you are getting undefined.filename which throws an error.
I am using react-native-base for using react-native components.
I have already installed previously
react-native-document-picker
react-native-fcm
react-native-image-crop-picker
react-native-vector-icons
react-navigation
But now Whatever new Package/Library I am Installing in my existing app, some of my existing packages/files are getting removed, and because of it So many errors are coming. why is this happening while installing any of the new package.
Here is screenshot I am attaching when installing new library
package.json
{
"name": "myApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.3.1",
"react-native": "0.55.3",
"react-native-star-rating": "^1.0.9"
},
"devDependencies": {
"babel-jest": "22.4.3",
"babel-preset-react-native": "4.0.0",
"jest": "22.4.3",
"react-test-renderer": "16.3.1"
},
"jest": {
"preset": "react-native"
}
}
I create desktop application by using electron, and tried electron-packager.
But electron-packager doesn't package node modules which names are started from "#" (Example: #turf, #mapbox)
In node_modules folder of developing folder, I can find "#turf" and "#mapbox".
But after running
>electron-packager . MaplatEditor --platform=darwin --arch=x64 --electron-version=1.7.9
Created package never includes "#turf" and "#mapbox".
And also, it's depending modules are also not included.
My package.json includes "#turf", so it is not setting error.
{
"name": "MaplatEditor",
"version": "1.0.0",
"description": "",
"main": "lib/main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"#turf/turf": "^4.6.1",
"argv": "0.0.2",
"async": "^2.5.0",
"child_process": "^1.0.2",
"electron-json-storage": "^3.2.0",
"file-url": "^2.0.2",
"fs-extra": "^3.0.1",
"imagemagick": "^0.1.3",
"mapshaper": "^0.4.31",
"path": "^0.12.7",
"wellknown": "^0.5.0"
}
}
How can I package such #-started modules into application package?
In my case, I updated #Turf module for latest version, then electron-packager worked well.
I don't know why, but it looks not the issue of electron-packager...