Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all 29702 articles
Browse latest View live

React-native android build failed with an exception

$
0
0

I followed every single step in the react native documentation to set up a project with create-react-native.

react-native init MobileProject cd MobileProject && react-native run-android

However, it seems like the build won't fetch resources online. I tried to change proxy, swapped repositories in build.gradle but nothing seems to work. Any help would be greatly appreciated!


How to use Android native component like Broadcast receiver in react native application?

$
0
0

How to use android native component like Broadcast receiver in react native application? I am trying to use android native component like broadcast receiver or service in react-native application?

How do I debug React Native native module in android studio?

$
0
0

Looking for an answer I came across this post: https://stackoverflow.com/a/38007808
However I don't know how to...

launch the React Native packager beforehand

as Jean Regisser suggest to do before in order to start debugging.

This is what I tried so far:

  1. Go to android studio and press play button
  2. Run react-native start and press play button fromm android studio
  3. Run gradlew clean --> react-native start --> press play

Nothing works. Help!

React-Native Animated lags behind in low end Android phones

$
0
0

I am trying to implement an animation that is supposed to be run on iOS and Android devices.

In iOS the performance seems satisfactory (tested with iPhone 6 Plus and up).

On the other hand for some Android devices the animations lag behind.

The question is, what kind of actions can be taken to avoid the performance problem (apart from the usage of useNativeDriver={true} directive, which is already in the code)?

The code is like that:

import * as React from 'react';
import {
  Animated,
  ImageBackground,
  StyleSheet,
  Image,
  Easing,
  TextInput,
  View,
  Text,
} from 'react-native';
import { PanGestureHandler, State } from 'react-native-gesture-handler';
import backImg from './background.png';

const c_initial_coordinate_left = 100;
const c_initial_coordinate_top = 100;

export default class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {};
    this.spaceAnimatedTranslations = new Animated.ValueXY();
    this.spaceAnimatedTranslations2 = new Animated.ValueXY();
    this.spaceAnimatedTranslations3 = new Animated.ValueXY();
    this.spaceAnimatedTranslations4 = new Animated.ValueXY();
    this.spaceAnimatedTranslations5 = new Animated.ValueXY();
    this.spaceAnimatedTranslations.addListener(value => (this.spaceAnimatedTranslations_value = value));
    this.spaceAnimatedTranslations2.addListener(value => (this.spaceAnimatedTranslations_value2 = value));
    this.spaceAnimatedTranslations3.addListener(value => (this.spaceAnimatedTranslations_value3 = value));
    this.spaceAnimatedTranslations4.addListener(value => (this.spaceAnimatedTranslations_value4 = value));
    this.spaceAnimatedTranslations5.addListener(value => (this.spaceAnimatedTranslations_value5 = value));
    this._animatedStyle = {transform: [{ translateX: this.spaceAnimatedTranslations.x }, { translateY: this.spaceAnimatedTranslations.y },],};
    this._animatedStyle2 = {transform: [{ translateX: this.spaceAnimatedTranslations2.x }, { translateY: this.spaceAnimatedTranslations2.y },],};
    this._animatedStyle3 = {transform: [{ translateX: this.spaceAnimatedTranslations3.x }, { translateY: this.spaceAnimatedTranslations3.y },],};
    this._animatedStyle4 = {transform: [{ translateX: this.spaceAnimatedTranslations4.x }, { translateY: this.spaceAnimatedTranslations4.y },],};
    this._animatedStyle5 = {transform: [{ translateX: this.spaceAnimatedTranslations5.x }, { translateY: this.spaceAnimatedTranslations5.y },],};
  }

  onSpaceMove(event) {
    let l_panTranslateX = event.nativeEvent.translationX;
    let l_panTranslateY = event.nativeEvent.translationY;
    let l_panStartX = event.nativeEvent.x - event.nativeEvent.translationX;
    let l_panStartY = event.nativeEvent.y - event.nativeEvent.translationY;

    let l_animationsArray = new Array();
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations.y, {toValue: event.nativeEvent.translationY,duration: 0,easing: Easing.linear,}));
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations2.y, {toValue: event.nativeEvent.translationY,duration: 0,easing: Easing.linear,}));
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations3.y, {toValue: event.nativeEvent.translationY,duration: 0,easing: Easing.linear,}));
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations4.y, {toValue: event.nativeEvent.translationY,duration: 0,easing: Easing.linear,}));
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations5.y, {toValue: event.nativeEvent.translationY,duration: 0,easing: Easing.linear,}));
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations.x, {toValue: event.nativeEvent.translationX,duration: 0,easing: Easing.linear,}));
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations2.x, {toValue: event.nativeEvent.translationX,duration: 0,easing: Easing.linear,}));
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations3.x, {toValue: event.nativeEvent.translationX,duration: 0,easing: Easing.linear,}));
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations4.x, {toValue: event.nativeEvent.translationX,duration: 0,easing: Easing.linear,}));
    l_animationsArray.push(Animated.timing(this.spaceAnimatedTranslations5.x, {toValue: event.nativeEvent.translationX,duration: 0,easing: Easing.linear,}));
    Animated.parallel(l_animationsArray).start();

    this.debug_message = `\n
      event.nativeEvent.translationX: ${Math.floor(
        event.nativeEvent.translationX
      )}
      event.nativeEvent.translationY: ${Math.floor(
        event.nativeEvent.translationY
      )}
      event.nativeEvent.absoluteX: ${Math.floor(event.nativeEvent.absoluteX)}
      event.nativeEvent.absoluteY: ${Math.floor(event.nativeEvent.absoluteY)}
      event.nativeEvent.x: ${Math.floor(event.nativeEvent.x)}
      event.nativeEvent.y: ${Math.floor(event.nativeEvent.y)}
      this.spaceAnimatedTranslations_value.x: ${Math.floor(
        this.spaceAnimatedTranslations_value.x
      )}
      this.spaceAnimatedTranslations_value.y: ${Math.floor(
        this.spaceAnimatedTranslations_value.y
      )}
      this.gestureStartedX: ${Math.floor(this.gestureStartedX)}
      this.gestureStartedY: ${Math.floor(this.gestureStartedY)}
        `;
    this.forceUpdate();
  }

  onSpaceMoveCompleted(event) {
    if (event.nativeEvent.state === State.BEGAN) {
      this.spaceAnimatedTranslations.flattenOffset();
      this.spaceAnimatedTranslations2.flattenOffset();
      this.spaceAnimatedTranslations3.flattenOffset();
      this.spaceAnimatedTranslations4.flattenOffset();
      this.spaceAnimatedTranslations5.flattenOffset();
      this.spaceAnimatedTranslations.setOffset({x: Math.floor(event.nativeEvent.absoluteX - c_initial_coordinate_left),y: Math.floor(event.nativeEvent.absoluteY - c_initial_coordinate_top),});
      this.spaceAnimatedTranslations2.setOffset({x: Math.floor(event.nativeEvent.absoluteX - c_initial_coordinate_left),y: Math.floor(event.nativeEvent.absoluteY - c_initial_coordinate_top),});
      this.spaceAnimatedTranslations3.setOffset({x: Math.floor(event.nativeEvent.absoluteX - c_initial_coordinate_left),y: Math.floor(event.nativeEvent.absoluteY - c_initial_coordinate_top),});
      this.spaceAnimatedTranslations4.setOffset({x: Math.floor(event.nativeEvent.absoluteX - c_initial_coordinate_left),y: Math.floor(event.nativeEvent.absoluteY - c_initial_coordinate_top),});
      this.spaceAnimatedTranslations5.setOffset({x: Math.floor(event.nativeEvent.absoluteX - c_initial_coordinate_left),y: Math.floor(event.nativeEvent.absoluteY - c_initial_coordinate_top ),});
      this.gestureStartedX = event.nativeEvent.absoluteX;
      this.gestureStartedY = event.nativeEvent.absoluteY;
    }
    if (event.nativeEvent.state === State.END) {
      this.onSpaceMove(event);
    }
  }

  render() {
    return (
      <ImageBackground source={backImg} style={{ flex: 1 }}>
        {this.debug_message ? (
          <Text style={{ color: 'white' }}>{this.debug_message}</Text>
        ) : (
          undefined
        )}

        <PanGestureHandler
          key={`test`}
          onGestureEvent={e => this.onSpaceMove(e)}
          onHandlerStateChange={e => this.onSpaceMoveCompleted(e)}>
          <Animated.View
            ref={ref => {
              this.testAnimatedView = ref;
            }}
            style={[styles._animatable_view, this._animatedStyle]}
            useNativeDriver={true}>
            <View style={styles._box_content}>
              <Text
                style={{
                  width: '100%',
                  height: '100%',
                  fontSize: 15,
                  textAlign: 'center',
                  textAlignVertical: 'center',
                  borderRadius: 20,
                }}
                editable={false}
                ref={ref => {
                  this.textInputRef = ref;
                }}
              >
              {'Master (1) (DRAG THIS ONE)'}
              </Text>
            </View>
          </Animated.View>
        </PanGestureHandler>
          <Animated.View
            ref={ref => {
              this.testAnimatedView2 = ref;
            }}
            style={[styles._animatable_view2, this._animatedStyle2]}
            useNativeDriver={true}>
            <View style={styles._box_content}>
              <Text
                style={{
                  width: '100%',
                  height: '100%',
                  fontSize: 15,
                  textAlign: 'center',
                  textAlignVertical: 'center',
                  borderRadius: 20,
                }}
                editable={false}
                ref={ref => {
                  this.textInputRef = ref;
                }}
              >
              {'Slave (2) '}
              </Text>
            </View>
          </Animated.View>
          <Animated.View
            ref={ref => {
              this.testAnimatedView3 = ref;
            }}
            style={[styles._animatable_view3, this._animatedStyle3]}
            useNativeDriver={true}>
            <View style={styles._box_content}>
              <Text
                style={{
                  width: '100%',
                  height: '100%',
                  fontSize: 15,
                  textAlign: 'center',
                  textAlignVertical: 'center',
                  borderRadius: 20,
                }}
                editable={false}
                ref={ref => {
                  this.textInputRef = ref;
                }}
              >
              {'Slave (3) '}
              </Text>
            </View>
          </Animated.View>
          <Animated.View
            ref={ref => {
              this.testAnimatedView4 = ref;
            }}
            style={[styles._animatable_view4, this._animatedStyle4]}
            useNativeDriver={true}>
            <View style={styles._box_content}>
              <Text
                style={{
                  width: '100%',
                  height: '100%',
                  fontSize: 15,
                  textAlign: 'center',
                  textAlignVertical: 'center',
                  borderRadius: 20,
                }}
                editable={false}
                ref={ref => {
                  this.textInputRef = ref;
                }}
              >
              {'Slave (4) '}
              </Text>
            </View>
          </Animated.View>
          <Animated.View
            ref={ref => {
              this.testAnimatedView5 = ref;
            }}
            style={[styles._animatable_view5, this._animatedStyle5]}
            useNativeDriver={true}>
            <View style={styles._box_content}>
              <Text
                style={{
                  width: '100%',
                  height: '100%',
                  fontSize: 15,
                  textAlign: 'center',
                  textAlignVertical: 'center',
                  borderRadius: 20,
                }}
                editable={false}
                ref={ref => {
                  this.textInputRef = ref;
                }}
              >
              {'Slave (5) '}
              </Text>
            </View>
          </Animated.View>
      </ImageBackground>
    );
  }
}

const styles = StyleSheet.create({
  _animatable_view: {
    flex: 1,
    width: 250,
    height: 50,
    top: c_initial_coordinate_top,
    left: c_initial_coordinate_left,
    position: 'absolute',
    backgroundColor: '#ABC',
    alignItems: 'center',
    justifyContent: 'center',
    borderColor: 'gainsboro',
    borderWidth: 2,
  },
  _animatable_view2: {
    flex: 1,
    width: 250,
    height: 50,
    top: c_initial_coordinate_top + 100,
    left: c_initial_coordinate_left,
    position: 'absolute',
    backgroundColor: '#ABC',
    alignItems: 'center',
    justifyContent: 'center',
    borderColor: 'gainsboro',
    borderWidth: 2,
  },
  _animatable_view3: {
    flex: 1,
    width: 250,
    height: 50,
    top: c_initial_coordinate_top + 200,
    left: c_initial_coordinate_left,
    position: 'absolute',
    backgroundColor: '#ABC',
    alignItems: 'center',
    justifyContent: 'center',
    borderColor: 'gainsboro',
    borderWidth: 2,
  },
  _animatable_view4: {
    flex: 1,
    width: 250,
    height: 50,
    top: c_initial_coordinate_top + 300,
    left: c_initial_coordinate_left,
    position: 'absolute',
    backgroundColor: '#ABC',
    alignItems: 'center',
    justifyContent: 'center',
    borderColor: 'gainsboro',
    borderWidth: 2,
  },
  _animatable_view5: {
    flex: 1,
    width: 250,
    height: 50,
    top: c_initial_coordinate_top + 400,
    left: c_initial_coordinate_left,
    position: 'absolute',
    backgroundColor: '#ABC',
    alignItems: 'center',
    justifyContent: 'center',
    borderColor: 'gainsboro',
    borderWidth: 2,
  },
  _box_content: {
    flex: 1,
    height: '100%',
    width: '100%',
    borderRadius: Math.min(this.rectangleHeight, this.rectangleWidth) / 2,
    alignItems: 'center',
    justifyContent: 'center',
    borderColor: 'gainsboro',
    borderWidth: 2,
    opacity: 0.9,
  },
});

This can be seen in action in this snack: https://snack.expo.io/@mehmetkaplan/movetextwithgesturesingle

Additionally, in order to feel the performance problem I generated another snack, which simply animates 5 objects simultaneously. If you run this through low end Android devices, you can feel the performance problem: https://snack.expo.io/@mehmetkaplan/movetextwithgesturemulti

React-native build failed

$
0
0

I am experiencing the following difficulty with the react native application. If someone can help with a solution it's appreciated.

JS server already running. Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

  • What went wrong: Failed to load native library 'libnative-platform.so' for Linux i386.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html

How do you run a React Native project in Android Studio in 2019?

$
0
0

I have a React Native project that my collaborators have been able to run in Android Studio. I tried running it in Android Studio for the first time, and am getting a few errors that I don't recognize. I last used Android Studio about two years ago. Before troubleshooting the errors individually, I wanted to see if anyone can give me breakdown of how to run React Native projects in Android Studio that's up-to-date as of 2019.

What I've Tried:

  • Open the android folder of the project in Android Studio
  • Open list of emulators
  • Choose first one (Nexus 5) and click the run icon

Is this all there should be to it?

How to recompile the react native node dependency?

$
0
0

I have a react native android component as an npm dependency to my react native project. It is autolinked during react-native run-android. I have made changes to the dependency java files(node_modules/dependency/android/com/z/y/x/Foo.java). How to recompile the project inorder to get the changes ?

Sometimes Transition.Out doesn't work in react-native-reanimated

$
0
0

So I'm using createAnimatedSwitchNavigator to switch between screens and react-native-reanimated to provide animation (tested on Android).

My Transition.In works every time but sometimes, Transition.Out doesn't even fire and instead, the prior screen just disappears.

Here's my transition code so far:

      <Transition.Together>
        <Transition.Out
          type="slide-left"
          durationMs={800}
          interpolation="linear"
        />
        <Transition.In
          type="slide-right"
          durationMs={300}
        />
      </Transition.Together>

React-native app starting on Emulator, but not on device

$
0
0

The react-native android App is running on emulator, but not on device.

The app is syncing perfect and showing no build errors.

I tried removing libraries, de-linking, re-linking again, cleaning android app, Invalidating cache and restart, clearing react native cache and using npm install again. A lot of things. Adding more permissions to the Androidmanifest.xml file. But actually, none of them is working.

While debugging through Android Studio, no issue. Just the app is stuck on the splash screen after passing through all the break points in MainApplication and MainActivity.

Libraries used in the project :

package.json file :

           {
  "name": "xyz",
  "version": "0.0.1",
  "private": true,
  "scripts": {
  "android": "react-native run-android",
  "ios": "react-native run-ios",
  "start": "react-native start",
  "test": "jest",
  "lint": "eslint ."
  },
 "dependencies": {
 "firebase": "^7.2.1",
 "react": "16.9.0",
 "react-native": "0.61.2",
 "react-native-freshchat-sdk": "^2.1.1",
 "react-native-gesture-handler": "^1.4.1",
 "react-native-onesignal": "^3.4.2",
 "react-native-screens": "^2.0.0-alpha.3",
 "react-native-splash-screen": "^3.2.0",
 "react-native-vector-icons": "^6.6.0",
 "react-native-webview": "^7.4.0",
 "react-navigation": "^4.0.10",
 "react-navigation-drawer": "^2.2.2",
 "react-navigation-stack": "^1.9.4",
 "react-navigation-tabs": "^2.5.6"
 },
 "devDependencies": {
 "@babel/core": "7.6.2",
 "@babel/runtime": "7.6.2",
 "@react-native-community/eslint-config": "0.0.3",
 "babel-jest": "24.9.0",
 "eslint": "6.5.0",
 "jest": "24.9.0",
 "metro-react-native-babel-preset": "0.51.1",
 "react-test-renderer": "16.9.0"
 },
 "jest": {
 "preset": "react-native"
 }
}

Error :

  BUILD SUCCESSFUL in 52s

156 actionable tasks: 11 executed, 145 up-to-date info Connecting to the development server... info Starting the app on "device"... Starting: Intent { cmp=com.xyz/.MainActivity } java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference at android.os.Parcel.readException(Parcel.java:1552) at android.os.Parcel.readException(Parcel.java:1499) at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2663) at com.android.commands.am.Am.runStart(Am.java:766) at com.android.commands.am.Am.onRun(Am.java:305) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:97) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)

Expecting it to run on Android device as well, but it's not running.

React native, Unable to resolve module for static image

$
0
0

I'm using react-native 0.14.1

react-native run-android

[3:10:56 PM] <START> find dependencies
Unable to resolve module image!ic_action_android_back_white3 from /Users/lion/Desktop/Developer/AwesomeProject/NewTrackActivity.js
Unable to resolve module image!ic_action_android_back_white3 from /Users/lion/Desktop/Developer/AwesomeProject/NewTrackActivity.js

If I force open my app in Genymotion it can't find my image.

Requiring unknown module image!ic_action_android_back_white3

I'm tried to move image to both ./android/app/src/main/res/drawable-xxx and ./assets/drawable-xxx but neither work.

The development server returned response error code:404 react native

$
0
0

I am trying to run react native app like this in cmd

cd C:\Users\User\Desktop\js

react-native run-android

enter image description here

how to find jailbroken or rooted devices in application using react native and expo [on hold]

$
0
0

I am looking for the code/ library which can give me result whether my device is jailbroken/rooted or not. I checked jail Monkey and is device rooted libraries. But I can't eject my project to use this libraries. Do we have any alternate solution to detected the jailbroken or rooted device in react native? I am pretty new to react native. Any help appreciated!

React Native / Expo Device Administrator

$
0
0

Is it possible in RN or expo to make the app as device administrator for some additional tasks so that user may not uninstall the app. Is there any plugin available for it or we have to use the native android code for this?

I can't build android app with react-native-image-crop-picker

$
0
0

I want to add multiple image upload feature so I installed react-native-image-crop-picker library to my project and i made the steps in readme which is here README

But when i try to build project

react-native run-android

i get error.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.github.yalantis:ucrop:2.2.2-native.
     Searched in the following locations:
       - file:/C:/Users/mmtbo/.m2/repository/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
       - file:/C:/Users/mmtbo/.m2/repository/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
       - file:/C:/Users/mmtbo/workspace/imagePickertest/node_modules/react-native/android/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
       - file:/C:/Users/mmtbo/workspace/imagePickertest/node_modules/react-native/android/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
       - file:/C:/Users/mmtbo/workspace/imagePickertest/node_modules/jsc-android/dist/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
       - file:/C:/Users/mmtbo/workspace/imagePickertest/node_modules/jsc-android/dist/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
       - https://dl.google.com/dl/android/maven2/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
       - https://dl.google.com/dl/android/maven2/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
       - https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
       - https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
     Required by:
         project :app > project :react-native-image-crop-picker

i couldn't find much thing about this error.

this is from android/build.gradle

    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven { url "$rootDir/../node_modules/react-native/android" }

        // ADD THIS
        maven { url 'https://maven.google.com' }

        // ADD THIS
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.1")

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

android/app/build.gradle

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.imagepickertest"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
    }

React Navigation - conditional hide item in bottom navigation bar

$
0
0

How to hide one of the item in the react-navigation bottom navigation bar based on some condition

For Example : this.state.show == true

So far i had tried as below

const Main = createBottomTabNavigator(
{
  Home: {screen: HomeStack},
  CheckInOut:  this.state.show ? {screen: CheckStack} : null ,
  Attendance: {screen: AttendanceStack},
  Profile: {screen: ProfileStack},
},

EISDIR: illegal operation on a directory, read in React Native file system

$
0
0

I'm trying simple code to copy a file to another external folder using this code:

RNFS.copyFile(sourcePath, destinationPath)
.then(result => {
  console.log('file copied:', result);
})
.catch(err => {
  console.log('error: ', err.message, err.code);
});

and i have already granted Android.Permission for read and write in external directory but it's still returning this error:

error:  EISDIR: illegal operation on a directory, read '/storage/emulated/0/' EISDIR

here are the dependency:

"react": "16.9.0",
"react-native": "0.61.2",
"react-native-fs": "^2.15.2"

BTW Am i request correct permission ?

PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE 
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE

Thanks for help in advance

mergeReleaseResources Failed, caused of `not valid resource name` (Version from package.json)

$
0
0

I do an require for package.json in my React-Native-App to read the Version-Number from there to display it in my App:

const pjson = require('../../package.json');

Caused of this, I got an error while bundling an RELEASE APK in Android with gradle:

Task :app:mergeReleaseResources FAILED /home/Projekte/APP/android/app/build/generated/res/react/release/raw/package.json: Error: package is not a valid resource name (reserved Java keyword)

Is there a way to exclude this package.json from the Process who merge the Resources for the APK?

How to check a user's phone number without using third-party services

$
0
0

I need to check a user's phone number who register on my app. I wanted to use 'Facebook Account Kit' to do that, but recently Facebook deprecated 'Account Kit'.

Is there a way to check a user's phone number for free without going through third party services or something like 'Facebook Account Kit' ?

How to dynamically change the bottom tab navigator in React-Native?

$
0
0

How can I change my Bottom-tab-navigator dynamically? In the bottom tab I am having Home and Settings.

I'm having two stack navigators i.e HomeStack and SettingsStack. In home stack, I am having details screen. when i moved from home to details screen,bottom tab will changed to profile and share?How to do dynamically in React-Native? https://aboutreact.com/react-native-bottom-navigation-icon-from-local/

Above url is reference,when I click on details button in home,Bottom tab how to change dynamically?.

React Native list of active applications on the phone and blocking the launch of another application

$
0
0

How to get a list of running applications on a phone in a react native or expo? How can I force the launch of another of an application? Is this even possible? I saw there are parental control applications with similar functionality ...

Viewing all 29702 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>