Getting error - Unrecognized command "run-android", when running react native, - android

I get this error when try and run react native on my emulator, react-native run-android
error Unrecognized command "run-android".
My emulator is connected and working, any ideas?
Package.json:
{
"name": "iaapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"name": "Inovative Anatomy",
"flow": "flow",
"test": "node ./node_modules/jest/bin/jest.js --watchAll"
},
"dependencies": {
"#babel/plugin-proposal-decorators": "^7.4.4",
"#react-native-community/async-storage": "^1.6.1",
"react": "16.8.5",
"react-dom": "^16.8.6",
"react-native": "0.59.10",
"react-native-circular-progress": "^1.1.0",
"react-native-component-fade": "^1.0.2",
"react-native-elements": "^1.1.0",
"react-native-fade": "^1.0.3",
"react-native-fade-in-view": "^1.0.5",
"react-native-gesture-handler": "^1.3.0",
"react-native-responsive-image": "^2.3.1",
"react-native-share": "^1.2.1",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^9.5.1",
"react-native-vector-icons": "^6.6.0",
"react-native-view-shot": "^2.6.0",
"react-native-webview": "^5.12.1",
"react-native-webview-bridge": "^0.40.1",
"react-navigation": "^3.0.9",
"react-navigation-backhandler": "^1.3.2",
"react-navigation-transitions": "^1.0.11",
"react-redux": "^6.0.1",
"redux": "^4.0.1",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"#babel/cli": "^7.5.5",
"#babel/core": "^7.5.5",
"#babel/runtime": "^7.8.4",
"#react-native-community/eslint-config": "^0.0.7",
"#types/jest": "^24.0.18",
"#types/react": "^16.9.2",
"#types/react-native": "^0.60.14",
"#types/react-redux": "^7.1.7",
"#types/react-test-renderer": "^16.9.0",
"#types/redux-logger": "^3.0.7",
"#types/redux-persist": "^4.3.1",
"babel-jest": "^24.1.0",
"eslint": "^6.8.0",
"jest": "^24.1.0",
"metro-react-native-babel-preset": "0.54.1",
"prettier": "^1.18.2",
"react-native-dotenv": "^0.2.0",
"react-test-renderer": "16.8.6",
"redux-logger": "^3.0.6",
"tslint-react": "^4.2.0",
"typescript": "^3.6.3"
},
"jest": {
"preset": "react-native",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
}
}

I had this issue for a few minutes until I realized I was running the command in the wrong directory...
I'm putting this here in hopes that this will help some future dev from making a similar, simple, mistake.

try npx react-native run-android

if "npx react-native run-android" is not working goto "package.jason" file
and look over "scripts" debugger is there.
clicking on debugger gives you options on top of the screen.
select"react-native run-android".

You have to update your npm version... Use this command and try again...
npm install npm#latest -g
credits here

Related

React native apk release issue

I am new in react-native. I created one app it was working fine on local but when i run the release APK the app crash on change screen/navigate to another screen.
I have tried for days now to resolve this without success. Im not really sure what is causing this issue as when i run the debug version the app works fine no issues.
As soon as i open the installed signed APK the app crashes.
I am using the below packages.
{ "name": "testAPP", "version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-navigation/bottom-tabs": "^6.0.9",
"#react-navigation/drawer": "^6.1.8",
"#react-navigation/material-top-tabs": "^6.0.6",
"#react-navigation/native": "^6.0.6",
"#react-navigation/native-stack": "^6.2.5",
"axios": "^0.24.0",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-auth0": "^2.11.0",
"react-native-elements": "^3.4.2",
"react-native-gesture-handler": "^2.1.1",
"react-native-gifted-chat": "^0.16.3",
"react-native-linear-gradient": "^2.5.6",
"react-native-pager-view": "^5.4.9",
"react-native-paper": "^4.11.1",
"react-native-raw-bottom-sheet": "^2.2.0",
"react-native-reanimated": "^2.2.4",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.1",
"react-native-simple-modal": "^9.0.1",
"react-native-svg": "^12.1.1",
"react-native-svg-transformer": "^1.0.0",
"react-native-tab-view": "^3.1.1",
"react-native-vector-icons": "^9.0.0",
"react-redux": "^7.2.6",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1"
},
"devDependencies": {
"#babel/core": "7.16.7",
"#babel/runtime": "7.16.7",
"#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"
},
"jest": {
"preset": "react-native",
"setupFiles": [
"./node_modules/react-native-gesture-handler/jestSetup.js"
]
}
}

React native app crashes in IOS 13 version devices

I am working on a react-native app. The app is running perfectly in android and IOS below 13 version, but it crashes on devices with IOS 13 and above. I don't get any error or warning while running in IOS 13 version device.
I don't know which package is not supported on the IOS 13 version devices.
Here is my package.json, which of these is causing the problem?
{
"name": "Reapp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"build-release": "react-native run-android --variant=release && open android/app/build/outputs/apk/release",
"reverse": "adb reverse tcp:8081 tcp:8081 && adb reverse tcp:9090 tcp:9090",
"clean": "cd android && gradlew clean && cd ..",
"cleanrun": "cd android && gradlew clean && cd .. && react-native run-android",
"delbuild": "rmdir android\\app\\build /s /q",
"tron-emulator": "node ReactotronEmulator.js",
"tron-device": "node ReactotronDevice.js",
"debug-build": "react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug && cd android && gradlew assembleDebug && cd ..",
"select": "node firebaseEnv"
},
"rnpm": {
"assets": [
"src/assets/fonts/"
]
},
"dependencies": {
"#invertase/react-native-apple-authentication": "^1.1.2",
"#react-native-community/async-storage": "^1.7.1",
"#react-native-community/netinfo": "^4.7.0",
"#react-native-community/push-notification-ios": "^1.0.5",
"#react-native-community/viewpager": "^3.3.0",
"#react-native-firebase/analytics": "^6.2.0",
"#react-native-firebase/app": "^6.2.0",
"#react-native-firebase/auth": "^6.2.0",
"amazon-cognito-identity-js": "^4.2.1",
"aws-amplify": "^3.0.8",
"aws-appsync": "^3.0.2",
"axios": "^0.19.0",
"eslint": "^6.8.0",
"geolib": "^3.2.0",
"graphql-tag": "^2.10.0",
"instabug-reactnative": "^9.0.1",
"lodash": "^4.17.10",
"moment": "^2.22.2",
"prop-types": "^15.6.2",
"react": "16.9.0",
"react-apollo": "^2.3.3",
"react-native": "0.61.5",
"react-native-appstore-version-checker": "^2.7.2",
"react-native-barcode-builder": "^1.0.5",
"react-native-beacons-manager": "git://github.com/MacKentoch/react-native-beacons-manager.git#53c1bda",
"react-native-bluetooth-status": "^1.3.0",
"react-native-camera": "^3.15.0",
"react-native-device-info": "^2.2.1",
"react-native-easy-toast": "^1.2.0",
"react-native-exit-app": "^1.0.0",
"react-native-fbsdk": "^1.1.1",
"react-native-floating-action": "^1.19.1",
"react-native-geolocation-service": "^3.1.0",
"react-native-gesture-handler": "^1.5.3",
"react-native-image-picker": "^0.26.10",
"react-native-image-placeholder": "^1.0.14",
"react-native-immediate-phone-call": "^1.0.0",
"react-native-in-app-utils": "^6.0.2",
"react-native-linear-gradient": "^2.5.6",
"react-native-modal": "^6.5.0",
"react-native-onesignal": "^3.6.1",
"react-native-pdf": "^5.0.9",
"react-native-pulse": "^1.0.7",
"react-native-push-notification": "^3.1.9",
"react-native-qr-generator": "^1.0.4",
"react-native-reanimated": "^1.7.0",
"react-native-responsive-screen": "^1.2.0",
"react-native-splash-screen": "^3.2.0",
"react-native-swiper": "^1.5.13",
"react-native-system-setting": "^1.7.2",
"react-native-tab-view": "^2.0.1",
"react-native-text": "0.0.8",
"react-native-vector-icons": "^6.6.0",
"react-native-webview": "^8.0.2",
"react-navigation": "^3.2.3",
"react-redux": "^7.1.3",
"redux": "^4.0.4",
"redux-persist": "^6.0.0",
"redux-saga": "^1.1.3",
"rn-fetch-blob": "^0.10.16",
"socket.io-client": "^2.2.0",
"tipsi-stripe": "^7.5.1"
},
"devDependencies": {
"#babel/core": "^7.6.2",
"#babel/runtime": "^7.6.2",
"#react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"babel-eslint": "^8.2.6",
"metro-react-native-babel-preset": "^0.56.0",
"eslint-config-google": "^0.9.1",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-flowtype": "^2.50.0",
"eslint-plugin-react": "^7.10.0",
"jest": "^24.9.0",
"react-test-renderer": "16.9.0",
"reactotron-react-native": "^2.1.0",
"simple-plist": "^1.0.0"
},
"jest": {
"preset": "react-native"
}
}
Try running your app through Xcode. You'll be able to find the full stack-trace of the crash in the log even if you're running it in release mode.
This blog might be helpful.

While Debug mode, its working perfectly but in release APK it gives error

I have developed a react-native app for internal usage. In the Debug mode, it's working without any error and gesture is also working fine. But in release APK with self-signed Keystore its shows some error. When the Drawer and tab components are called it stopped working.
"name": "AnnaIndustry",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/async-storage": "^1.6.2",
"#react-native-community/datetimepicker": "^2.1.0",
"#react-native-community/viewpager": "^2.0.0",
"autoresponsive-react-native": "^1.0.9",
"axios": "^0.19.0",
"native-base": "^2.13.8",
"prop-types": "^15.7.2",
"react": "16.9.0",
"react-native": "0.61.2",
"react-native-gesture-handler": "^1.4.1",
"react-native-image-picker": "^1.1.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-reanimated": "^1.3.0",
"react-native-screens": "^2.0.0-alpha.3",
"react-native-swiper": "^1.5.14",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^4.0.10",
"react-navigation-drawer": "^2.2.2",
"react-navigation-material-bottom-tabs": "^2.1.2",
"react-navigation-stack": "^1.9.3",
"react-navigation-tabs": "^2.5.5",
"react-redux": "^7.1.1",
"redux": "^4.0.4",
"redux-logger": "^3.0.6",
"redux-promise-middleware": "^6.1.1",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"#babel/core": "7.6.2",
"#babel/runtime": "7.6.2",
"#react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.9.0",
"eslint": "6.5.1",
"jest": "24.9.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
These are the libraries I used in my code

How to run react-native using application on Android (using CRNA)

I have this a simple app which was created using CRNA which runs fine on iOS but fails on Android.
It seems to be related to the missing JSC on Android OS. I added the "android-jsc" (https://github.com/facebook/android-jsc) dep to the project but nothing changed. What am I missing?
Here is my package.json
{
"name": "app",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-plugin-module-resolver": "^2.7.1",
"eslint": "^4.10.0",
"eslint-plugin-react": "^7.4.0",
"jest-expo": "^28.0.0",
"jest-immutable-matchers": "^2.0.1",
"react-native-scripts": "1.14.0",
"react-test-renderer": "16.4.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "REACT_NATIVE_ENV=development react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "REACT_NATIVE_ENV=test node node_modules/jest/bin/jest.js --watch",
"test_ci": "REACT_NATIVE_ENV=test node node_modules/jest/bin/jest.js"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"jsc-android": "224109.x.x",
"expo": "^29.0.0",
"immutable": "^3.8.2",
"momentjs": "^2.0.0",
"prop-types": "^15.6.1",
"react": "16.3.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
"react-native-elements": "1.0.0-beta5",
"react-native-keyboard-aware-scroll-view": "^0.4.1",
"react-native-modal-datetime-picker": "^6.0.0",
"react-native-side-menu": "^1.1.3",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "2.0.4",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-immutablejs": "^0.0.8",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"sentry-expo": "^1.9.0",
"validate": "^4.4.1"
}
}
jsc-android needs manual linking, and isn't compatible with Expo. See if all your dependencies are compatible with Expo. If not, you'll either have to detach to ExpoKit, or look for a compatible substitute.
Edit: Upon inspection, you are installing react-native-vector-icons directly. It needs manual linking, but is included on Expo. Check here for the instructions.

how to import the eth-lightwallet package to the react-native project?

First, I created a project: react-native init project, and
when I try to import * as lightwallet from 'eth-lightwallet' in my react-native project, I get an error see this image
Found a solution at github, but this did not solve the problem for me.
My package.json:
{
"name": "androidWallet",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"asn1": "^0.2.3",
"buffer": "^5.2.0",
"eth-lightwallet": "^3.0.1",
"history": "^4.7.2",
"native-base": "^2.7.2",
"node-libs-browser": "^2.1.0",
"node-libs-react-native": "^1.0.2",
"react": "16.4.1",
"react-native": "0.55.2",
"react-native-table-component": "^1.1.8",
"react-navigation": "^2.9.3",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-router-redux": "^4.0.8",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"web3": "^0.20.6"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-jest": "23.4.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react-native": "4",
"jest": "23.4.2",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native"
}
}
The problem is that the eth-lightwallet depends on node core modules that isn't supported by React Native out of the box. The current workaround involves using
rn-nodeify in order to provide shims for React Native to use instead. See this issue for react native and see this open issue from eth-lightwallet.

Categories

Resources