Questions tagged [react-native-android]

1

votes
2

answer
2.2k

Views

React Native font scale

I have problem with scaling font inside of View or better to say inside of Text component in React Native for Android. The problem is, I want to text inside of Text component automatically scale depends on length of string (if text can fit inside View with desired font size do nothing and if it's st...
Newie
1

votes
1

answer
1.6k

Views

Module 'react' does not exist in the Haste module map

I am trying to do LinkedIn integration in my app. So, I have done as below : Installed dependency as below : npm install react-native-linkedin --save; So, while launching the app, am getting below error : Failed to load bundle(http://localhost:8081/index.bundle? platform=ios&dev=true&minify=false...
Vishal Zaptech
1

votes
3

answer
42

Views

How do i Validations using Switch case or other way for less code in React native?

Is it possible to use Switch case for validation in React Native? Please give me Right way.Below is my code handleSubmit=()=>{ this.setState({ isLoading : true}); emailValid = /^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i; mobileValid = /^[0]?[789]\d{9}$/; if(this.state.first_name == ''){ this.setState({ i...
Chitra Nandpal
1

votes
3

answer
37

Views

What is the equivalent of Java singleton in React Native?

Actually I am a Android Native Developer. I am new to React-Native. In Java i keep the users data and others data in Singleton Class and access from other activities. Then how i achieve this process in React native for access data's from other components or any alternative of singleton in React nati...
Sabish.M
1

votes
1

answer
298

Views

how to reset firebase auth password in react native

I want to know how to reset password of firebase email authentication password in my react-native project . I like to sent an email for resetting the password. How to do that using the following method firebase.auth().sendPasswordResetEmail
1

votes
1

answer
49

Views

How do I request permissions during installation / before app starts for a React Native app?

I would like for the user to grant permissions during installation /before the app begins, rather than being prompted while the app is running. Currently, I'm requesting Coarse Location and Microphone access on the Android version of my app and BLE and Microphone access on the IOS version of the ap...
VK1
1

votes
2

answer
543

Views

Performance : How to fix a custom checkbox component in a huge Flatlist in react native

I have used Flatlist component of react-native to render a huge list of checkboxes These checkboxes (written in pure JS) essentially are mimicking the behaviour of checkboxes, everything works fine , but the performance of this is extremely slow. What Can I do to improve the performance of this ? t...
Harshwardhan
1

votes
0

answer
112

Views

React native NoClassDefFoundError: versioned.host.exp.exponent.modules.api.components.admob.RNPublisherBannerViewManager

I have a problem related with react native app android build. Application was created using expo and exported in order to implement firebase notifications. After running the app crashes and give this exception: java.lang.NoClassDefFoundError: versioned.host.exp.exponent.modules.api.components.admob....
Iura Gaitur
1

votes
1

answer
1k

Views

React Native Tab Navigator - Swipe Event

I am working with React Native Tab Navigator.I am able to listen Tab Press events , using below code snippet. But is there any way to get Tab Swipe Events? SecondComponent: { screen: UserDetails, navigationOptions: ({ navigation, navigationOptions }) => ({ tabBarOnPress: (previousScreen, jumpToIndex...
Don Chakkappan
1

votes
1

answer
300

Views

Exception calling object as function in AppRegistry.runApplication

I have some error in my React native android app, especially in startup code. import React from 'react'; import { AppRegistry } from 'react-native'; import { Provider } from 'react-redux'; import codePush from 'react-native-code-push'; import App from './src/App'; import store from './src/store/stor...
vijayst
1

votes
0

answer
238

Views

How should I use Realm in React-Native?

I've seen a lot of examples of the implementation of realm inside React-Native world but every time I see them I see they export from a root file the instance of the realm database, example: realmIndex.js > export new Realm(...configuration) I was doing that inside one of my projects until I got an...
Jose Gomez
1

votes
3

answer
2.3k

Views

Debugging React Native App on Android Device. No 'Debug JS Remotely' option

I have my React Native application running on my Android Device with USB debugging, after running adb -d reverse tcp:8081 tcp:8081 and react-native run-android in my project. In the Chrome developer tools, my device is listed in remote devices. According to many blogs and the docs themselves (https...
user3928868
1

votes
0

answer
339

Views

ScreenVisibilityListener in react-native-navigation

I am using the code below to register to know the changes of the screens. Problem when I use SharedElementTransition. to push on a screen. It does not fire the event that was logged. Has anyone ever experienced this? version: react-native-cli: 2.0.1 react-native: 0.47.1 react-native-navigation:1.1.2...
Bruno Alves
1

votes
0

answer
261

Views

How to wrap an OpenCart web app in mobile app?

First of all, I hope the question is not too much general. I want to wrap my existing website which is done by OpenCart 3 in mobile app. After googling a lot and checking many websites and articles, the only practical instruction what I found is doing this using PhoneGap. The instruction is title...
Kardo
1

votes
0

answer
100

Views

React Native fails to run when built from Android Studio: ( Module AppRegistry is not a registered callabble module (calling runApplication) )

I am experiencing a strange situation with my React Native project and Android Studio. BUILDING DEBUG Using the react-native command line tools, I can build and run my Android app without any problem. (using react-native run-android) However when I try and build my debug app from Android studio, i g...
Simon
1

votes
0

answer
139

Views

React-Native: Content Compression Resistance Priority

I feel like I've reached the end of what's possible with React Native's flex layout and before I waste more hours trying to figure it out myself, I figured maybe you have an idea. This is what I want to do, what is super easy with iOS using Content Compression Resistance Priority: You can see the fo...
Florian
1

votes
1

answer
230

Views

How can i show Swipe-out show right default button in react native

developing sample application. How can i show the swipe-out based in right side default button using react-native. Actually i am getting like this below image: But i want getting like this when list is Open:
Lavaraju
1

votes
0

answer
334

Views

React-Native-Camera can't compile to android emulator

I am busy trying to implement camera functionality into an app I am writing in react-native. I have installed react-native-camera via npm and have this working solidly in IOS. When I try and run on android, the project does not build and throws below error node_modules/react-native-camera/android/s...
SashaStojanovic
1

votes
1

answer
615

Views

How can I take a screenshot (View) with a TouchableHighlight?

The Error has been resolved as per your guidelines. But still can not take and save the screeshot of the desired ViewShot, where it has a react image. I need to take and save the screeshot in the memory of my device. Can you tell me if I'm on the right track or would I have another way to do it? Tha...
Dagson Patrick
1

votes
1

answer
526

Views

React-native Android Emulator needs to turn on debugger mode

Why I need to turn Debugger mode on for react-native app when I do run it in Android emulator in React-Native App ?
Tawseef Bhat
1

votes
0

answer
275

Views

How to understand event callbacks from Android in React Native

I want to send some event with additional data from my Android module to JS part. I read https://facebook.github.io/react-native/docs/native-components-android.html#events but the proposed code did not work for me, dont know why. Then I read this SO post Creating Custom UI component for android on R...
Billda
1

votes
0

answer
1k

Views

react-native-navigation Tab Bar Icon from Android Drawables and iOS xcassets

I am using react-native-navigation as a preferred navigation approach in our react-native application. We are planning on using the hybrid approach for icons where we still add icons in xcassets and drawables. I am seeing a specific issue with icons for tab-bar on android when loading them from dra...
Bhavik Bhagat
1

votes
0

answer
296

Views

React-native make an application open webview with url push from notification firebase use react-native-fcm

I want make an application use react-native-fcm https://github.com/evollu/react-native-fcm Step 1: Push notification from google firebase with message is an url Step 2: Click on the notification -> Open URL by Webview Please help me!
Le Van Phuong
1

votes
1

answer
73

Views

Error: invalid hash key after one successful login with facebook

I am trying to do login with facebook in my app and want profile data. For that I want to generate key programatically but it gives me error. I done all other things as given here but all these things are not working for me and the code through which I want to generate key which gives me error. I ca...
mayuresh patil
1

votes
1

answer
416

Views

React Native - How to save map using AsyncStorage

I try to save user inputs as a JS map using AsyncStorage in my React Native app. It shows no errors when saving, but I got '[object Map]' when I tried to get the data back. There is the simplified version of my user map. the actual User object has way more properties than this, but the ID is always...
1

votes
0

answer
54

Views

Does all the Android apps have notification enabled by default

I’m looking out for a solution in React native to check if notifications is enabled for Android. If not, enable them. I found out a library (React-native-android-permission-library) which works great. But my question here is I find that notification is enabled by default in our app without specify...
Brad
1

votes
0

answer
39

Views

java.lang.ClassCastException: fi.rogerstudio.possis.MainApplication cannot be cast to com.facebook.react.ReactApplication

I am getting this error when receiving push notification only when the app is open, foreground mode! Does anyone had this issue before using the Firebase push notification and react-native-fcm? COde: showLocalNotification(notif) { FCM.presentLocalNotification({ title: notif.title, body: notif.body,...
Mizlul
1

votes
0

answer
618

Views

React Native Android app crash when receiving push notification on foreground

App is working perfectly fine when receiving push notifications on background, but it crashes when in foregrond. I am using RN 0.49 and react-native-fcm 11.3.1 package. My code looks as below: FCM.on(FCMEvent.Notification, async (notif) => { // there are two parts of notif. notif.notification contai...
Mizlul
1

votes
1

answer
1.1k

Views

Execution failed for task ':app:compileDebugJavaWithJavac' in Window Setup for react-native run-android

enter image description here Not able to get pass this error. Checked my JAVA_HOME path and ANDROID_HOME path. Still not able to figure it out. I checked other solutions but of no help till now.
Vikas Chauhan
1

votes
1

answer
922

Views

How to play mov videos from react native app in android?

I have tried multiple modules for playing mov videos from react native app in android. But none worked. Any idea? react-native-video-player (error can't play this video) react-native-media-player (java error) react-native-android-video-player (java error) react-native-video (not playing mov) react-s...
Harikrishnan
1

votes
0

answer
45

Views

How to handling asynchronous in Service to execute task synchronous in Android?

My Question is not duplicated as this question! my case is about AsyncTask not just about Runnable, and even so, I've 2 AsyncTask inside runnable that needed to handling! I'm new in Android, I've an app created by React Native. but the problem is I want to upload any data (image [jpg] & video [mp4])...
flix
1

votes
0

answer
904

Views

Mocking default exported function with Jest says it wasn't called but it was

[EDIT - POSSIBLE SOLUTION] So I realised that my componentWillMount is an async method since it is using an async fs wrapper to do fs operations. So I made the beforeEach function argument async and awaited on the Enzyme.shallow. This seems to have worked. It just came to me that if it's async maybe...
Andreas Andreou
1

votes
3

answer
1.5k

Views

FontFamily not working in Android Device in React-Native

I have added many font-family and style into my asset folder in React-Native project. It's working fine in simulator, emulator, and iOS device. But some font won't work and not display in Android device. I have try with react-native link and check the asset folder in Android app directory, nothing m...
Seyha
1

votes
0

answer
141

Views

Memory leak when opening Chrome from react native app on Android

This happens only on Android 7.1 in our tests when opening a link using Chrome, intermittently. It seems to be some sort of memory leak that leads to our app beeing stopped, how can we prevent this. We are not seeing it on iOS, and not on any other of our testingphones for android or in the emulator...
The Kaizer
1

votes
0

answer
411

Views

Android Status bar overlapping on my screen

There are some topics that I came by discussing the same issue but they were platform specific. For example, for iOS it was suggested to add padding to the top of the screen component or add an empty view with a height equals that padding. So what happens is that we do a simple check on the platform...
Ahmed Samy
1

votes
0

answer
205

Views

ViewPager with fragments doesn't draw pages after initial drawing (2) - bridge to react-native

I am using react-native and for layout purposes, unfortunately, I am forced to bridge to some native android code. The problem I am facing is that the ViewPager only displays the first 2 pages (fragments). If I swipe to the third, it's empty. If I go back to the first it's not there anymore and fina...
Tomer
1

votes
0

answer
137

Views

React Native - React-native link error while linking instabug-reactnative

Here's the packge I am using for bug reporting (I am following the install instructions from here). But when I run react-native link instabug-reactnative it gives me the following error. I followed some forums but none seemed to help. I guess the error is regarding ruby installation. Any idea What'...
Shivam
1

votes
2

answer
429

Views

How to add in-app browsing in React Native

I am creating an app where the JSON response contains an URL for the user. If they click on it the browser should display the contents. I used Linking but it redirects me to external browser. Is there a way we can do it within the app ?
Pradeep
1

votes
2

answer
443

Views

React Native: How to make modular components using local image and data assets?

create-react-native-app v1.0.0 react-native-cli 2.0.1 react-native 0.52.0 Android API 25 I have several JSON files in ./src/data (aliased as data) and images in ./src/assets/images (aliased as images). I am making a list of images that are filterable and sortable based on the corresponding data. Add...
Steven H
1

votes
0

answer
1.5k

Views

You attempted to use a firebase module that's not installed on your android project by calling firebase.storage()

Im trying to use firebase storage on React Native using the react-native-firebase module and when y call firebase storage I get this error: You attempted to use a firebase module that's not installed on your android project by calling firebase.storage()2IM.png I have add all the necessary dependanci...

View additional questions