react-native-android

react native navigator:Undefined is not an object(evaluating this.props.navigation.navigate)

主宰稳场 提交于 2019-12-24 02:27:09
问题 I'm not able to understand how to implement navigation in react-native. as per the doc i have installed the plugin and integrated the code but it keeps giving the error Undefined is not an object(evaluating this.props.navigation.navigate) Below is the index.android.js /** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; import Login from './src/pages

react-native button not visible

帅比萌擦擦* 提交于 2019-12-24 01:08:21
问题 I'm trying to make a simple login screen where i have 2 TextInputs and a button inside a view. The TextInputs are visible,but the button is not visible when i keep it inside the view Below is the code for the login screen import React, { Component } from 'react'; import { StyleSheet, Text, View, Image, TextInput, Alert, Button } from 'react-native'; export default class Login extends Component { constructor(props) { super(props); this.state = {}; } onButtonPress= () => { Alert.alert('Button

APK build with ReactNative Can't be Replaced with APK build with Android Studio

与世无争的帅哥 提交于 2019-12-23 23:23:32
问题 I have an apk released in playstore which is built using React-Native. Now, I wanted to build the same project using the Android Studio. The package name and app id is same, the keystore is also same. But, whenever I try to install a newer apk (built with Android Studio) over the old apk(built with React-Native) it says apk is not installed. Is there someone faced the same same problem? Or, may some one can help me there? Thanks a lot in advance. 回答1: if the package is same then this happens

How to detect OnResume and onPause on react native Es6

大城市里の小女人 提交于 2019-12-23 23:14:15
问题 How can I detect any method from background to foreground es6? Is this possible in React-native? and is there any class or tool that could help with this type of method? 回答1: Try this, it working for me import React, {Component} from 'react' import {AppState, Text} from 'react-native' class AppStateExample extends Component { state = { appState: AppState.currentState } componentDidMount() { AppState.addEventListener('change', this._handleAppStateChange); } componentWillUnmount() { AppState

Get recently clicked image from camera on image view in react-native

拥有回忆 提交于 2019-12-23 15:33:51
问题 I am implementing camera in my react native application. I want to show the recently captured image from that camera in a small image view on the same screen after click. But I am not getting how do I access the recently clicked image. Whenever any new image is clicked through phone it has been given a default random name, how do I refer it in image view's source?Please suggest me some way to do that. My code is class Incident extends Component { constructor(props) { super(props) this.state=

react-native run-android and react-native start

霸气de小男生 提交于 2019-12-23 15:12:47
问题 Do I have to run react-native run-android and react-native start in my command prompt every time time I reopen my project and emulator? -- Thanks 回答1: You usually do. The react-native run-android command might be optional if you do not want to deploy the android native code again (for instance, if you have not made any changes). You will have to launch the application manually and it will try to connect to the packager that starts with react-native start . I am not sure if you can bundle the

sync data with remote db when using asyncStorage

北城以北 提交于 2019-12-23 12:35:55
问题 I've just started using react-native and thinking of using it for an offline-first application. I will be using asyncStorage as my local storage as it tends to meet all my needs for this app. However, I've had a fruitless search looking for something like native android's Sync Adapter which allows you to automate data transfer from your local storage to a remote DB based on a variety of criteria. Is there any library I can easily import into my RN project to help with data synchronization. Or

react-native run-android failed with error: Execution failed for task ':app:dexDebug'

橙三吉。 提交于 2019-12-23 09:59:55
问题 I'm using windows 8.1. with react-native-cli: 1.0.0 and react-native: 0.31.0 After adding react-native-maps to the project, I ran command react-native upgrade and given Y to all questions. Then linked deps with rnpm link as well as come changes to MainApplication.java file too. Here are changes to MainApplication.java : // Other imports ... import com.airbnb.android.react.maps.MapsPackage; public class MainApplication extends Application implements ReactApplication { private final

Got JS Exception: ReferenceError: Can't find variable: process

你离开我真会死。 提交于 2019-12-23 09:49:49
问题 After upgrading from react-native 0.26 to 0.29 (and running react-native upgrade), I'm getting the following error in the android debugger: Got JS Exception: ReferenceError: Can't find variable: process And this error message in the android emulator java.lang.RunTimeException: ReferenceError: can't find variable process (http://10.0.2.2:8081/index.android.bundle (...) I haven't changed any of my app javascript since upgrading, and everything ran without errors before so I'm assuming the

Image sizes for android and iOS in react-native

安稳与你 提交于 2019-12-23 07:57:28
问题 While making iOS Apps, we generally used to supply @x,@2x,@3x images. And based on my knowledge in case of android, there was some approx six different sizes I have started working on react-native and came across the image issue. My Question are: Do I need to provide images with all different sizes (i.e. approx 6-7 image sets by combining iOS and android) Or only 1 image and rest will be taken care internally? Will it look blurred on higher resolution phones? Thanks. 回答1: You still need to