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

Opening react-native-modal is very slow when I use react-native-calendars

$
0
0

I have been trying to open a modal when the day is pressed on CalendarList on react-native-calendars.

If I remove the CalendarList component, the modal is opening flawlessly.

The CalendarList very slow in rendering and make other components to render slow

Is there any way to fix this issue?

import React, {useEffect, useState} from 'react';import {  SafeAreaView,  StatusBar,  StyleSheet,  Text,  View,  ActivityIndicator,  TouchableOpacity,} from 'react-native';import {CalendarList, CalendarProvider, Agenda} from 'react-native-calendars';import {useTheme} from 'react-native-paper';import Filter from '../../../assets/icons/Filter';import LeftArrow from '../../../assets/icons/LeftArrow';import Header from '../../../components/Header';import BookedModal from '../../../components/calendars/BookedModal';import OptionsModal from '../../../components/OptionsModal';import {NavigationProps} from 'react-native-navigation';import moment from 'moment';import {ThemeProps} from '../../../utils/theme';const Calendar = (props: NavigationProps) => {  const theme: ThemeProps = useTheme();  const styles = makeStyles(theme);  const [selected, setSelected] = useState(moment().format('YYYY-MM-DD'));  const [showOptionsModal, setshowOptionsModal] = useState(false);  const [showBookedModal, setshowBookedModal] = useState(false);  const [loading, setloading] = useState(false);  const toggleShowBookedModal = () => setshowBookedModal(!showBookedModal);  const toggleShowOptionsModal = () => setshowOptionsModal(!showOptionsModal);  const getSelectedDates = () => {    return {      [moment().format('YYYY-MM-DD')]: {        selected: true,        disableTouchEvent: true,        selectedColor: theme.colors.secondary,        selectedTextColor: theme.colors.primary,        // selectedColor: '#fff',        // selectedTextColor: theme.colors.primary,        marked: false,        dotColor: theme.colors.primary,      },    };  };  const getMarkedDates = () => {    const dates = ['2024-05-16', '2024-05-10', '2024-05-20'];    let markedDates = {};    dates.map(date => {      //@ts-ignore      markedDates[date] = {        selected: true,        disableTouchEvent: true,        selectedColor: '#fff',        selectedTextColor: theme.colors.primary,        marked: true,        dotColor: theme.colors.primary,      };    });    return markedDates;  };  console.log(showBookedModal, 'showBookedModal');  return (<SafeAreaView style={styles.screen}><BookedModal        componentId={props.componentId}        visible={showBookedModal}        onClose={toggleShowBookedModal}      /><Header><View style={styles.headerContainer}><View style={styles.row}><LeftArrow /><Text style={styles.headerTitle}>Calendar</Text></View><Filter onPress={toggleShowOptionsModal} /></View></Header><View style={styles.mainContainer}><OptionsModal          onClose={toggleShowOptionsModal}          options={[            {title: 'All', onPress: () => {}},            {title: 'Bookings', onPress: () => {}},            {title: 'Reminders', onPress: () => {}},          ]}          visible={showOptionsModal}        /><CalendarList          markedDates={{            ...getSelectedDates(),            ...getMarkedDates(),          }}          theme={{            backgroundColor: '#ffffff',            textDisabledColor: '#d9e',            textMonthfontFamily: theme.fontFamily.semiBold,            monthTextColor: theme.colors.primary,            textMonthFontSize: 20,            todayTextColor: theme.colors.primary,          }}          dayComponent={({date, state, marking, onPress}) => {            const isMarked = marking?.marked || false;            return (<TouchableOpacity                onPress={onPress}                style={[                  styles.dayContainer,                  isMarked && styles.markedDayContainer,                ]}><Text                  style={[styles.dayText, isMarked && styles.markedDayText]}>                  {date?.day}</Text></TouchableOpacity>            );          }}          onDayPress={day => {            console.log('ONPRESSED');            toggleShowBookedModal();            // setSelected(day.dateString);          }}          markingType="custom"        /></View><StatusBar backgroundColor={theme.colors.primary} /></SafeAreaView>  );};export default Calendar;const makeStyles = (theme: ThemeProps) =>  StyleSheet.create({    screen: {      flex: 1,      backgroundColor: theme.colors.primary,    },    mainContainer: {      backgroundColor: '#F9F9F9',      height: '100%',    },    headerContainer: {      flexDirection: 'row',      alignItems: 'center',      height: '100%',      paddingHorizontal: 20,      justifyContent: 'space-between',    },    headerTitle: {      fontFamily: theme.fontFamily.semiBold,      fontSize: 18,      color: '#fff',    },    row: {      flexDirection: 'row',      gap: 10,    },    dayContainer: {      width: 40,      height: 40,      justifyContent: 'center',      alignItems: 'center',      borderRadius: 20,    },    markedDayContainer: {      backgroundColor: theme.colors.secondary, // Adjust color for marked day    },    dayText: {      color: '#000', // Adjust color for regular day      fontFamily: theme.fontFamily.semiBold,    },    markedDayText: {      color: theme.colors.primary, // Adjust color for marked day text    },  });

npx react-native run-android: E/Device: Error during Sync: EOF

$
0
0

I am trying to run react native app to my real android device.I checked my device before running

adb devicesList of devices attached3357425441473098        device

I started with

npx react-native start

and in other console

npx react-native run-android

But got an error..

Task :app:installDebug FAILED                                                                                                                                                     10:25:40 V/ddms: execute: running am get-config                                                                                                                                     10:25:40 V/ddms: execute 'am get-config' on '3357425441473098' : EOF hit. Read: -1                                                                                                  10:25:40 V/ddms: execute: returning                                                                                                                                                 Installing APK 'app-debug.apk' on 'SM-G960U - 9' for app:debug                                                                                                                      10:25:40 D/app-debug.apk: Uploading app-debug.apk onto device '3357425441473098'10:25:40 D/Device: Uploading file onto device '3357425441473098'10:25:40 D/ddms: Reading file permision of /home/user/react-native/awesomeProject/android/app/build/outputs/apk/debug/app-debug.apk as: rw-rw-r--                10:25:40 D/ddms: read: channel EOF                                                                                                                                                  10:25:40 E/Device: Error during Sync: EOF                                                                                                                                           Unable to install /home/user/react-native/awesomeProject/android/app/build/outputs/apk/debug/app-debug.apk                           com.android.ddmlib.InstallException: EOF      

And right after that error. I lost my device connection.

adb devices

shows nothing..

and at the bottom of stacktrace I see this error also

Caused by: java.io.IOException: EOF        at com.android.ddmlib.AdbHelper.read(AdbHelper.java:862)        at com.android.ddmlib.SyncService.doPushFile(SyncService.java:712)        at com.android.ddmlib.SyncService.pushFile(SyncService.java:406)        at com.android.ddmlib.Device.syncPackageToDevice(Device.java:988)        at com.android.ddmlib.Device.installPackage(Device.java:902)

FAILURE: Build failed with an exception.

* What went wrong:Execution failed for task ':app:installDebug'.> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: EOF* 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 10s    at checkExecSyncError (child_process.js:629:11)    at execFileSync (child_process.js:647:13)    at runOnAllDevices (/home/user/react-native/newProject/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)    at buildAndRun (/home/user/react-native/newProject/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)    at then.result (/home/user/react-native/newProject/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12)    at process._tickCallback (internal/process/next_tick.js:68:7)

My device is us samsumg galaxy s9. It was working when I use Expo sdk. What is my problem?

react-native : 0.61.5

Weird thing is that it works first execution after computer boot. then I tried reconnect phone, and it pops up again.

react-native-document-scanner-plugin React Native document scanner plugin for Android not scanning automatically or cropping correctly

$
0
0

I'm currently developing a React Native app that incorporates a document scanning feature using the react-native-document-scanner-plugin. While the plugin functions flawlessly on iOS devices, I've encountered several issues when using it on Android.

Firstly, the document scanner on Android doesn't initiate automatic scanning as it does on iOS. Additionally, even when the user manually captures the document, the edges aren't cropped accurately, necessitating manual corrections using edge lines.

I've experimented with various configurations and settings, but haven't been able to resolve these issues. Could someone suggest alternative plugins or potential workarounds to achieve smoother document scanning functionality on Android?

Ideally, I was expecting the react-native-document-scanner-plugin to perform consistently across both iOS and Android platforms, with automatic scanning and accurate document edge cropping on Android devices, similar to its behavior on iOS. However, since encountering these issues, I'm seeking advice or recommendations for alternative solutions that can deliver reliable document scanning functionality on Android within a React Native app.

Is it possible to keep a persistent background job on iOS and Android?

$
0
0

I have requirement that I'm unsure about the possibility of. It's an app that has a indefinitely ran background job on iOS and Android that periodically check if the phone is in a geofence zone (Polygon of set coordinates). I've researched this and have discovered some edgecases, such as the behaviour of background jobs if the phone is restarted, app crashed, background job is killed by the OS (It's after all checking GPS coordinates every few seconds).

I have discovered the following package that seems promising: https://github.com/transistorsoft/react-native-background-geolocation

But I haven't discovered a verified test case that of this working flawlessly (It's business critical that it's flawless and ran at all times once the app is installed). So my question is if this is actually possible? If not what are some alternative ways, an external device that is hooked through e.g BLE?

I've tried:

  1. Tried to identify packages that solved this, found the following but unfortunately crashed the app before I could verify: https://github.com/transistorsoft/react-native-background-geolocation
  2. Researched edgecases and possibilities with such background geofence functionalities

Unable to find gradle-8.6-all.zip in React Native

$
0
0

I'm developing a mobile application using React Native, and when I run the react-native run-android command, I encounter the following error:

error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081Exception in thread "main" java.io.FileNotFoundException: C:\Users\omers\OneDrive\Desktop\react_native\mymobileapp\android\gradle\wrapper\gradle-8.6-all.zip (Sistem belirtilen dosyay� bulam�yor) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:213) at java.base/java.io.FileInputStream.(FileInputStream.java:152) at java.base/java.io.FileInputStream.(FileInputStream.java:106) at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:84) at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:180) at org.gradle.wrapper.Download.downloadInternal(Download.java:129) at org.gradle.wrapper.Download.download(Download.java:109) at org.gradle.wrapper.Install.forceFetch(Install.java:171) at org.gradle.wrapper.Install.fetchDistribution(Install.java:104) at org.gradle.wrapper.Install.access$400(Install.java:46) at org.gradle.wrapper.Install$1.call(Install.java:81) at org.gradle.wrapper.Install$1.call(Install.java:68) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69) at org.gradle.wrapper.Install.createDist(Install.java:68) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:102) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:66).

This error indicates that Gradle cannot find the gradle-8.6-all.zip file. However, when I check the file path, I can see that the file exists.

I have updated the distributionUrl in the gradle-wrapper.properties file to gradle-8.6-all.zip.I have checked my internet connection and verified that there are no issues.I have tried running CMD as an administrator, but the issue persists.What can I do to resolve this issue?

Environment:

Windows 10React NativeGradle 8.6

cannot read property handleSetJSResponder of null error in react native v0.70.3

$
0
0

I have updgraded my React Native version to 0.70.3 from 0.64.2 and accordingly upgraded the packages.

When running the debugging(react-native run-ios) for IOS, the above error is occurring on react-native-gesture-handler. If you have any method to fix this or any advice please share with me.

Added all the details(code,screenshots) to check in-detailed,Thanks in advance.

Please help me in reolving the issue by sharing the sample code or steps for resolving.

Below are the list of packages used in the project,

{"name": "projectSetup","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": {"@react-native-async-storage/async-storage": "^1.17.10","@react-native-community/cli": "^9.2.1","@react-native-community/datetimepicker": "^6.5.2","@react-native-community/masked-view": "^0.1.11","@react-native-community/netinfo": "^9.3.5","@react-native-masked-view/masked-view": "^0.2.8","axios": "^1.1.3","lodash": "^4.17.21","react": "18.1.0","react-native": "^0.70.3","react-native-android-location-enabler": "^1.2.2","react-native-calendars": "^1.1275.0","react-native-camera": "^4.2.1","react-native-device-info": "^10.2.1","react-native-elements": "^3.4.2","react-native-fast-image": "^8.6.1","react-native-flexbox-grid": "^0.3.2","react-native-geocoding": "^0.5.0","react-native-geolocation-service": "^5.3.1","react-native-gesture-handler": "^2.7.1","react-native-image-crop-picker": "^0.38.0","react-native-image-pan-zoom": "^2.1.12","react-native-image-picker": "^4.10.0","react-native-maps": "^1.3.2","react-native-month-selector": "^1.4.0","react-native-onesignal": "^4.4.1","react-native-paper": "^4.12.5","react-native-qrcode-scanner": "^1.5.5","react-native-reanimated": "^2.11.0","react-native-safe-area-context": "^3.4.1","react-native-screens": "^3.18.2","react-native-signature-capture": "^0.4.12","react-native-sound": "^0.11.2","react-native-sound-player": "^0.13.2","react-native-svg": "^13.4.0","react-native-vector-icons": "^9.2.0","react-native-view-pdf": "^0.14.0","react-native-webview": "^11.23.1","react-navigation": "^4.4.4","react-navigation-stack": "^2.10.4","react-redux": "^7.1.1","redux": "^4.2.0","redux-logger": "^3.0.6","redux-thunk": "^2.4.1","rn-fetch-blob": "^0.12.0","socket.io-client": "^4.5.3"  },"devDependencies": {"@babel/core": "^7.12.9","@babel/runtime": "^7.12.5","@react-native-community/eslint-config": "^2.0.0","babel-jest": "^26.6.3","eslint": "^7.32.0","jest": "^26.6.3","metro-react-native-babel-preset": "0.72.3","react-test-renderer": "18.1.0"  },"jest": {"preset": "react-native"  }}

App.js code

import React from "react";import {View, Text, StyleSheet, LogBox, TouchableOpacity} from "react-native";class App extends React.Component {    render() {        return (<View style={{flex:1}}><TouchableOpacity                    onPress={()=> {                        Alert.alert('Hello...', 'kk')                    }}                    style={{height:200,backgroundColor:'red',alignItems:'center',justifyContent:'center'}}><Text>Welcome Praveen</Text></TouchableOpacity></View>        );    }}export default App;

**ERROR [react-native-gesture-handler] react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).

For installation instructions, please refer to https://docs.swmansion.com/react-native-gesture-handler/docs/#installation**

Output of npx react-native-info

info Fetching system and libraries information...System:    OS: macOS 13.0    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz    Memory: 37.48 MB / 16.00 GB    Shell: 5.8.1 - /bin/zsh  Binaries:    Node: 18.10.0 - /usr/local/bin/node    Yarn: 1.22.19 - ~/node_modules/.bin/yarn    npm: 8.19.2 - /usr/local/bin/npm    Watchman: 2022.10.03.00 - /usr/local/bin/watchman  Managers:    CocoaPods: 1.11.3 - /usr/local/bin/pod  SDKs:    iOS SDK:      Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0    Android SDK: Not Found  IDEs:    Android Studio: 2021.3 AI-213.7172.25.2113.9014738    Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild  Languages:    Java: 11.0.16.1 - /usr/bin/javac  npmPackages:    @react-native-community/cli: ^9.2.1 => 9.2.1     react: 18.1.0 => 18.1.0     react-native: ^0.70.3 => 0.70.4     react-native-macos: Not Found  npmGlobalPackages:    *react-native*: Not Found

enter image description here

enter image description here

enter image description here

react-native-torch is not working properly

$
0
0

I am trying to use react-native-torch with react native. I took this code and put it into my project. I have also installed react-native-torch with npm install --save react-native-torch. My App.js looks like this (sorry for using code snippet, I wasn't able to achieve propriate formating with this formating):

 import React, { Component } from 'react'; import {   AppRegistry,   Button,   NativeModules,   StyleSheet,   Text,   View } from 'react-native'; import Torch from 'react-native-torch'; export default class TorchDemo extends Component {   constructor(props) {     super(props);     this.state = {       isTorchOn: false,     };   }   _handlePress() {     const { isTorchOn } = this.state;     Torch.switchState(!isTorchOn);     this.setState({ isTorchOn: !isTorchOn });   }   render() {     return (<View style={styles.container}><Text style={styles.welcome}>           RCTTorch Demo</Text><Button           onPress={this._handlePress.bind(this)}           title="Toggle Torch"         /></View>     );   } } const styles = StyleSheet.create({   container: {     flex: 1,     justifyContent: 'center',     alignItems: 'center',     backgroundColor: '#F5FCFF',   },   welcome: {     fontSize: 20,     textAlign: 'center',     margin: 10,   },   instructions: {     textAlign: 'center',     color: '#333333',     marginBottom: 5,   }, }); AppRegistry.registerComponent('TorchDemo', () => TorchDemo);

Everything runs as it should, but when I tap the toogle torch button, I am getting this warning and the flashlight will not turn on:

expo error

I have tried many forms of their demo codes, but the problem was always with Torch.switchState.Does anyone knows how to fix this issue?
Thank you very much for any help.
Jan

React Native Javascript Native Interface (JSI) Linking failure on Android

$
0
0

I'm trying to get a JavaScript Native Interface module working on Android.

Can anyone help?

I can compile the app including the CPP library. The app opens, runs the MyJsiNamespace::installExampleJsiLibrary(); function to install the JSI functions, and then crashes when it calls the PropNameID::forAscii() function, apparently because the Hermes engine can't execute the function and fails with a SIGTRAPTRAP_BRKPT fault.

Believe my C++ file is not being linked properly to the JSI libraries on Android, possibly due to a misconfiguration in CMakeLists.txt

Environment

  • MacOS 14.1.2 (Sonoma)
  • CMake 3.28.0
  • GCC Apple CLang version 15
  • React Native v0.73.8
  • Android Studio 2023.2.1 (Iguana)

CMakeLists.txt

Here is my android/main/CMakeLists.txt:

cmake_minimum_required(VERSION 3.28.0)project(exampleJsiLibrary        VERSION 1.0.0        DESCRIPTION "Example JSI Library")set (CMAKE_VERBOSE_MAKEFILE ON)set (CMAKE_CXX_STANDARD 14)message (${CMAKE_C_COMPILER})message (${CMAKE_CXX_COMPILER})message (${CMAKE_CXX_COMPILER_AR})message (${CMAKE_CXX_COMPILER_RANLIB})include_directories(        ../../cpp        ../../node_modules/react-native/React        ../../node_modules/react-native/React/Base        ../../node_modules/react-native/ReactCommon/jsi)add_library(exampleJsiLibrary        SHARED        ../../node_modules/react-native/ReactCommon/jsi/jsi/jsi.cpp        ../../cpp/exampleJsiLibrary.cpp        ../../cpp/exampleJsiLibrary.h        ./cpp-adapter.cpp)target_link_libraries(exampleJsiLibrary android)

exampleJsiLibrary.cpp

My cpp/exampleJsiLibrary.cpp library is as follows:

// includes <jsi/jsi.h> and <jsi/jsilib.h>#include "exampleJsiLibrary.h" #include <iostream>using namespace facebook::jsi;using namespace std;string sayHello(){    return "Hello world";}namespace MyJsiNamespace{    void installExampleJsiLibrary(Runtime &runtime)    {        // this line is related to the crash        PropNameID propNameId = PropNameID::forAscii(            runtime,"example"        );    }}

Crash Log

Here is the Android debugger log output when the app crashes. Notice that the entire Android Java -> JNI -> CPP bridge gets executed up to the PropNameID::forAscii() from my CPP file, then seems to fail during execution of the method.

The PropNameID::forAscii() executes fine on iOS (including further instructions), so I believe this is a linking issue on Android only.

2024-05-07 23:26:12.968  8688-8757  libc                    com.yourprojectname                  A  Fatal signal 5 (SIGTRAP), code 1 (TRAP_BRKPT), fault addr 0x75490c0bf4 in tid 8757 (mqt_native_modu), pid 8688 (yourprojectname)2024-05-07 23:26:13.071  8762-8762  DEBUG                   pid-8762                             A  pid: 8688, tid: 8757, name: mqt_native_modu  >>> com.yourprojectname <<<2024-05-07 23:26:13.299  8762-8762  DEBUG                   pid-8762                             A        #00 pc 000000000007cbf4  /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/lib/arm64/libhermes_executor.so (BuildId: 5656b456b533237e)2024-05-07 23:26:13.299  8762-8762  DEBUG                   pid-8762                             A        #01 pc 000000000007cad0  /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/lib/arm64/libhermes_executor.so (BuildId: 5656b456b533237e)2024-05-07 23:26:13.299  8762-8762  DEBUG                   pid-8762                             A        #02 pc 000000000007ca7c  /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/lib/arm64/libhermes_executor.so (BuildId: 5656b456b533237e)2024-05-07 23:26:13.299  8762-8762  DEBUG                   pid-8762                             A        #03 pc 0000000000072978  /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/lib/arm64/libhermes_executor.so (BuildId: 5656b456b533237e)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #04 pc 00000000000773ec  /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/lib/arm64/libexampleJsiLibrary.so (facebook::jsi::PropNameID::forAscii(facebook::jsi::Runtime&, char const*, unsigned long)+52) (BuildId: d2c195d94449b9a5376bc650b16d4ecc566629e6)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #05 pc 000000000007711c  /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/lib/arm64/libexampleJsiLibrary.so (facebook::jsi::PropNameID::forAscii(facebook::jsi::Runtime&, char const*)+88) (BuildId: d2c195d94449b9a5376bc650b16d4ecc566629e6)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #06 pc 0000000000076e88  /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/lib/arm64/libexampleJsiLibrary.so (MyJsiNamespace::installExampleJsiLibrary(facebook::jsi::Runtime&)+88) (BuildId: d2c195d94449b9a5376bc650b16d4ecc566629e6)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #07 pc 0000000000079aa0  /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/lib/arm64/libexampleJsiLibrary.so (Java_com_yourprojectname_ExampleModule_initialize+76) (BuildId: d2c195d94449b9a5376bc650b16d4ecc566629e6)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #15 pc 00000000000009b8  [anon:dalvik-classes4.dex extracted in memory from /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/base.apk!classes4.dex] (com.yourprojectname.ExampleModule.initialize+80)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #18 pc 0000000000300d36  [anon:dalvik-classes.dex extracted in memory from /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/base.apk] (com.facebook.react.bridge.ModuleHolder.doInitialize+90)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #21 pc 0000000000300e20  [anon:dalvik-classes.dex extracted in memory from /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/base.apk] (com.facebook.react.bridge.ModuleHolder.markInitializable+52)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #24 pc 000000000030142e  [anon:dalvik-classes.dex extracted in memory from /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/base.apk] (com.facebook.react.bridge.NativeModuleRegistry.notifyJSInstanceInitialized+82)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #27 pc 00000000002fb470  [anon:dalvik-classes.dex extracted in memory from /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/base.apk] (com.facebook.react.bridge.CatalystInstanceImpl$2.run+12)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #36 pc 0000000000305730  [anon:dalvik-classes.dex extracted in memory from /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/base.apk] (com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage)2024-05-07 23:26:13.300  8762-8762  DEBUG                   pid-8762                             A        #42 pc 00000000003058d6  [anon:dalvik-classes.dex extracted in memory from /data/app/com.yourprojectname-6lpCVOwATqONE4VW3QhgcA==/base.apk] (com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run+74)

Urgent help needed [closed]

$
0
0

Developers!

I hope you're all having a great day.

I really need the help of a senior React Native & FCM developer right now.

I've been working on implementing FCM for the chat functionality in my React Native app. I've opted for the HTTP v1 API, which requires an OAuth 2.0 access token. The challenge I'm facing is that this token expires within an hour.

Since I'm running a PHP server (CI) for my app under development, I can't utilize the Service Account or Admin SDK. That means I need to find a way to obtain this token within my React Native code. After some research, it seems like using react-native-app-auth might be the solution, but I'm not entirely familiar with it, especially when it comes to configuring the redirect_uri.

Would any of you be able to lend a hand and help me navigate through this issue?

Looking forward to your assistance!

Thanks a bunch!

Embedding Native Android Activity in React Native

$
0
0

I am making tab bar in android in react native using this library

https://github.com/aksonov/react-native-tabs

I have to open native android activity in one of the page.Can you please let me know how to embed android activity in react native so that tabs will be visible all the time.

Android notification permission localization (or change language)

$
0
0

enter image description hereAs you see my phone language is Turkish but permission text shows in English. When I change phone language just 'Cancel' text changed with 'İptal'.

I want the permission text to change depending on the language of the phone.Thank you in advance for your answer..

Crashlytics not sending reports from Android emulator crash?

$
0
0

I've setup Crashlytics for my React Native Expo app following this guide and configure and test following this guide.

Crash reports from Android Emulator are never sent to the console, while from iOS simulator crashes are successfully sent. For some reason the logs constantly show various random Google services crashing.

In Firebase console, Craslytics tab just says "App detected, waiting for a crash".

This is part of the output from adb logcat | grep -i crash where it shows an intended crash caused by crashlytics().crash();, and than app being restarted:

--------- beginning of crash05-07 23:32:06.474  6708  8510 E AndroidRuntime: java.lang.RuntimeException: Crash Test05-07 23:32:06.474  6708  8510 E AndroidRuntime:    at io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsModule$1.run(ReactNativeFirebaseCrashlyticsModule.java:83)05-07 23:32:06.486  6708  8510 E DevLauncher: java.lang.RuntimeException: Crash Test05-07 23:32:06.486  6708  8510 E DevLauncher:   at io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsModule$1.run(ReactNativeFirebaseCrashlyticsModule.java:83)05-07 23:32:07.064   505   825 W ActivityManager: Scheduling restart of crashed service com.google.android.googlequicksearchbox/com.google.android.apps.gsa.shared.util.keepalive.StandaloneKeepAlive$KeepAliveService in 1000ms for start-requested05-07 23:32:07.217   505   540 W ActivityManager: Scheduling restart of crashed service com.android.dialer/com.android.voicemail.impl.scheduling.TaskSchedulerJobService in 10847ms for connection05-07 23:32:09.007   505   825 W ActivityManager: Scheduling restart of crashed service com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME in 1000ms for connection05-07 23:32:09.014   505  4145 W ActivityManager: Scheduling restart of crashed service com.android.vending/com.google.android.finsky.scheduler.process.mainimpl.PhoneskyJobServiceMain in 10993ms for connection05-07 23:32:09.014   505  4145 W ActivityManager: Scheduling restart of crashed service com.android.vending/com.google.android.finsky.setup.PlaySetupServiceV2 in 20993ms for connection05-07 23:32:09.049  9648  9691 V DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils05-07 23:32:11.826 10538 10601 I org.webrtc.Logging: CrashStartupListener: Checking conference crashes for 0 account(s).05-07 23:32:11.891 10538 10619 W DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.05-07 23:32:11.926 10538 10619 I FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader dalvik.system.DelegateLastClassLoader[DexPathList[[zip file "/data/app/~~9F99x1_jvOfwerB_h9KckQ==/com.google.android.gms-4eYR5-JR7gmCVw1wXDy6qw==/split_DynamiteModulesC.apk"],nativeLibraryDirectories=[/data/app/~~9F99x1_jvOfwerB_h9KckQ==/com.google.android.gms-4eYR5-JR7gmCVw1wXDy6qw==/split_DynamiteModulesC.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]]05-07 23:32:11.930 10538 10620 W DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.05-07 23:32:11.942 10538 10620 I FirebaseCrashApiImpl: FirebaseCrash reporting API initialized05-07 23:32:11.943 10538 10620 W FirebaseCrashAnalytics: Unable to log event, missing Google Analytics for Firebase library05-07 23:32:19.148 10538 10893 I FirebaseCrash: Sending crashes05-07 23:32:30.993 10835 11164 V DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils

and this is another log:

User

--------- beginning of crash05-07 22:29:41.560  5607  5830 E AndroidRuntime: java.lang.RuntimeException: Crash Test05-07 22:29:41.560  5607  5830 E AndroidRuntime:    at io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsModule$1.run(ReactNativeFirebaseCrashlyticsModule.java:83)05-07 22:29:41.564  5607  5830 E DevLauncher: java.lang.RuntimeException: Crash Test05-07 22:29:41.564  5607  5830 E DevLauncher:   at io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsModule$1.run(ReactNativeFirebaseCrashlyticsModule.java:83)05-07 22:30:13.877  5928  5928 D SessionsDependencies: Dependency to CRASHLYTICS added.05-07 22:30:13.940  5928  5928 I FirebaseCrashlytics: Initializing Firebase Crashlytics 18.6.4 for japodium.android05-07 22:30:13.969  5928  5928 D SessionsDependencies: Subscriber CRASHLYTICS registered.05-07 22:30:14.026  5928  5928 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBJSON: true05-07 22:30:14.026  5928  5928 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: true05-07 22:30:14.027  5928  5928 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true05-07 22:30:14.027  5928  5928 I RNFBCrashlyticsInit: initialization successful05-07 22:30:14.110  5928  5961 D libcrashlytics: Initializing libcrashlytics version 3.2.005-07 22:30:14.135  5928  5961 D libcrashlytics: Initializing native crash handling successful.05-07 22:30:14.178  5928  5961 I FirebaseCrashlytics: No version control information found05-07 22:30:14.527  5928  5928 I flipper : flipper: FlipperClient::addPlugin CrashReporter05-07 22:30:14.759  5928  5970 D SessionConfigFetcher: Fetched settings: {"settings_version":3,"cache_duration":170183,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":false,"firebase_crashlytics_enabled":false,"collect_anrs":true,"collect_metric_kit":false,"collect_build_ids":true},"app":{"status":"activated","update_required":false,"report_upload_variant":2,"native_report_upload_variant":2},"fabric":{"org_id":"663a70a7fe68bd5be8e001c8","bundle_id":"japodium.android"},"on_demand_upload_rate_per_minute":10,"on_demand_backoff_base":1.2,"on_demand_backoff_step_duration_seconds":60,"app_quality":{"sessions_enabled":true,"sampling_rate":1,"session_timeout_seconds":1800}}05-07 22:30:14.877  5928  5948 D SessionLifecycleClient: Notified CRASHLYTICS of new session 59d616f9a2c14337af406f0a2737dd8005-07 22:30:14.896  5928  5948 D EventGDTLogger: Session Event: {"eventType":1,"sessionData":{"sessionId":"59d616f9a2c14337af406f0a2737dd80","firstSessionId":"59d616f9a2c14337af406f0a2737dd80","sessionIndex":0,"eventTimestampUs":1715113814871000,"dataCollectionStatus":{"performance":1,"crashlytics":2,"sessionSamplingRate":1.0},"firebaseInstallationId":"cK__aUjFRmSjU8mOmowwQB","firebaseAuthenticationToken":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjE6ODg1ODY2MjQ4MjgxOmFuZHJvaWQ6NGQwM2IxNzk5OGFkYTQwZWYxNTk0OCIsImV4cCI6MTcxNTcxODUwMCwiZmlkIjoiY0tfX2FVakZSbVNqVThtT21vd3dRQiIsInByb2plY3ROdW1iZXIiOjg4NTg2NjI0ODI4MX0.AB2LPV8wRAIgD5t9Jco3cfZqF9rWr_5r8vAmzKqpXBpv9llfxZHHEGwCIDv9lAyux6rJm4DXZxikHC-ZadZ-zVoOQd8aTcOIckWr"},"applicationInfo":{"appId":"1:885866248281:android:4d03b17998ada40ef15948","deviceModel":"sdk_gphone64_arm64","sessionSdkVersion":"1.2.4","osVersion":"14","logEnvironment":3,"androidAppInfo":{"packageName":"japodium.android","versionName":"1.0.0","appBuildVersion":"1","deviceManufacturer":"Google","currentProcessDetails":{"processName":"japodium.android","pid":5928,"importance":100,"defaultProcess":true},"appProcessDetails":[{"processName":"japodium.android","pid":5928,"importance":100,"defaultProcess":true}]}}}05-07 22:30:16.644  5928  5928 I flipper : flipper: FlipperClient::removePlugin CrashReporter05-07 22:30:17.857  5928  6044 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBJSON: true05-07 22:30:17.857  5928  6044 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: true05-07 22:30:17.857  5928  6044 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true05-07 22:30:17.857  5928  6044 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled via RNFBJSON: true05-07 22:30:17.857  5928  6044 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled final value: true05-07 22:30:17.858  5928  6044 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled via RNFBJSON: true05-07 22:30:17.858  5928  6044 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled final value: true

React Native : In-app developer menu android (genymotion)

$
0
0

I unable to access the In-App Developer Menu in android(genymotion). Everytime I press the home button, it's not showing the developer menu, and it shift my UI a bit lower which I can't revert it back, unless I kill the app and restart it again. Yes I did check in android module, it is in debug mode.

Samsung Galaxy S24 Ultra can't run React Native App

$
0
0

We're developing and maintaining an app with React Native version 0.61.5 and we got some feedbacks that says published application is not working on a specific device, Samsung Galaxy S24 Ultra. Even we tried to run the same versions as the device on emulator we can not detect the problem.

The feedback just says: "When we try to open app we got a white blank screen than waiting forever but the app is not starting"

Are there anybody here had the same issue? How we can solve or detect the issue ?

Thanks!

Duplicate Resources error on generating singed apk with react native by using @viro-community/react-viro

$
0
0

I was facing duplicate resources error on generating singed apk with react native by using @viro-community/react-viro in Viro3DObject when using objects & mtl files from local directory inside project or url.

Error shown in imageenter image description here


Appium accessibility id's different on android

$
0
0

I am trying to add testID's to my component so automated tests can be run.

I am adding the testId's like below. I have added some screenshots of the appium inspector, id for iOS and accessibility id for android are the same. How can I get accessibility id in the same format for iOS and android?

<NativeTouchableOpacity      testID={testId}      accessibilityLabel={accessibilityLabel}      ...      {...rest}>      {children}      {icon && iconStyle && <View style={iconStyle}>{icon}</View>}</NativeTouchableOpacity>

My inspector has different enter image description here

enter image description hereenter image description here

EAS build error when adding react-native-image-filter-kit

$
0
0

I am trying to implement image filters with react-native-image-filter-kit.I follow the implementation steps for with react-native >=0.64.0 from here .

I use EAS build. When i try to build a new apk i get the error below:

/home/expo/Android/Sdk/build-tools/29.0.2/llvm-rs-cc: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

In the answer here i see that i need to do the following:

or 32-bit binaries : sudo apt-get install libncurses5:i386

for 64-bit binaries : sudo apt-get install libncurses5

Also install the collection of libraries by using this command,

sudo apt-get install ia32-libs

How can i do that with a managed EAS flow?

Error Opening foldable avd: Device pixel_fold requires foldable feature, but the system image does not support

$
0
0

I was creating a foldable avd using android studio but when i tried to run i got this.Kindly help me fix this, Your Small help means a lot for me.

┌──(shivanshu㉿kali)-[~/.android/avd/Pixel_Fold_API_32.avd]└─$ emulator -avd Pixel_Fold_API_32INFO    | Storing crashdata in: /tmp/android-shivanshu/emu-crash-35.1.4.db, detection is enabled for process: 21993INFO    | Android emulator version 35.1.4.0 (build_id 11672324) (CL:N/A)INFO    | Found systemPath /home/shivanshu/Android/Sdk/system-images/android-32/google_apis_playstore/x86_64/INFO    | Storing crashdata in: /tmp/android-shivanshu/emu-crash-35.1.4.db, detection is enabled for process: 21993INFO    | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag.WARNING | Please update the emulator to one that supports the feature(s): VulkanWARNING | folded height 2092 is larger than lcd height 1840, reduced to lcd height.ERROR   | Device pixel_fold requires foldable feature, but the system image does not support. Quit.

Thank you in Advance

Android app crashing with error: [PropertyFetcher]: TimeoutException getting properties for device

$
0
0

I am trying to run a react native based application in debugging mode. But it is throwing TimeoutException.

Development Environment:using Android OS XOS v12.0.0 (OS12.0-S-P156-221214)

java --version openjdk 11.0.22 2024-01-16OpenJDK Runtime Environment (build 11.0.22+7-post-Ubuntu-0ubuntu222.04.1)OpenJDK 64-Bit Server VM (build 11.0.22+7-post-Ubuntu-0ubuntu222.04.1, mixed mode, sharing)adb --versionAndroid Debug Bridge version 1.0.41Version 34.0.1-9680074react-native: 0.72.4

Execution log:

> Task :app:installDebug[PropertyFetcher]: TimeoutException getting properties for device 0965731355092050java.lang.Throwable: TimeoutException getting properties for device 0965731355092050 at com.android.ddmlib.PropertyFetcher.handleException(PropertyFetcher.java:248) at com.android.ddmlib.PropertyFetcher$1.run(PropertyFetcher.java:211)Caused by: com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:1201) at com.android.ddmlib.AdbHelper.readAdbResponse(AdbHelper.java:353) at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:650) at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:511) at com.android.ddmlib.internal.DeviceImpl.executeShellCommand(DeviceImpl.java:719) at com.android.ddmlib.PropertyFetcher$1.run(PropertyFetcher.java:207)[PropertyFetcher]: TimeoutException getting properties for device 0965731355092050java.lang.Throwable: TimeoutException getting properties for device 0965731355092050 at com.android.ddmlib.PropertyFetcher.handleException(PropertyFetcher.java:248) at com.android.ddmlib.PropertyFetcher$1.run(PropertyFetcher.java:211)Caused by: com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:1201) at com.android.ddmlib.AdbHelper.readAdbResponse(AdbHelper.java:353) at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:650) at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:511) at com.android.ddmlib.internal.DeviceImpl.executeShellCommand(DeviceImpl.java:719) at com.android.ddmlib.PropertyFetcher$1.run(PropertyFetcher.java:207)Installing APK 'app-debug.apk' on 'Pixel_XL_API_31(AVD) - 12' for :app:debug[PropertyFetcher]: TimeoutException getting properties for device 0965731355092050java.lang.Throwable: TimeoutException getting properties for device 0965731355092050 at com.android.ddmlib.PropertyFetcher.handleException(PropertyFetcher.java:248) at com.android.ddmlib.PropertyFetcher$1.run(PropertyFetcher.java:211)Caused by: com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:1201) at com.android.ddmlib.AdbHelper.readAdbResponse(AdbHelper.java:353) at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:650) at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:511) at com.android.ddmlib.internal.DeviceImpl.executeShellCommand(DeviceImpl.java:719) at com.android.ddmlib.PropertyFetcher$1.run(PropertyFetcher.java:207)Skipping device '0965731355092050' for ':app:debug': Unknown API Level

In Emulator every thing is working fine. With some other devices it is also working fine. Not able to even install the app.

I tried:

  1. Disabling adb authorization timeout
  2. Tried revoking USB debugging authorization and then running it.

how to change react native android picker background

$
0
0

enter image description here

enter image description here

All of them work except the background, but I couldn't get the background color to work. All I want is #000 for the background, but no matter what I tried, colorBackround popupBackround etc. I tried all of them but it didn't work. Everyone on the internet gave the same link. I've been trying for about 5 6 hours, but I couldn't change the background color.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"><item name="android:forceDarkAllowed">false</item><item name="android:navigationBarColor">#151617</item><item name="android:windowBackground">#151617</item><item name="android:editTextBackground">@drawable/rn_edit_text_material</item><item name="android:spinnerItemStyle">@style/SpinnerItem</item><item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item></style><style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar"><item name="android:fontFamily">sans-serif-light</item><item name="android:textSize">18dp</item></style><style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar"><item name="android:textColor">#ffffff</item><item name="android:textSize">18dp</item><item name="android:fontFamily">sans-serif-light</item><item name="android:gravity">center</item><item name="android:background">#000</item></style><item name="android:background">@drawable/mydivider</item> // I tried that too, it didn't work

When I run it like this, all items are centered, a white page comes up background white texts white what I want is black background white text

Viewing all 29639 articles
Browse latest View live