react-native-android

React Native: View onPress does not work

可紊 提交于 2019-12-02 14:47:48
I'm facing a weird problem. In my react native app, if I set onPress event to View it is not triggered but if I set the same to Text inside View , it fires. What am I missing here? <View style={{backgroundColor: "red", padding: 20}}> <Text onPress={()=> { console.log('works'); } }>X</Text> </View> <View style={{backgroundColor: "red", padding: 20}} onPress={()=> { console.log('does not work'); } }> <Text>X</Text> </View> Why is this so? Is this an issue with React Native? I'm using version 0.43 You can use TouchableOpacity for onPress event. View doesn't provide onPress prop. <TouchableOpacity

react-native-camera video capturing shows error on preview after it gets captured?

こ雲淡風輕ζ 提交于 2019-12-02 12:51:23
I am using react-native-camera for video capture. I am building something kind of snapchat stories where moment you capture video next to that it takes you to the preview screen of video where you can edit. On press of start button while videoCapturing screen it returns path of the video but on press of stop button it returns an error at the same time making video to get stored to my device storgae. I have posted both videocapturing screen as well error I am getting on press of stop button.Attached code for the VideoCapture screen. /** * Sample React Native App * https://github.com/facebook

Problem when use dynamic value with image component react native

南笙酒味 提交于 2019-12-02 10:19:46
I get data from DB and put it into source image, it will be error, but if i put only string it will run ok Run ok: <Image source={require('./src/image/honda-accord.png')} /> Run fail: <Image source={require("./src/image/" + carOfPerson[0]["cars"][i]["picture"] + "")} /> Value of carOfPerson[0]["cars"][i]["picture"] is honda-accord.png Image error was taked screen snapshot in android emulator: And console log in log cat: Body: {"type":"TransformError","lineNumber":0,"errors":[{"description":"App.js: App.js:Invalid call at line 130: require(\"./src/image/\" + carOfPerson[0][\"cars\"][i][\

React-Native “Could no connect to development server” in createReactContext()

£可爱£侵袭症+ 提交于 2019-12-02 09:43:35
My Android react-native app is crashing with an ExecutionException . "Could not connect to development server." The method that is crashing is ReactInstanceManagerImpl.createReactContext() . But this is not the normal error as this screenshot shows: Logcat shows me this stacktrace: Exception in native call from JS java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Could not connect to development server. at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:860) at com.facebook.react

React Native Navigation Passing back parameters two screen pop

左心房为你撑大大i 提交于 2019-12-02 08:57:11
I have a Screen for Main then it's push to Next for selection and passes parameters to next pushed screen and when you select something in that screen I need to pop(2) and send selected details to the main screen. But pop didn't accept parameters. How to accomplish this. I don't use Redux or MobX. You need to do this Screen A: this.props.navigation.navigate('ScreenB', { onPressScreenAFun: (params) => { this.screenAFun(params) }, }) screenAFun = (params) => { console.log(params) } Screen B: this.props.navigation.navigate('ScreenC', { onPressScreenBFun: (params) => { this.screenBFun(params) }, }

Can only update react native on emulator, not physical device

老子叫甜甜 提交于 2019-12-02 05:44:50
问题 I have an app working on a local emulator that is updating live and doing all the things it should be doing. I also have a physical device connected via USB, and deploying to the device through 'run-android' works successfully, so the bridge is working. However, the app only shows the default react native welcome screen. Any attempt to update the app results in "Could not connect to development server". I have tried the suggestions on the screen and they aren't helping. Where do I go next?

Not able to find Image in cache using npm react-native-view-shot

耗尽温柔 提交于 2019-12-02 04:47:44
问题 I am using npm react-native-view-shot to capture the view in the image and save locally on the device. When I try to take snap-shot using the following code I get path but not image at the location, below is code and output Path:- file:///data/user/0/com.caryn/cache/ReactNative-snapshot-image5936120548912611616.jpg captureRef(this.ref, this.state.value) .then(res => this.state.value.result !== "file" ? res : new Promise((success, failure) => // just a test to ensure res can be used in Image

Compressing base64 encoded images in React-Native on Android does not recognise 'data' protocol

二次信任 提交于 2019-12-02 01:37:28
问题 Issue Within a React-Native (0.43) application we are using a component that uses a SectionList to render photos sorted by day. Each section can contain multiple images. Photos are taken using the react-native-image-crop-picker library and uploaded to the backend, or queued locally if no internet connection is available, encoded in base64 format. The image resolution is set to 800x800 pixels (requirement for other purposes of the images). On phones with lower memory, rendering ~20 images will

React Navigation Preventing Going back to loading screen, reset not working

[亡魂溺海] 提交于 2019-12-02 00:52:53
I have a React Native application which I have implemented. Currently the app opens up on a loading screen which after mounting checks the firebase.auth().onAuthStateChanged(...) feature. The app basically decides whether or not to got to the login screen or to main screen depending on whether or not the user is already authenticated. It is implemented like this: Main Navigator: const MainNavigator = TabNavigator({ auth: { screen: TabNavigator({ login: { screen: LoginScreen }, signup: { screen: SignupScreen } }, { initialRouteName: 'login', tabBarPosition: 'top', lazy: true, animationEnabled:

Compressing base64 encoded images in React-Native on Android does not recognise 'data' protocol

怎甘沉沦 提交于 2019-12-01 23:56:36
Issue Within a React-Native (0.43) application we are using a component that uses a SectionList to render photos sorted by day. Each section can contain multiple images. Photos are taken using the react-native-image-crop-picker library and uploaded to the backend, or queued locally if no internet connection is available, encoded in base64 format. The image resolution is set to 800x800 pixels (requirement for other purposes of the images). On phones with lower memory, rendering ~20 images will crash the app due to insufficient memory. This issue can only be reproduced on low-end Android phones