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

TypeError: undefined is not an object {evaluating 'this.props.currTimeFocus.startTime.toLocaleTimeString()}

$
0
0

I'm having trouble with redux state as {this.props.currTimeFocus.startTime.toLocaleTimeString()} is undefined. The thing is the app works fine on Android phone and I'm able to render state gotten from my store, but when I try testing it on iPhone, this.props.currTimeFocus seems to have some kind of delay or it can't be accessed. Is there any difference I need to account for in Android and IOS, or am I handling redux state wrongly?

import React from 'react';import { addFriend, updateCurrFocusTime, goForward, goBack } from '../actions/timeline_actions';import { StyleSheet, View, Text, Button, TouchableOpacity } from 'react-native';import { connect } from 'react-redux'import DateTimePicker from '@react-native-community/datetimepicker';import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';import { faArrowLeft, faArrowRight } from '@fortawesome/free-solid-svg-icons';/** * This component allows users to input their available timings as well as their friends. The global state will keep track of * the common overlapping intervals of time as the user inputs more and more timings. */class Timeline extends React.Component {  constructor(props) {    super(props);    this.state = {      mode: 'date',      show: false,      modifyingStartTime: false    };  }  onChange = (event, selectedDate) => {    const currentDate = selectedDate || (this.state.modifyingStartTime ? this.props.currTimeFocus.startTime : this.props.currTimeFocus.endTime);    this.setState({ show: Platform.OS === 'ios' });    if (this.state.modifyingStartTime) {      this.setState({        startTime: currentDate,        endTime: this.props.currTimeFocus.endTime      });    } else {      this.setState({        endTime: currentDate,        startTime: this.props.currTimeFocus.startTime      });    }    // Update Redux state    this.props.updateCurrFocusTime(this.props.currFocus,      {        startTime: this.state.startTime,        endTime: this.state.endTime      });  };  showMode = currentMode => {    this.setState({ show: true });    this.setState({ mode: currentMode });  };  showTimepicker = () => {    this.showMode('time');  };  finalize = (values) => {    this.props.navigation.navigate("Genre");  }  modifyStartTime = () => {    this.setState({ modifyingStartTime: true });    this.showTimepicker();  }  modifyEndTime = () => {    this.setState({ modifyingStartTime: false });    this.showTimepicker();  }  addFriend = () => {    // Call Redux action, reset date for next input    this.props.addFriend({      startTime: new Date().toJSON(),      endTime: new Date().toJSON()    });  }  previousFriend = () => {    this.props.goBack()  }  nextFriend = () => {    this.props.goForward()  }  render() {    return (<View style={styles.container} ><View style={styles.header}><Text style={styles.title}>Available timings</Text></View><View style={styles.body}><View style={{ flexDirection: 'row', alignSelf: 'flex-start', flex: 1, marginTop: '30%' }}><Button title="+ Add Friend" onPress={this.addFriend} /></View><View style={{ flexDirection: 'column', flex: 4, justifyContent: 'space-evenly' }}><View style={styles.timeSelection}><Text style={styles.time}>                From:</Text><TouchableOpacity onPress={this.modifyStartTime}><Text style={{ textDecorationLine: 'underline', fontSize: 20 }}>                  {this.props.currTimeFocus.startTime.toLocaleTimeString()}hrs</Text></TouchableOpacity></View><View style={styles.timeSelection}><Text style={styles.time}>                To:</Text><TouchableOpacity onPress={this.modifyEndTime}><Text style={{ textDecorationLine: 'underline', fontSize: 20 }}>                  {this.props.currTimeFocus.endTime.toLocaleTimeString()}hrs</Text></TouchableOpacity></View></View></View><View style={styles.footer}><View style={styles.arrows}><TouchableOpacity onPress={this.previousFriend}><FontAwesomeIcon icon={faArrowLeft} size={30} /></TouchableOpacity><TouchableOpacity onPress={this.nextFriend}><FontAwesomeIcon icon={faArrowRight} size={30} /></TouchableOpacity></View><View style={{ marginTop: 20 }}><Text>              You are adding for friend number {this.props.currFocus + 1}</Text></View></View><View          style={{ alignSelf: 'flex-end', bottom: 0, position: 'absolute' }}><Button title="Finalize"            onPress={() => this.finalize([this.props.values_start, this.props.values_end])} /></View>        {this.state.show && (<DateTimePicker            testID="dateTimePicker"            timeZoneOffsetInMinutes={0}            value={this.state.modifyingStartTime ? new Date(this.props.currTimeFocus.startTime) : new Date(this.props.currTimeFocus.endTime)}            mode={this.state.mode}            is24Hour={true}            display="default"            onChange={this.onChange}          />        )}</View>    );  }}const styles = StyleSheet.create({  container: {    flex: 1,  },  header: {    flex: 1,  },  body: {    flex: 6,    marginRight: 15,    flexDirection: 'row-reverse'  },  footer: {    flex: 2,  },  time: {    fontFamily: 'serif',    fontSize: 15  },  text: {    alignSelf: 'center',    paddingVertical: 20,  },  title: {    fontSize: 30,    fontFamily: 'serif',    marginTop: '10%',    marginLeft: 15  },  arrows: {    marginTop: 20,    flexDirection: 'row',    padding: 20,    justifyContent: 'space-between',  }});const mapDispatchToProps = {  addFriend, goForward, goBack, updateCurrFocusTime}const mapStateToProps = (state) => {  const selectedFriendIndex = state.timeline.currFocus;  const selectedFriendTime = state.timeline.availableTimings[selectedFriendIndex];  return {    currTimeFocus: selectedFriendTime,    currFocus: selectedFriendIndex  }}export default connect(mapStateToProps, mapDispatchToProps)(Timeline)

react native google sign using firebase throws error Execution failed for task ':app:multiDexListDebug'

$
0
0

I've added multiDex with version '1.0.3' in dependencies and have set it to true in defaultConfig.

The error message is Execution failed for task ':app:multiDexListDebug'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Error while merging dex archives: Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: co.apptailor.googlesignin.BuildConfig

Using reactnative custom http header for android app is not working

$
0
0

I am using react native for android and ios mobile app.With iOS mobile app everything is working fine. But with android mobile app, the custom header is not getting passed. It does work with very first request and it fails for subsequent requests.

var myHeaders = new Headers();  myHeaders.append("Content-Type", "application/json");  myHeaders.append("Abp.TenantId",1);  var raw = JSON.stringify({"userNameOrEmailAddress":"username","password":"xxxxx"});  var requestOptions = {    method: 'POST',    headers: myHeaders,    body: raw,    redirect: 'follow'  };fetch("https://someurl", requestOptions)    .then(response => response.text())    .then(result =>console.log(result))    .catch(error => console.log('error', error));

Can someone please tell me what is wrong here?

React Native - Setting TextInput cursor position

$
0
0

In my React Native app, I am trying to set the cursor position of a TextInput to a particular position (eg. to the 5th character) but am have trouble doing so as the documentation is lacking a little. I suspect it has something to do with the 'setSelection' property of TextInput but I cannot seem to find out what to do.

Has anyone successfully done so?

Thanks.

react-native apk not working on the android device

$
0
0

This is my first react-native project and it is pretty simple it has just 2 screens. Both of the modules are working fine in production. I am using expo with a bare workflow.

adb logcat is like this:-

FATAL EXCEPTION: mqt_native_modules03-31 16:13:04.953 20227 20264 E AndroidRuntime: Process: com.project1, PID: 2022703-31 16:13:04.953 20227 20264 E AndroidRuntime: com.facebook.react.common.JavascriptException: Invariant Violation: "project1" has not been registered. This can happen if:03-31 16:13:04.953 20227 20264 E AndroidRuntime: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.03-31 16:13:04.953 20227 20264 E AndroidRuntime: * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., stack:03-31 16:13:04.953 20227 20264 E AndroidRuntime: runApplication@337:194803-31 16:13:04.953 20227 20264 E AndroidRuntime: value@27:368503-31 16:13:04.953 20227 20264 E AndroidRuntime: <unknown>@27:84103-31 16:13:04.953 20227 20264 E AndroidRuntime: value@27:293903-31 16:13:04.953 20227 20264 E AndroidRuntime: value@27:81303-31 16:13:04.953 20227 20264 E AndroidRuntime: value@-103-31 16:13:04.953 20227 20264 E AndroidRuntime:03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:71)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:371)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:883)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:100)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:214)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)03-31 16:13:04.953 20227 20264 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:919)

I don't know what is causing the error. Please help

My package.json looks like this:

    {"scripts": {"android": "react-native run-android","ios": "react-native run-ios","web": "expo start --web","start": "react-native start","test": "jest"  },"dependencies": {"@react-native-community/masked-view": "^0.1.7","@react-navigation/native": "^5.1.4","@react-navigation/stack": "^5.2.9","expo": "~36.0.0","expo-ads-admob": "^8.1.0","react": "~16.9.0","react-dom": "~16.9.0","react-native": "~0.61.4","react-native-gesture-handler": "^1.5.6","react-native-reanimated": "^1.4.0","react-native-safe-area-context": "^0.7.3","react-native-screens": "^2.0.0-alpha.12","react-native-unimodules": "~0.7.0","react-native-web": "~0.11.7"  },"devDependencies": {"@babel/core": "~7.6.0","babel-jest": "~24.9.0","jest": "~24.9.0","metro-react-native-babel-preset": "~0.56.0","react-test-renderer": "~16.9.0"  },"jest": {"preset": "react-native"  },"private": true}

app.json file:-

{"name": "Fifty Business Ideas","displayName": "Fifty Business Ideas","expo": {"name": "Fifty Business Ideas","slug": "project1","privacy": "unlisted","sdkVersion": "36.0.0","version": "1.0.0","entryPoint": "node_modules/expo/AppEntry.js","platforms": ["ios","android","web"    ]  },"android": {"package": "com.artikgauravfb.fiftybusinessideas","versionCode": 1,"permissions":[],"icon":"./assets/icon.png","config": {"googleMobileAdsAppId": "ca-app-pub-3886326456378130~9716552547"    }}}

My android manifest file looks like this: -

<manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="com.project1"><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/><!-- OPTIONAL PERMISSIONS, REMOVE WHATEVER YOU DO NOT NEED --><uses-permission android:name="android.permission.MANAGE_DOCUMENTS" /><uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" /><uses-permission android:name="android.permission.READ_PHONE_STATE" /><!-- <uses-permission android:name="android.permission.USE_FINGERPRINT" /> --><!-- <uses-permission android:name="android.permission.VIBRATE" /> --><!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> --><!-- These require runtime permissions on M --><!-- END OPTIONAL PERMISSIONS --><application      android:name=".MainApplication"      android:label="@string/app_name"      android:icon="@mipmap/ic_launcher_square"      android:roundIcon="@mipmap/ic_launcher"      android:allowBackup="false"      android:theme="@style/AppTheme"><activity        android:name=".MainActivity"        android:label="@string/app_name"        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"        android:windowSoftInputMode="adjustResize"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /><meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3886326456378130~9716552547"/><meta-data android:name="com.google.android.gms.ads.AD_MANAGER_APP" android:value="true" /></application></manifest>

React Native Android WebView How to disable horizontal scroll?

$
0
0

I have a problem with webview and scrolling. I want to disable all scrolling. I used scrollEnabled, for IOS it works fine. But for android no property like this exists. I tried a lot of scripts but nothing works.

At first look everything seems ok but if user swipes to right side then the text/div moves outside of screen.

how it looks like when it is ok

and this is what happened

how it looks like when user will swipe to side

this is my webview:

<WebView  bounces={false}  ref={(element) => { this.webViewRef = element; }}  javaScriptEnabled  scalesPageToFit={false}  onShouldStartLoadWithRequest={this._onShouldStartLoadWithRequest}  style={{    height: this.state.webViewHeight,  }}  scrollEnabled={false}  source={{    html: `<!DOCTYPE html><html><head>${injectedStyle(platformStyles.fontSizes.base || 16, webViewWidth)}</head><body><div id="baseDiv" class="ex1">${content}</div>              ${injectedJS}</body></html>    `,    baseUrl: 'http://s3.eu-central-1.amazonaws.com',  }}  onNavigationStateChange={this._processNavigationStateChange}  automaticallyAdjustContentInsets={false}/>

and i tried to add a style like this ( overflow: 'hidden' but its doesn't work):

    const injectedStyle = (fontSize, widhtPlatform) => `<style type="text/css">    ...    body {            display: flex;            overflow: hidden;            background-color: orange;    ...        }    div.ex1 {      overflow: hidden;  background-color: coral;  border: 1px solid blue;    ...    }</style>`;

and JS to disable scroll:

const injectedJS = `<script>    var scrollEventHandler = function()      {        window.scroll(0, window.pageYOffset)      }    document.addEventListener('scroll', scrollEventHandler, false);    document.getElementById('scrollbar').style.display = 'block';    document.body.style.overflow = 'hidden';</script>`;

We use RN:

react-native-cli: 2.0.1

react-native: 0.53.3

Expo React Native standalone APK doesn't work but app works fine via Expo Tunnel/Lan/Local

$
0
0

I created application based on Expo RN and it works correcly on my emulator iOS, Android and also it works good on real devices via Expo Client, but when i did expo build:android and created APK which I installed on my device - my application crush always when i change route from screen A to screen B. My application just reloading when i trying to change route. (but other routes are working and they are all based on React Navigation 4). What can be the problem and how I can debug APK on my real device?

npx react-native run-android does not work - "java.io.IOException: The filename, directory name, or volume label syntax is incorrect"

$
0
0

Just recently ejected expo and I'm trying to run my app on an android device. I followed the instructions (hopefuly right) but I keep getting this error when I try to run my app:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warningsFAILURE: Build failed with an exception.* What went wrong:A problem occurred configuring project ':app'.> java.io.IOException: The filename, directory name, or volume label syntax is incorrect* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 3serror Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081FAILURE: Build failed with an exception.* What went wrong:A problem occurred configuring project ':app'.> java.io.IOException: The filename, directory name, or volume label syntax is incorrect* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 3s    at makeError (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\execa\index.js:174:9)    at C:\Users\User\Documents\jad for eject\jad\jad\node_modules\execa\index.js:278:16    at processTicksAndRejections (internal/process/task_queues.js:97:5)    at async runOnAllDevices (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)    at async Command.handleAction (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\@react-native-community\cli\build\index.js:186:9)

Thanks for the help!


Appcenter Codepush integration. Cannot add task 'bundleDebugJsAndAssets' as a task with that name already exists

$
0
0

Steps to Reproduce

  1. yarn add react-native-codepush
  2. Add following to android/app/build.gradle
apply from: "../../node_modules/react-native/react.gradle"apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
  1. Add following to MainApplication.java
...import com.microsoft.codepush.react.CodePush;...        @Override        protected String getJSBundleFile() {            return CodePush.getJSBundleFile();        }
  1. Add the following to strings.xml
<string name="CodePushDeploymentKey" moduleConfig="true">MYKEY</string>

Expected Behavior

Build should be successful

Actual Behavior

What actually happens?

 $ react-native run-androidinfo Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 998 file(s) to forward-jetify. Using 4 workers...info JS server already running.info Installing the app...> Configure project :appWARNING: BuildType(debug): resValue 'react_native_dev_server_port' value is being replaced: 8081 -> 8081WARNING: BuildType(debug): resValue 'react_native_inspector_proxy_port' value is being replaced: 8081 -> 8081WARNING: BuildType(release): resValue 'react_native_dev_server_port' value is being replaced: 8081 -> 8081WARNING: BuildType(release): resValue 'react_native_inspector_proxy_port' value is being replaced: 8081 -> 8081Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warningsFAILURE: Build failed with an exception.* Where:Script '/Users/user/Desktop/project/app/native/node_modules/react-native/react.gradle' line: 118* What went wrong:A problem occurred configuring project ':app'.> Cannot add task 'bundleDebugJsAndAssets' as a task with that name already exists.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 4serror Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081FAILURE: Build failed with an exception.* Where:Script '/Users/user/Desktop/project/app/native/node_modules/react-native/react.gradle' line: 118* What went wrong:A problem occurred configuring project ':app'.> Cannot add task 'bundleDebugJsAndAssets' as a task with that name already exists.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 4s    at makeError (/Users/user/Desktop/project/app/native/node_modules/execa/index.js:174:9)    at /Users/user/Desktop/project/app/native/node_modules/execa/index.js:278:16    at processTicksAndRejections (internal/process/task_queues.js:97:5)    at async runOnAllDevices (/Users/user/Desktop/project/app/native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)    at async Command.handleAction (/Users/user/Desktop/project/app/native/node_modules/@react-native-community/cli/build/index.js:186:9)error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

  • react-native-code-push version: ^6.2.1
  • react-native version: 0.62.2
  • iOS/Android/Windows version: unknown
  • Does this reproduce on a debug build or release build? only checked on debug
  • Does this reproduce on a simulator, or only on a physical device? build error

External SDKs

I do have an external SDK in build.gradle. I don't know if that is the reason for this error.

buildscript {    repositories {        maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal    }    dependencies {        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.6, 0.99.99]'    }}apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'apply plugin: "com.android.application"apply from: "../../node_modules/react-native/react.gradle"apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"....apply plugin: 'com.google.gms.google-services'

What I tried.

I moved two declarations to the bottom of app/build.gradle. but the error remains same

// puts all compile dependencies into folder libs for BUCK to usetask copyDownloadableDepsToLibs(type: Copy) {    from configurations.compile    into 'libs'}apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)apply from: "../../node_modules/react-native/react.gradle"apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

Some article state to remove the line apply from: "../../node_modules/react-native/react.gradle". But New error is

yarn run v1.22.4$ react-native run-androidinfo Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 998 file(s) to forward-jetify. Using 4 workers...info JS server already running.info Installing the app...Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warningsFAILURE: Build failed with an exception.* What went wrong:Could not determine the dependencies of task ':app:mergeDebugAssets'.> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.> Could not resolve project :react-native-code-push.     Required by:         project :app> Unable to find a matching configuration of project :react-native-code-push:          - None of the consumable configurations have attributes.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 3serror Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081FAILURE: Build failed with an exception.* What went wrong:Could not determine the dependencies of task ':app:mergeDebugAssets'.> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.> Could not resolve project :react-native-code-push.     Required by:         project :app> Unable to find a matching configuration of project :react-native-code-push:          - None of the consumable configurations have attributes.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 3s    at makeError (/Users/user/Desktop/project/app/native/node_modules/execa/index.js:174:9)    at /Users/user/Desktop/project/app/native/node_modules/execa/index.js:278:16    at processTicksAndRejections (internal/process/task_queues.js:97:5)    at async runOnAllDevices (/Users/user/Desktop/project/app/native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)    at async Command.handleAction (/Users/user/Desktop/project/app/native/node_modules/@react-native-community/cli/build/index.js:186:9)error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I removed both line (which actually don't make any sense) the error is

yarn run v1.22.4$ react-native run-androidinfo Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 998 file(s) to forward-jetify. Using 4 workers...info JS server already running.info Installing the app...Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warningsFAILURE: Build failed with an exception.* What went wrong:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.> Could not resolve project :react-native-code-push.     Required by:         project :app> Unable to find a matching configuration of project :react-native-code-push:          - None of the consumable configurations have attributes.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 4serror Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081FAILURE: Build failed with an exception.* What went wrong:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.> Could not resolve project :react-native-code-push.     Required by:         project :app> Unable to find a matching configuration of project :react-native-code-push:          - None of the consumable configurations have attributes.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 4s    at makeError (/Users/user/Desktop/project/app/native/node_modules/execa/index.js:174:9)    at /Users/user/Desktop/project/app/native/node_modules/execa/index.js:278:16    at processTicksAndRejections (internal/process/task_queues.js:97:5)    at async runOnAllDevices (/Users/user/Desktop/project/app/native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)    at async Command.handleAction (/Users/user/Desktop/project/app/native/node_modules/@react-native-community/cli/build/index.js:186:9)error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can't find variable panresponder

$
0
0

I'm beginner for react-native, my assignment is in functional react native form. I wish someone can help me solve this problem. This is the class component react native codefrom this source: https://github.com/nathvarun/React-Native-Layout-Tutorial-Series/blob/master/Project%20Files/12%20Tinder%20Swipe%20Deck/%232%20Complete%20Animation/App.js

import React from 'react';import { StyleSheet, Text, View, Dimensions, Image, Animated, PanResponder } from 'react-native';const SCREEN_HEIGHT = Dimensions.get('window').heightconst SCREEN_WIDTH = Dimensions.get('window').widthimport Icon from 'react-native-vector-icons/Ionicons'const Users = [  { id: "1", uri: require('./assets/1.jpg') },  { id: "2", uri: require('./assets/2.jpg') },  { id: "3", uri: require('./assets/3.jpg') },  { id: "4", uri: require('./assets/4.jpg') },  { id: "5", uri: require('./assets/5.jpg') },]export default class App extends React.Component {  constructor() {    super()    this.position = new Animated.ValueXY()    this.state = {      currentIndex: 0    }    this.rotate = this.position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: ['-10deg', '0deg', '10deg'],      extrapolate: 'clamp'    })    this.rotateAndTranslate = {      transform: [{        rotate: this.rotate      },      ...this.position.getTranslateTransform()      ]    }    this.likeOpacity = this.position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: [0, 0, 1],      extrapolate: 'clamp'    })    this.dislikeOpacity = this.position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: [1, 0, 0],      extrapolate: 'clamp'    })    this.nextCardOpacity = this.position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: [1, 0, 1],      extrapolate: 'clamp'    })    this.nextCardScale = this.position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: [1, 0.8, 1],      extrapolate: 'clamp'    })  }  componentWillMount() {    this.PanResponder = PanResponder.create({      onStartShouldSetPanResponder: (evt, gestureState) => true,      onPanResponderMove: (evt, gestureState) => {        this.position.setValue({ x: gestureState.dx, y: gestureState.dy })      },      onPanResponderRelease: (evt, gestureState) => {        if (gestureState.dx > 120) {          Animated.spring(this.position, {            toValue: { x: SCREEN_WIDTH + 100, y: gestureState.dy }          }).start(() => {            this.setState({ currentIndex: this.state.currentIndex + 1 }, () => {              this.position.setValue({ x: 0, y: 0 })            })          })        }        else if (gestureState.dx < -120) {          Animated.spring(this.position, {            toValue: { x: -SCREEN_WIDTH - 100, y: gestureState.dy }          }).start(() => {            this.setState({ currentIndex: this.state.currentIndex + 1 }, () => {              this.position.setValue({ x: 0, y: 0 })            })          })        }        else {          Animated.spring(this.position, {            toValue: { x: 0, y: 0 },            friction: 4          }).start()        }      }    })  }  renderUsers = () => {    return Users.map((item, i) => {      if (i < this.state.currentIndex) {        return null      }      else if (i == this.state.currentIndex) {        return (<Animated.View            {...this.PanResponder.panHandlers}            key={item.id} style={[this.rotateAndTranslate, { height: SCREEN_HEIGHT - 120, width: SCREEN_WIDTH, padding: 10, position: 'absolute' }]}><Animated.View style={{ opacity: this.likeOpacity, transform: [{ rotate: '-30deg' }], position: 'absolute', top: 50, left: 40, zIndex: 1000 }}><Text style={{ borderWidth: 1, borderColor: 'green', color: 'green', fontSize: 32, fontWeight: '800', padding: 10 }}>LIKE</Text></Animated.View><Animated.View style={{ opacity: this.dislikeOpacity, transform: [{ rotate: '30deg' }], position: 'absolute', top: 50, right: 40, zIndex: 1000 }}><Text style={{ borderWidth: 1, borderColor: 'red', color: 'red', fontSize: 32, fontWeight: '800', padding: 10 }}>NOPE</Text></Animated.View><Image              style={{ flex: 1, height: null, width: null, resizeMode: 'cover', borderRadius: 20 }}              source={item.uri} /></Animated.View>        )      }      else {        return (<Animated.View            key={item.id} style={[{              opacity: this.nextCardOpacity,              transform: [{ scale: this.nextCardScale }],              height: SCREEN_HEIGHT - 120, width: SCREEN_WIDTH, padding: 10, position: 'absolute'            }]}><Animated.View style={{ opacity: 0, transform: [{ rotate: '-30deg' }], position: 'absolute', top: 50, left: 40, zIndex: 1000 }}><Text style={{ borderWidth: 1, borderColor: 'green', color: 'green', fontSize: 32, fontWeight: '800', padding: 10 }}>LIKE</Text></Animated.View><Animated.View style={{ opacity: 0, transform: [{ rotate: '30deg' }], position: 'absolute', top: 50, right: 40, zIndex: 1000 }}><Text style={{ borderWidth: 1, borderColor: 'red', color: 'red', fontSize: 32, fontWeight: '800', padding: 10 }}>NOPE</Text></Animated.View><Image              style={{ flex: 1, height: null, width: null, resizeMode: 'cover', borderRadius: 20 }}              source={item.uri} /></Animated.View>        )      }    }).reverse()  }  render() {    return (<View style={{ flex: 1 }}><View style={{ height: 60 }}></View><View style={{ flex: 1 }}>          {this.renderUsers()}</View><View style={{ height: 60 }}></View></View>    );  }}const styles = StyleSheet.create({  container: {    flex: 1,    backgroundColor: '#fff',    alignItems: 'center',    justifyContent: 'center',  },});

This I rewrite in functional component react native but it get the error cant get panresponder

import React, { useEffect,useState } from 'react';import { StyleSheet, Text, View, Dimensions, Image, Animated, PanResponder } from 'react-native';const SCREEN_HEIGHT = Dimensions.get('window').heightconst SCREEN_WIDTH = Dimensions.get('window').widthimport Icon from 'react-native-vector-icons/Ionicons'const Users = [  { id: "1", uri: require('../image/antman.jpg') },  { id: "2", uri: require('../image/butterfly.jpg') },  { id: "3", uri: require('../image/captainmarvel.jpg') },  { id: "4", uri: require('../image/antman.jpg') },  { id: "5", uri: require('../image/antman.jpg') },]const SignUpScreen = () =>{    const position = new Animated.ValueXY()    const [currentIndex,setCurrentIndex] =useState(0);    //const [PanResponder,setPanResponder] = useState('');    const rotate = position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: ['-10deg', '0deg', '10deg'],      extrapolate: 'clamp'    })    const rotateAndTranslate = {      transform: [{        rotate: rotate      },      ...position.getTranslateTransform()      ]    }    const likeOpacity = position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: [0, 0, 1],      extrapolate: 'clamp'    })    const dislikeOpacity = position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: [1, 0, 0],      extrapolate: 'clamp'    })    const nextCardOpacity = position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: [1, 0, 1],      extrapolate: 'clamp'    })    const nextCardScale = position.x.interpolate({      inputRange: [-SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2],      outputRange: [1, 0.8, 1],      extrapolate: 'clamp'    })  useEffect(() => {    const panResponder = PanResponder.create({      onStartShouldSetPanResponder: (evt, gestureState) => true,      onPanResponderMove: (evt, gestureState) => {        position.setValue({ x: gestureState.dx, y: gestureState.dy })      },      onPanResponderRelease: (evt, gestureState) => {        if (gestureState.dx > 120) {          Animated.spring(position, {            toValue: { x: SCREEN_WIDTH + 100, y: gestureState.dy }          }).start(() => {            setState({ currentIndex: currentIndex + 1 }, () => {              position.setValue({ x: 0, y: 0 })            })          })        }        else if (gestureState.dx < -120) {          Animated.spring(position, {            toValue: { x: -SCREEN_WIDTH - 100, y: gestureState.dy }          }).start(() => {            setState({ currentIndex: currentIndex + 1 }, () => {              position.setValue({ x: 0, y: 0 })            })          })        }        else {          Animated.spring(position, {            toValue: { x: 0, y: 0 },            friction: 4          }).start()        }      }    })  })  renderUsers = () => {    return Users.map((item, i) => {      if (i < currentIndex) {        return null      }      else if (i == currentIndex) {        return (<Animated.View            {...panResponder.panHandlers}            key={item.id} style={[rotateAndTranslate, { height: SCREEN_HEIGHT - 120, width: SCREEN_WIDTH, padding: 10, position: 'absolute' }]}><Animated.View style={{ opacity: likeOpacity, transform: [{ rotate: '-30deg' }], position: 'absolute', top: 50, left: 40, zIndex: 1000 }}><Text style={{ borderWidth: 1, borderColor: 'green', color: 'green', fontSize: 32, fontWeight: '800', padding: 10 }}>LIKE</Text></Animated.View><Animated.View style={{ opacity: dislikeOpacity, transform: [{ rotate: '30deg' }], position: 'absolute', top: 50, right: 40, zIndex: 1000 }}><Text style={{ borderWidth: 1, borderColor: 'red', color: 'red', fontSize: 32, fontWeight: '800', padding: 10 }}>NOPE</Text></Animated.View><Image              style={{ flex: 1, height: null, width: null, resizeMode: 'cover', borderRadius: 20 }}              source={item.uri} /></Animated.View>        )      }      else {        return (<Animated.View            key={item.id} style={[{              opacity: nextCardOpacity,              transform: [{ scale: nextCardScale }],              height: SCREEN_HEIGHT - 120, width: SCREEN_WIDTH, padding: 10, position: 'absolute'            }]}><Animated.View style={{ opacity: 0, transform: [{ rotate: '-30deg' }], position: 'absolute', top: 50, left: 40, zIndex: 1000 }}><Text style={{ borderWidth: 1, borderColor: 'green', color: 'green', fontSize: 32, fontWeight: '800', padding: 10 }}>LIKE</Text></Animated.View><Animated.View style={{ opacity: 0, transform: [{ rotate: '30deg' }], position: 'absolute', top: 50, right: 40, zIndex: 1000 }}><Text style={{ borderWidth: 1, borderColor: 'red', color: 'red', fontSize: 32, fontWeight: '800', padding: 10 }}>NOPE</Text></Animated.View><Image              style={{ flex: 1, height: null, width: null, resizeMode: 'cover', borderRadius: 20 }}              source={item.uri} /></Animated.View>        )      }    }).reverse()  }    return (<View style={{ flex: 1 }}><View style={{ height: 60 }}></View><View style={{ flex: 1 }}>          {renderUsers()}</View><View style={{ height: 60 }}></View></View>    );    };const styles = StyleSheet.create({  container: {    flex: 1,    backgroundColor: '#fff',    alignItems: 'center',    justifyContent: 'center',  },});export default SignUpScreen;

Can anybody help me for this error? Thank you very much

Which library should I use to store images in react-native?

$
0
0

I am new to react-native and I want to store images in local storage. I have read that AsyncStorage is only for strings. I need a package to store images. I have tries react-native-fs and expo-file-system. I have tried building a sample application with bot the libraries and found out that the app size built with expo-fie-system is larger. I have used react-native-unimodules to install expo-file-system (as it is a bare react-native project). Is it safe to use react-native-fs (Can other apps/websites read our data?). Which package should I prefer?

Disable Screen Capture/ScreenShot in React Native App

$
0
0

I have came across few solutions specific for ios and Android to prevent screen-capturing and taking screenshots. But how do i disable screen-capturing in react native?

React Native - Android - Red screen error showing on publicly released production app

$
0
0

According to RN docs this should be impossible but I'm getting a red screen error on my app downloaded from the playstore. The playstore version generally works fine but there was a null value on one of the screens and it popped a redscreen.

Definitely uploaded the release version of APK using Build --> Generate Signed Bundle/APK. I'm totally at a loss of where else to look as I can't find any mentions of similar situations through searches.

Build.gradle file looks like:

 buildTypes {        release {            minifyEnabled enableProguardInReleaseBuilds                signingConfig signingConfigs.release            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"        }        debug {    debuggable false}

Edit for additional steps I've tried:

Tried following this RN guide for releasing as well: https://reactnative.dev/docs/signed-apk-android to no avail.

Confirmed the apk I'm using is in-fact a release build using jarsigner -verify -verbose -certs my_application.apk

Testing using a console.error() just after I see the app load successfully and that consistently shows a red screen.

How do I make an Android device "ring" using React Native?

$
0
0

I am new to React Native, coming from React. I am building a video messaging app that uses WebRTC, React Native (native / no Expo) and I have wrongly assumed that making the device "ring" would be as simple as calling an inbuilt method, like you would with Alert for example.

When a logged in user of the app receives notification of an incoming call, I would like the phone to ring, much in the same way as you would see in WhatsApp or Skype when you have an incoming call.

I have searched the web and haven't really found anything very useful - it may be that I am using the wrong search terms because I don't know what I'm looking for.

Any pointers gratefully accepted and understand that getting this to work require a number of steps to be taken!

Run Android emulator cli and detox

$
0
0

I'm trying to setup android emulators for a React Native project with detox.

Right now when I run my tests I get the following error:

error

It looks like it's looking for the adb executable in the wrong path AndroidSdk/platform-tools, but I've set the environment variable pointing to the proper path:

env variables

I've checked from where Detox takes the path and everything looks to point to that variable in their code.

function getAndroidSDKPath() {  return process.env.ANDROID_SDK_ROOT || process.env.ANDROID_HOME || '';}function getAndroidSDKHome() {  return process.env['ANDROID_SDK_HOME'] || os.homedir();}function getEmulatorHome() {  return process.env['ANDROID_EMULATOR_HOME'] || path.join(getAndroidSDKHome(), '.android');}function getAndroidEmulatorPath() {  const sdkRoot = getAndroidSDKPath();  if (!sdkRoot) {    return which('emulator') || throwMissingSdkError();  }  const defaultPath = which('emulator', path.join(sdkRoot, 'emulator'));  if (defaultPath) {    return defaultPath;  }  const legacyPath = which('emulator', path.join(sdkRoot, 'tools'));  if (legacyPath) {    return legacyPath;  }  throwSdkIntegrityError(sdkRoot, 'emulator/emulator');}function getAdbPath() {  const sdkRoot = getAndroidSDKPath();  if (!sdkRoot) {    return which('adb') || throwMissingSdkError();  }  const defaultPath = which('adb', path.join(sdkRoot, 'platform-tools'));  if (defaultPath) {    return defaultPath;  }  throwSdkIntegrityError(sdkRoot, 'platform-tools/adb');}

And the emulators / folder with adb executables do exist there:

folders

Does anyone know what can be the problem or has any easy to follow guide on how to setup android emulators so it can be run from cli/detox? Any help is highly appreciated, been trying to do it for a few days and I've readed a lot of stackoverflows/github issues but still can't manage to make it work.


React Native Sqlite Storage: db.transaction() function is not executed

$
0
0

I'm working with React-native-sqlite-storage (React native CLI). And the thing is that getmysqliData dosn't excute tx.executeSql function when I query the sqlite. And I don't know why.

the whole code is this: https://gist.github.com/BravenxX/247f97c0576881616c24d197cdd137f6

About the code:

state: data: [--DATA--] .... is temporaly, this should must be replaced with the sqlite elements in getMysqliData function.

the are 2 arrays because I use them as a real time filter (it has nothing to do with sqlite btw)

const db = SQLite.openDatabase({ name: "geslub", createFromLocation: "~databases/geslub.db" });class TablaActProgramadas extends Component{  constructor(props){    super(props);    this.state={      value: '',      isLoading: true,      data:[        {'Faena': 'aDDLB', 'Planta': 'taller Titan', 'Linea': 'Kmotasú', 'Equipo': 'Caex', 'Componente': 'N/A'}      ],      arrayholder: [        {'Faena': 'aDDLB', 'Planta': 'taller Titan', 'Linea': 'Kmotasú', 'Equipo': 'Caex', 'Componente': 'N/A'}      ],    };  };  async componentDidMount(){    await  this.getMysqliData();    console.log('TERMINO: ComponenntDIDMOUNT')  }  getMysqliData(){    const sql = 'SELECT * FROM actividades_programadas';    db.transaction((tx) => {      //TX.EXECUTESQL is not executed!!      tx.executeSql(sql, [], (tx, results) => {          if(results.rows._array.length > 0){            this.setState({              data: results.rows_array,              arrayholder: results.rows_array,              isLoading: false            })          }else{            Alert.alert('ERROR en la carga de datos')          }        });    });  }  componentWillUnmount() {    this.closeDatabase();  }  closeDatabase = () => {    if (db) {        db.close();    } else {        console.log("Database no estaba abierta");    }  }renderHeader = () => {  return (<SearchBar        placeholder="Filtro general..."        lightTheme        round        onChangeText={text => this.searchFilterFunction(text)}        autoCorrect={false}        value={this.state.value}      />  );};searchFilterFunction = text => {    this.setState({      value: text,    });    const newData = this.state.arrayholder.filter(item => {      const itemData = `${item.Faena.toUpperCase()} ${item.Planta.toUpperCase()} ${item.Linea.toUpperCase()}`;      const textData = text.toUpperCase();      return itemData.indexOf(textData) > -1;    });    this.setState({      data: newData,    });  };  render(){    if(this.state.isLoading)      return (<View style={stylesLoading.container}><View><ActivityIndicator size="large" color="lightblue"/></View><View><Text style={stylesLoading.texto}>                        Descargando datos... </Text></View></View>      )    else      return(<FlatList          data={this.state.data}          showsVerticalScrollIndicator={false}          keyExtractor={(item, index) => index.toString()}          renderItem={({item}) =>(<TouchableOpacity onPress={() => this.props.navigation.navigate('RealizarActProgramadas', {              faena: `${item.Faena}`,       //ENVIAR ID DE LA ACTIVIDAD A REALIZAR              otherParam: 'anything you want here',            })}><ListItem                title={`Faena: ${item.Faena}`}                subtitle={`Planta: ${item.Planta}\nLinea: ${item.Linea}`}              /></TouchableOpacity>          )}          ItemSeparatorComponent={this.renderSeparator}          ListHeaderComponent={this.renderHeader()}        />      );  }}

This merchant is not enabled for Google Pay. [Android, React-Native]

$
0
0

i need to integrate android/google Pay in my app. used react-native-payments for integrate native payment wallet.

Sheet open in type os TEST mode but in release mode give error Like This merchant is not enabled for Google Pay.

already generate merchantId in Play store console and try to run app from beta testing.

how can i enable google pay?? i can't find.

Thanks in advance...

Native base component's theme is not updating when the theme changes of the App

$
0
0

I am using native base + react-navigation in an app and need to change the theme of the app. As soon as I change the theme the react-navigation update that easily but the problem is that the native base component theme does not change. It looks odd to the user.

I had used this code to change the theme of the app

<StyleProvider style={getTheme(theme === 'LIGHT' ? platform : material)}><Container><NavigationContainer                        theme={theme === 'LIGHT' ? DefaultTheme : MyThemeDark}><Stack.Navigator                            initialRouteName={isProfile ? 'Root' : 'Selection'}>                              ..................</Stack.Navigator></NavigationContainer></Container></StyleProvider>

As I said React navigation theme is updating correctly but the native base theme is not updating.

Scroll multiple horizontal scrollview in sync when you scroll one in React Native

$
0
0

Below is a sample of what needs to be achieved in React Native:

Title1

Some description that spans horizontally using a ScrollView (horizontal prop)...............................

Title2

Some description that spans horizontally using a ScrollView (horizontal prop)...............................

Title3

Some description that spans horizontally using a ScrollView (horizontal prop)...............................

The code for the same is:

FlatList --> View --> Title + ScrollView (description)

Now, the expectation is when I scroll the description of one row, all the descriptions from the other row should scroll in sync.

Below is the structure:

<View><TouchableOpacity><View style={styles.titleContainer}><Text style={styles.title}>{name}</Text></View></TouchableOpacity><ScrollView      onMomentumScrollEnd={e => this.onScroll(e, index)}      ref={node => { this.scrollRef[index] = node; }}      scrollEventThrottle={16}      showsHorizontalScrollIndicator={false}      horizontal      style={styles.fundContainer}><View style={styles.statsContainer}><Text>Some Description</Text></View></ScrollView></View>

And the method that I run on scroll:

  onScroll = (event: Object, index: number) => {    this.scrollRef.forEach((scrollItem, scrollIndex) => {      if (scrollIndex !== index) {        scrollItem.scrollTo({          x: event.nativeEvent.contentOffset.x,          y: event.nativeEvent.contentOffset.y,          animated: true,        });      }    });  };

I am using onMomentumScrollEnd which scrolls the item on scroll end. If I use onScroll, it creates a performance bottleneck and lags miserably.

Are there any workaround to scroll the list in sync?

java.lang.double error - React Native (issue in android only)

$
0
0

Error: "java.lang.Double cannot be cast to java.lang.String"

This error doesn't occur when we install and run .ipa file but it throws this error for android. And I don't even know which part of my React Native code is it throwing the error for!!!
Can someone please help me to find which part of my code is throwing this error??
How to debug this??

Viewing all 28468 articles
Browse latest View live


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