react-native-android

Packager not started after running “react-native run-android”

会有一股神秘感。 提交于 2019-12-06 09:20:19
I am new to React-Native. When I am following the official tutorial to deploy my app to Android, it show a red screen saying that "Could not connect to development server". I am running on a physical device so I tried adb reverse tcp:8081 tcp:8081 but the problem was not solved. I googled around and found that I have to run: react-native start So is it a must to keep a terminal opened and running react-native start ? Because this is not documented in official tutorials and I even don't know why it works! I had also recently faced this issue in Android for around 3 days. Luckily some random

How to Set background image of DrawerNavigator in React-Native?

江枫思渺然 提交于 2019-12-06 05:52:33
问题 I integrate DrawerNavigator in my project. its working fine, but there are no any property to set background image. How can I will add background image in DrawerNavigator. DrawerNavigator Code of DrawerNavigation import { AppRegistry , Dimensions} from 'react-native'; import Library from './ViewControllers/Library'; import Language from './ViewControllers/Language'; import AboutUS from './ViewControllers/AboutUS'; import Support from './ViewControllers/Support'; import { DrawerNavigator }

React native Airbnb Markers: Markers successfully disappear, but do not re-appear

余生颓废 提交于 2019-12-06 05:20:54
问题 I am currently building an app with react-native and am using the Airbnb maps plugin to dynamically display markers. My markers are downloaded from the firebase database successfully, and the array that is downloaded always shows the correct contents. I have the full code here just in case https://codepen.io/yeni/pen/Kqyrxv?editors=0010 :) Whenever I change the cur_user property of a marker to 1 , it is successfully not shown on the map. However, when I change cur_user back to 0 , the marker

React-native fbsdk build errors

耗尽温柔 提交于 2019-12-06 05:16:40
问题 I am getting the following errors while running the command react-native run-android or ./gradlew build :react-native-fbsdk:generateReleaseResValues UP-TO-DATE :react-native-fbsdk:generateReleaseResources :react-native-fbsdk:mergeReleaseResources :react-native-fbsdk:processReleaseManifest :react-native-fbsdk:processReleaseResources /Users/a/projects/gratisapp/node_modules/react-native-fbsdk/android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.3.1/res/values-v24/values

How to implement a React Native UI component method in Android

南笙酒味 提交于 2019-12-06 05:12:01
问题 It's clear to me that for react-native native modules we can use the @ReactMethod to export a method and call it from JSX, but how do we do the same thing in react-native native UI components? In the documentation I only see @ReactProp being mentioned. If @ReactMethod is not working, how do I access a property of my native UI component from JSX then? (On iOS this can be done on native ui components with RCT_EXPORT_METHOD but on Android is something similar possible?) Thank you. 回答1: Ok I

React-native dev options not showing up on mobile app installed on Xiaomi Phone

半世苍凉 提交于 2019-12-06 04:06:36
When I try installing react-native app on my redmi note 3 mobile phone, It pops up an error which doesn't happen when I use any other mobile phone. I fixed this issue by disabling MIUI optimization. But after I did this, I'm not getting dev options when I shake my mobile. Ok, for anyone that like me didn't know what to do. The first answer is correct, but I if you are wondering what to do, just like I did, do the following. Open Security (an app installed by default on Note 3 phone) Click on Permissions Find your app that you've installed using React-Native , click on it. There should be a a

Unable to resolve “fbjs/lib/areEqual” from “node_modules\\react-native-gesture-handler\\createHandler.js”

混江龙づ霸主 提交于 2019-12-06 03:29:14
I'm building a react-native application with expo, however, I have an error, therefore I'm unable to continue building the application. I even looked for the file in node_modules that is mentioned in the error message. I'm using the react-native-gesture-handler for my screen navigation. If I uninstalled the react-native-gesture-handler and I removed the navigation code would this solve my error? How do I resolve this? App.js import React, { Component } from 'react'; import { StackNavigator } from 'react-navigation'; import Plan from './screens/Plan'; import Home from './screens/Home'; const

React-Native: How to scale font size to support many different resolutions and screens in both Android and iOS?

北战南征 提交于 2019-12-06 03:24:16
问题 I have huge trouble trying to figure the correct font size on the many different screens that exist. Currently I have a helper function called getCorrectFontSizeForScreen . export function getCorrectFontSizeForScreen(currentFontSize){ const maxFontDifferFactor = 6; //the maximum pixels of font size we can go up or if(Platform.OS === 'ios'){ //iOS part let devRatio = PixelRatio.get(); this.fontFactor = (((screenWidth*devRatio)/320)*0.55+((screenHeight*devRatio)/640)*0.45) if(this.fontFactor<=1

React-Native Native Android Module - Toast Example

杀马特。学长 韩版系。学妹 提交于 2019-12-05 23:59:40
I'm trying to learn to work with android native module and using the toast example in the react-native docs. ( https://facebook.github.io/react-native/docs/native-modules-android ). However, I am facing an issue where the native module that I was trying to export was unable to be resolved/undefine. My directory structure is as followed: example -android -app -src -main - java -com -example -CustomToastPackage.java -ToastModule.java -MainActivity.java -MainApplication.java - res - AndroidManifest.xml -ios -app.js -index.js -package.json My index.js: import {AppRegistry} from 'react-native';

Sharing Realm instance between React Native and Android

淺唱寂寞╮ 提交于 2019-12-05 21:39:20
I'm working on a React Native project that uses Realm for React Native. It works without problems but now, I am faced with a problem of writing Android Service that would use the same Realm instance. Is it possible and how would I do that? I think you can communicate from Java to React Native through Native Modules and do your Realm-related code in Javascript as you normally would. Otherwise, Realm for Android's multi-process support for non-encrypted Realms will arrive in Realm-Java 2.0.0 (and that part is actually in with the snapshot), which will most definitely support this use-case; when