react-native-android

How to implement Headless JS in react native android application?

对着背影说爱祢 提交于 2019-11-29 20:26:52
问题 I need implement Headless JS in my React Native Android Application, but I got following issue : Here is My Code : index.android.js : import React, { Component } from 'react'; import {AppRegistry} from 'react-native'; import SomeTaskName from './SomeTaskName' AppRegistry.registerComponent('SomeTaskName', () => SomeTaskName); SomeTaskName.js module.exports = async (taskData) => { alert('test'); } MyTaskService.java import android.content.Intent; import android.os.Bundle; import com.facebook

React native: Android project not found. Maybe run react-native android first?

假装没事ソ 提交于 2019-11-29 19:55:50
I had an issue in my React-Native project which was working fine earlier but suddenly it stopped working. Whenever I used the command: react-native run-android I was getting an error : Android project not found. Maybe run react-native android first? I tried running: react-native android But it said: Unrecognized command 'android' Run react-native --help to see list of all available commands After trying: D:\ProjectRoot\ReactNativeProjects\AwesomeProject>react-native eject The error returned was: Scanning folders for symlinks in D:\ProjectRoot\ReactNativeProjects\AwesomeProject\node_modules

can't create project using react-native init

强颜欢笑 提交于 2019-11-29 16:56:40
I am getting this error again and again when creating a new project using react-native init. I reinstalled react-native cli and tried again but no luck. Can someone please tell me is there anything I can do? I have following versions installed react-native-cli: 2.0.1 react-native: 0.56.0 node: 10.6.0 npm: 6.1.0 This error is may be because of react native version React native 0.56 Here is the link about the discussion of this issue React native 0.56.* - "Unexpected identifier" So they suggest us to downgrade the version of react-native React Native Version List So open the file of your project

Android Studio building errors using react native app

喜你入骨 提交于 2019-11-29 11:20:22
I have been trying to create an app using react native using expo tools xde and then detach it using exp detach, when I open in Android Studio I get quite many error when building like: Using incompatible plugins for the annotation processing Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android

com.android.builder.testing.api.DeviceException: No connected devices

落花浮王杯 提交于 2019-11-29 07:08:42
Scanning folders for symlinks in /home/sino/Desktop/we-clone/node_modules (4ms) Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug)... Incremental java compilation is an incubating feature. :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE :app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE :app

Error when trying to use Button in react-native

南笙酒味 提交于 2019-11-29 07:01:45
When making a simple react-native program I cannot get the <Button> component to work. The error I always get after react-native run-android is java.lang.String cannot be cast to com.facebook.react.uimanager.AccessibilityDelegateUtil$AccessibilityRole When I omit the button, everything works fine, and I can click the Text just fine. code : import React, {Component} from 'react'; import {Platform, StyleSheet, Text, View, Button } from 'react-native'; type Props = {}; export default class App extends Component<Props> { render() { return ( <View style={styles.container}> <Button onPress={()=

React native Android ScrollView scrollTo not working

*爱你&永不变心* 提交于 2019-11-29 05:40:24
问题 I am trying to use a horizontal ScrollView in React Native for Android, where the starting position is in the middle of the scrolling images rather than (0,0). The scrollTo method seems to be called correctly inside componentDidMount but nothing moves in the application, it still shows as starting the scroll all the way to the left. Since this is Android I don't have access to contentOffset props or I would set that directly, according to the documentation. Here is the code: 'use strict'; var

Getting Android RecyclerView to update view inside React Native component

大城市里の小女人 提交于 2019-11-29 03:56:12
I am making a mobile application using React Native and included list components didn't have high enough performance for it so I started using Android's RecyclerView as the list component. There is a problem though with it. The RecyclerView doesn't update its contents views until I scroll or change RecyclerView's size. What could cause this problem and how I can fix it? I have tried notifyDatasetChanged, notifyItemChanged, forceLayout, invalidate, postInvalidate and many different variations with each. Try this one this.setIsRecyclable(true); It will referesh your views public class

React Native - Device back button handling

谁说我不能喝 提交于 2019-11-29 01:15:41
I want to check if there are more than one screens are on stack when device back button is hit. If yes, I want to show previous screen and if no, I want to exit app. I have checked number of examples but those use BackAndroid and Navigator. But both of them are deprecated. BackHandler is replacement for BackAndroid. And I can show previous screen by using props.navigation.goBack(null). But I am unable to find code for finding screen count in stack. I don't want to use deprecated Navigator! Virat18 This example will show you back navigation which is expected generally in most of the flows. You

Android Material and appcompat Manifest merger failed in react-native or ExpoKit

可紊 提交于 2019-11-29 00:58:55
I updated 'android.support:appcompat-v7' to 28.0.0 . But it brought an error from the build. Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:8:5-23:19 to override. Then I get this error in my Logcat: Manifest merger failed my app.gradle: