react native released apk crush on launch - android

i get no errors when i compile the APK in release but after i install it it crashes instant on load. Here are my packages:
{
"name": "etwow_rent",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#babel/runtime": "^7.1.2",
"bundle": "^2.1.0",
"haversine": "^1.1.0",
"react": "16.5.0",
"react-native": "^0.57.1",
"react-native-camera": "^1.3.0",
"react-native-maps": "^0.22.0",
"react-native-qrcode-scanner": "^1.1.0",
"react-navigation": "^2.18.0"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.48.0",
"react-native-bundle": "0.0.4",
"react-test-renderer": "16.5.0"
},
"jest": {
"preset": "react-native"
}
}

maybe you forgot one of the steps for generating Signed APK ,Here is full Documentation of Generating Signed APK https://facebook.github.io/react-native/docs/signed-apk-android
You can go through it.

Related

Cannot read property 'transformFile' of undefined exception vue-native

I just wanted to try vue-native. However I get this error.
bundling failed: TypeError: Cannot read property 'transformFile' of undefined
Here is my package.json file
{
"name": "vueNativeDeneme",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.10",
"vue-native-core": "^0.1.4",
"vue-native-helper": "^0.1.4"
},
"devDependencies": {
"#babel/core": "7.6.4",
"#babel/runtime": "7.6.3",
"babel-jest": "24.9.0",
"jest": "24.9.0",
"metro-react-native-babel-preset": "0.56.3",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
How can I fix this?
Change your devDependencies:
"devDependencies":{
"#babel/core": "^7.0.0",
"#babel/preset-env": "^2.0.0-alpha.20",
"babel-preset-expo": "~8.0.0",
"vue-native-scripts": "0.0.16"
},
Problem solved.

Revision not found in React-Native,Android

I'm trying to debug my app on my android phone. When i first build my app with:
sudo react-native run-android
It builds perfectly, but when I changed my code and saved, it doesn't reload and I need to build over and over again with every change. HMR is active, and tried to press 'Reload' on my Dev Menu, but it doesn't reload. Here is extra information:
using Visual Studio Code.
Android version of my phone: 6.0.1
Connection:Via USB.
USB Debugging:Enabled and Allowed to this computer.
using Linux.
.babelrc
{
"presets": ["module:metro-react-native-babel-preset"],
"plugins": ["#babel/proposal-class-properties"]
}
package.json
{
"name": "hiworld",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"global": "^4.3.2",
"react": "16.6.1",
"react-native": "0.57.7"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^10.0.1",
"babel-jest": "23.6.0",
"babel-preset-flow": "^6.23.0",
"eslint": "^5.9.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-standard": "^4.0.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.50.0",
"react-test-renderer": "16.6.1"
},
"jest": {
"preset": "react-native"
},
"main": "index.js",
"author": "",
"license": "ISC",
"description": ""
}
if you need anything else, i'll edit this post.

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.

React Native: Unfortunately, Application has stopped

My app worked properly !
When run android
The application is compiled without error, but returns the message when it's displayed.
Unfortunately, application has stopped
It happened when i install and link these two packages
react-native-push-notification AND react-native-google-analytics-bridge
{
"rnpm": {
"assets": [
"./assets/fonts/"
]
},
"name": "Melkana",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#ptomasroos/react-native-multi-slider": "0.0.14",
"expo": "^28.0.0",
"expo-analytics": "^1.0.7",
"lodash": "^4.17.10",
"react": "16.3.1",
"react-native": "0.55.3",
"react-native-check-box": "^2.1.0",
"react-native-elements": "^0.19.1",
"react-native-google-places-autocomplete": "^1.3.6",
"react-native-map-clustering": "^1.3.0",
"react-native-maps": "*",
"react-native-modal-picker": "0.0.16",
"react-native-simple-radio-button": "^2.7.2",
"react-native-ui-kitten": "^3.0.1",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.0.2",
"rn-sliding-up-panel": "^1.2.1"
},
"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"
}
}
When run this in Android Studio look this logged errors at Logcat
E/AndroidRuntime: FATAL EXCEPTION: Thread-1480
Process: com.melkana, PID: 11733 java.lang.NoSuchMethodError: No static method loadLibrary(Ljava/lang/String;)V in class Lcom/facebook/soloader/SoLoader; or its super classes (declaration of 'com.facebook.soloader.SoLoader' appears in /data/app/com.melkana-2/base.apk)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:18)
at com.facebook.react.bridge.NativeMap.(NativeMap.java:19)
at com.facebook.react.bridge.JSCJavaScriptExecutorFactory.create (JSCJavaScriptExecutorFactory.java:21)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:912)
at java.lang.Thread.run(Thread.java:818)
Solution:
In the app/build.gradle
implementation 'com.facebook.fresco:fresco:1.9.0'
implementation 'com.facebook.fresco:animated-gif:1.9.0'
// IN CASE YOU NEED WEBP SUPPORT / MAKE SURE TO CHANGE THIS TOO TO 1.9.0
implementation 'com.facebook.fresco:animated-webp:1.9.0'
implementation 'com.facebook.fresco:webpsupport:1.9.0'
https://github.com/facebook/react-native/issues/20252

is it possible to create a production build with react-native-mapbox-gl?

I have a location based app built with react-native and the react-native-mapbox-gl package (MapBox Maps SDK for React Native). The app runs on both Android and IOS devices with the commands react-native run-android and react-native run-ios respectively.
When i build a production release, the .ipa and .apk files are created successfully, but they fail to install on the devices
(without any specific error messages).
Is there some extra work that i need to do for building a production release with react-native-mapbox-gl?
this is my package.json
{
"name": "MyAppName",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#mapbox/react-native-mapbox-gl": "^6.1.1",
"babel-eslint": "^6.1.2",
"eslint": "^3.7.1",
"eslint-config-airbnb": "^12.0.0",
"eslint-plugin-import": "^1.16.0",
"eslint-plugin-jsx-a11y": "^2.2.2",
"eslint-plugin-react": "^6.3.0",
"geolib": "^2.0.24",
"mobx": "^3.1.9",
"mobx-react": "^4.1.8",
"prop-types": "^15.6.1",
"react": "16.3.1",
"react-native": "^0.54.4",
"react-native-animatable": "^1.2.4",
"react-native-keyboard-aware-scroll-view": "^0.4.4",
"react-native-modal": "^5.0.0",
"react-native-simple-toast": "0.0.8",
"react-navigation": "^1.5.2",
"tcomb-form-native": "^0.6.11"
},
"devDependencies": {
"babel-jest": "22.2.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-react-native": "4.0.0",
"jest": "22.2.0",
"react-test-renderer": "16.2.0"
},
"jest": {
"preset": "react-native"
},
"rnpm": {
"assets": [
"./src/assets/fonts/"
]
}
}

Categories

Resources