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

"Network request failed" with react-native (even with `android:usesCleartextTraffic="true"`)

$
0
0

I did npx react-native init AwesomeProject to create a new project (I'm following the official get-started tutorial. When I simply run npx react-native start and then npx react-native run-android without tweaking anything everything works fine. But I need to make an API call, so I tried copying and pasting the example from the official network tutorial (only without the try/catch, so I can see the errors) into App.js (right after the imports):

async function getMoviesFromApiAsync() {    let response = await fetch('https://reactnative.dev/movies.json'    );    let json = await response.json();    console.log(json.movies);    return json.movies;}

Then right below it I added a call to that function:

getMoviesFromApiAsync();

That gives me a Network request failed error. This is the full error message I see on Terminal:

Fri May 08 2020 10:23:00.325]  WARN     Possible Unhandled Promise Rejection (id: 0):TypeError: Network request failedonerror@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:28005:31dispatchEvent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:34133:31setReadyState@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:33217:33__didCompleteResponse@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:33044:29emit@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:3420:42__callFunction@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:2748:49http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:2470:31__guard@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:2702:15callFunctionReturnFlushedQueue@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:2469:21callFunctionReturnFlushedQueue@[native code]

I googled around and ended up trying the following:

1) I added android:usesCleartextTraffic="true" to AndroidManifest.xml

2) I added a bunch of permissions to AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

3) I added android:networkSecurityConfig="@xml/network_security_config" to AndroidManifest.xml

4) I tried setting a proxy (10.0.2.2) and port (8081), as suggested in here

5) I tried deleting the app from the emulator and reinstalling it, as well as clearing the cache (npx react-native start --reset-cache)

Nothing seems to work. I still get the same "Network request failed" message.

I'm using React Native 0.62.2 on a Pixel 2 API 28 emulator running Android 9.0, on macOS Catalina.


Background Task stops on IOS when killed - React native expo

$
0
0

I'm building an app for get location of the phone (latitude and longitude) when the app is in foreground/background/killed.On android all works fine take the location in all the phase. Meanwhile with IOS when I open the app with Xcode it works fine, get the location meanwhile the app is killed. When I open the app and the user put the permission of the geolocation on "Always" and after that the user kill the app it doesn't get the location, but if I put the the authorization on "ask always", enter the app and give the authorization on "Always" and killed, it works. If I enter again in the app and kill it the get location on killed doesn't work again.

I used only expo library (Location - taskManager).

I used the library location for get latitude and longitude and the taskManager for the backgroundTask. I added all the permission on the Xml file.

How to solve Could not find com.mapbox.maps:android:10.16.0 react-native mapbox

$
0
0

I am working with react-native @rnmapbox/maps first time it is perfectly working in iOS devices but in Android is throwing errors while building the app.

The errors are following:

 What went wrong:Could not determine the dependencies of task ':rnmapbox_maps:compileDebugAidl'.> Could not resolve all task dependencies for configuration ':rnmapbox_maps:debugCompileClasspath'.> Could not find com.mapbox.maps:android:10.16.0.     Required by:         project :rnmapbox_maps> Could not find com.mapbox.mapboxsdk:mapbox-sdk-turf:6.11.0.     Required by:         project :rnmapbox_maps

I setup in my code in this way,

First I install the package *yarn add @rnmapbox/maps

then in android > build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {    ext {        buildToolsVersion = "33.0.0"        minSdkVersion = 21        compileSdkVersion = 33        targetSdkVersion = 33        RNMapboxMapsImpl = 'mapbox'        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.        ndkVersion = "23.1.7779620"    }    repositories {        google()        mavenCentral()        maven {            url 'https://api.mapbox.com/downloads/v2/releases/maven'            authentication {                basic(BasicAuthentication)            }            credentials {                // Do not change the username below.                // This should always be `mapbox` (not your username).                username = 'mapbox'                // Use the secret token you stored in gradle.properties as the password                password = project.properties['my-mapbox-key'] ?: ""            }        }    }    dependencies {        classpath("com.android.tools.build:gradle")        classpath("com.facebook.react:react-native-gradle-plugin")    }}

But its not working.

REACT-NATIVE: 0.72.6 I am using.

How to Edit or Update contact in react-native-contacts?

$
0
0

I am using react-native-contacts to get a contact list, delete a contact from the list, and add a contact to the list in react-native. So far I have achieved all three functionalities but to edit contact details let's say its name or number using Contacts.updateContact() is not working.You can see the below code to see what I am doing -

import React, { useState } from 'react';import { View, Text, StyleSheet, Image, TextInput, TouchableHighlight, PermissionsAndroid } from 'react-native';import Contacts from 'react-native-contacts';const EditContactScreen = ({ route, navigation }) => {    const { data } = route.params;    const [firstName, setFirstName] = useState(data.givenName);    const [lastName, setLastName] = useState(data.familyName);    const [number, setNumber] = useState(data.phoneNumbers[0].number);    const [email, setEmail] = useState('');    console.log('data>>>', JSON.stringify(data, null, 2));    const editContact = () => {        PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.WRITE_CONTACTS, {            title: 'Contacts',            message: 'This app would like to view your contacts.',            buttonPositive: 'Please accept bare mortal',        })            .then((res) => {                console.log('Permission: ', res);                if (res === 'granted') {                    let updatedContact = {                        recordID: data.recordID,                        emailAddresses: [{                            label: 'work',                            email: email,                        }],                        phoneNumbers: [{                            label: 'mobile',                            number: number,                        }],                        familyName: lastName,                        givenName: firstName,                    };                    Contacts.updateContact(updatedContact).then(() => {                        console.log('Contact updated successfully');                        navigation.goBack();                    }).catch(error => {                        console.log('Error updating contact:', error);                    });                }            })            .catch((error) => {                console.error('Permission error: ', error);            });    };    const onSubmit = () => {        editContact();    };    return (<View style={styles.container}><TextInput                style={styles.input}                placeholder="First Name"                defaultValue={firstName}                onChangeText={text => setFirstName(text)}                placeholderTextColor={'#555'}                cursorColor={'#555'}            /><TextInput                style={styles.input}                placeholder="Last Name"                defaultValue={lastName}                onChangeText={text => setLastName(text)}                placeholderTextColor={'#555'}                cursorColor={'#555'}            /><TextInput                style={styles.input}                placeholder="Phone Number"                defaultValue={number}                onChangeText={text => setNumber(text)}                placeholderTextColor={'#555'}                keyboardType="numeric"                cursorColor={'#555'}            /><TouchableHighlight                    style={[styles.button]}                    onPress={onSubmit}><Text style={styles.btnText}>Save Contact</Text></TouchableHighlight></View>    );};export default EditContactScreen;

I am getting data through route.params from ContactDetail Screen and from that passing recordId to the updatedContact, now whenever I call for editContact() after editing it is giving me error as

Error updating contact: [Error: Invalid recordId or rawContactId]

Even Though as you can see I am passing the recordId correctly but still it is giving me error so what should I do?

Fetch with basic authentication works with Postman but not in Javascript

$
0
0

I'm stuck for several hours on a tricky problem.

I would like to access the Windows Device Portal Api (access the Api of a connected Hololens 2 on the same network of the client) but I kept getting a Network Request Failed from Javascript.

The fact is, that request is working well on Postman, but, even when I am stupidly copying the example javascript code from Postman, it still doesn't work.

The result on Postman:

{"ComputerName": "HoloLens2-05","Language": "en-US","OsEdition": "Holographic","OsEditionId": 136,"OsVersion": "22621.1272.arm64fre.ni_release_svc_sydney_rel_prod.240403-0940","Platform": "HoloLens 2"}

Here is my setup:

  • React Native 0.73
  • Targeting Android (simulator or device, they both don't work)
  • IDE: VSCode on Windows

What I did:

  1. Copying the code from Postman:
var myHeaders = new Headers();myHeaders.append("Authorization", "Basic base64here");myHeaders.append("Cookie", "CSRF-Token=csrfTokenHere");var raw = "";var requestOptions = {  method: 'GET',  headers: myHeaders,  body: raw,  redirect: 'follow'};fetch("https://hololensnetworkip/api/os/info", requestOptions)  .then(response => response.text())  .then(result => console.log(result))  .catch(error => console.log('error', error));
  1. Set the AndroidManifest in android/src/main:
<uses-permission android:name="android.permission.INTERNET" /><application    android:usesCleartextTraffic="true">
  1. Trying the Windows Device Portal suggestion of applying an "auto-" prefix on the login (https://learn.microsoft.com/en-us/windows/uwp/debug-test-perf/device-portal#csrf-protection-and-scripting):enter image description here

I know the Windows Device Portal facing issues with not valid certificate status, but why is it working on Postman ? Or why is it working with a call from .Net client ?

Thanks anyway for your hints, I'll keep searching on my side.

Sending event from Android to JavaScript caused memory leak despite unsubscribed in useEffect

$
0
0

I followed the documentation on how to emit an event from native side to react-native.

I have a RecyclerViewScrollListener, which is defined like this.Basically, I want to send the current item's index to React-Native, like the FlatList's onViewableItemsChanged event.

        scrollListener = object : RecyclerViewScrollListener() {            override fun onItemIsFirstVisibleItem(index: Int) {                Log.d("visible item index", index.toString())                // play just visible item                if (index != -1) {                    PlayerViewAdapter.playIndexThenPausePreviousPlayer(index)                    eventEmitter.emitEvent("onVisibleItemChanged", index)                 }            }        }        recyclerView!!.addOnScrollListener(scrollListener)

It is defined in TikTokScreenFragment's onViewCreated

    override    fun onViewCreated(view: View, savedInstanceState: Bundle?) {        super.onViewCreated(view, savedInstanceState)        setAdapter() // this is where the scroll listener is set up        // load data        val model: MediaViewModel by activityViewModels()        model.getMedia().observe(requireActivity(), Observer {            mAdapter?.updateList(arrayListOf(*it.toTypedArray()))        })    }

The eventEmitter.emitEvent implementation is as below inside a ViewManager that later will be listed in my custom ReactPackage:

class MyViewManager(    private val reactContext: ReactApplicationContext) : ViewGroupManager<FrameLayout>() {    override fun receiveCommand(        root: FrameLayout,        commandId: String,        args: ReadableArray?    ) {        super.receiveCommand(root, commandId, args)        val reactNativeViewId = requireNotNull(args).getInt(0)        when (commandId.toInt()) {            COMMAND_CREATE -> createFragment(root, reactNativeViewId)        }    }    fun createFragment(root: FrameLayout, reactNativeViewId: Int) {        val parentView = root.findViewById<ViewGroup>(reactNativeViewId)        setupLayout(parentView)        val eventEmitter = object : EventEmitter {            override fun emitEvent(eventName: String) {                reactContext                    .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)                    .emit(eventName, null)            }            override fun emitEvent(eventName: String, eventData: Int) {                reactContext                    .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)                    .emit(eventName, eventData)            }        }        val myFragment = TikTokScreenFragment(eventEmitter)        val activity = reactContext.currentActivity as FragmentActivity        activity.supportFragmentManager            .beginTransaction()            .replace(reactNativeViewId, myFragment, reactNativeViewId.toString())            .commit()    }}

On the react side, I use NativeEventEmitter to subscribe for the changes in a useEffect and set the returned Index to a state:

  useEffect(() => {    const eventEmitter = new NativeEventEmitter();    const onVisibleItemChanged = eventEmitter.addListener("onVisibleItemChanged",      function (e: Event) {        // handle event.        setVisibleIndex(e as unknown as number);      }    );    console.log("listening to onVisibleItemChanged");    return () => {      console.log("removing onVisibleItemChanged listener");      onVisibleItemChanged.remove();    };  }, []);

I observed the memory in the Android memory profiler sky-rocketed while scrolling through the screen. If I commented out the eventEmitter.addListener, the problem disappeared.

Any suggestions or thoughts about what I can try are welcome. I'm a newbie in Android development, so I'm probably doing something wrong along the way.

Can't Find Installed React Native Android App On Phone and Emulator?

$
0
0

So something strange happened, when developing I noticed that my react-native app compiled but wasn't visible (not found on the apps list/tray) on my emulator although the react-native run-android launches it (both debug and release) but when I go to Settings > Apps I can see the app listed there, I thought this was some new thing to react for dev environments, but I noticed that after compiling my app as release I can't find it on the phone until I go to Settings > Apps and even from there I can't launch.

Another thing I first noticed was, that the first time I compile the release, while trying to install a notice appeared on my screen saying, Google play connect rejected my app, and at first I couldn't install the app, but after rerunning the compilation I was able to, but now the app can't be launched.

I tried to re-build , did ./gradelw clean and also update the build version nothing works for me .

How to change cursor position when press in TextInput

$
0
0

For example i have a TextInput like this

<ScrollView style={{flex: 1}}><TextInput        placeholder="Input"        style={{fontSize: 50}}        value={'Sample text'}      /></ScrollView>

So normally, when we click on the TextInput, it will automatic show caret at the end of text ( on android ), no matter where we click, at the first time, it will have the caret at the end, like this

enter image description here

BUT HOW can we set the caret in where we click, for example when we click the "m" letter, it will have caret after the "m", like this

enter image description here

Problem is, as i said, on android we always have the the caret at the end first, then if we click other, the caret will more to that, like this

enter image description here

I mean, it not a problem when text is short, but imagine, the text will like this

enter image description here

And we want to edit some text that already exist, so it scroll all the way down to the bottom (because the bottom contain the lastest text)

So my question is

HOW CAN WE SET THE CARET ON WHERE WE TOUCH (OR CLICK), NOT FROM LASTEST WORD IN TEXTINPUT?


Error 400: invalid_request for expo google sign in

$
0
0

I am working on a React Native to build out iOS and Android apps. I am trying to google sign in in cross platform app.

npm show expo-auth-session version5.4.0

I'm get the following error for android:

Error 400: invalid_request

You can't sign in to this app because it does not comply with Google's OAuth 2.0 policy for keeping apps secure.You can let the app developer know that this app doesn't comply with one or more Google validation rules.

It then says in the Request Details section:

If you're the app developer, make sure that these request details comply with Google's policies.

redirect_uri: exp://192.168.1.7:8081:19000

I did go into my Authorised redirect URIs and try to add exp://192.168.1.7:8081 but it's not allowed.

import { View, Text, Image, ScrollView,StyleSheet,Button} from "react-native";import { SafeAreaView } from "react-native-safe-area-context";import * as Google from "expo-auth-session/providers/google";import * as WebBrowser from 'expo-web-browser';import React, {useState,useEffect} from 'react'WebBrowser.maybeCompleteAuthSession();export default function App() {  const [accessToken, setAccessToken] = React.useState();  const [userInfo, setUserInfo] = React.useState();  const [message, setMessage] = React.useState();  const [request, response, promptAsync] = Google.useAuthRequest({    androidClientId: 'abc.apps.googleusercontent.com',    iosClientId: 'def.apps.googleusercontent.com',    expoClientId: 'ghi.apps.googleusercontent.com',    scopes: ["profile", "email"],  });  React.useEffect(() => {    setMessage(JSON.stringify(response));    if (response?.type === "success") {      setAccessToken(response.authentication.accessToken);    }  }, [response]);  async function getUserData() {    let userInfoResponse = await fetch("https://www.googleapis.com/userinfo/v2/me", {      headers: { Authorization: `Bearer ${accessToken}`}    });    userInfoResponse.json().then(data => {      setUserInfo(data);    });  }  function showUserInfo() {    if (userInfo) {      return (<View style={styles.userInfo}><Image source={{uri: userInfo.picture}} style={styles.profilePic} /><Text>Welcome {userInfo.name}</Text><Text>{userInfo.email}</Text></View>      );    }  }  return (<SafeAreaView><ScrollView        contentContainerStyle={{          height: "100%",        }}><View className="w-full flex justify-center items-center h-full px-4">          {showUserInfo()}<Button             title={accessToken ? "Get User Data" : "Login"}            onPress={accessToken ? getUserData : () => { promptAsync({useProxy: true, showInRecents: true}) }}          /></View></ScrollView></SafeAreaView>  );}

PS: Before marking as a duplicate, I know Expo Google Sign In: Error 400: invalid_requestis a question, but it's been 17 months and it's without an accepted solution, so I'm trying to get help from community . I've also attached the code which was missing in rhe existing question.

React-native Listview inside Scrollview not scrolling in android

$
0
0

In our React-native project, We have a screen which is having a parent Scrollview(with pull to refresh) and with in scrollview we have Listview (as chilld view).

In iOS we are able to scroll Scrollview(Parent) as well as Listview(child view).

But in android, We are not able to scroll the Child Listview. When we try to scroll the child Listview, The Parent view is getting scrolled. The child view is not getting the Touch.

Is this related to React-native issue? Can anyone tell me how to solve this issue?

Code snippet:

<ScrollView contentContainerStyle={styles.contentContainerStyle} refreshControl={this.getRefreshControl()}><View> Some header </View><MyComponent> </MyComponent><ListView /* This list view is not scrolling in Android */        dataSource={dataSource}        initialListSize={10}        renderRow={this.renderRow}        renderSeparator={this.renderSeparator}/></ScrollView>

How to solve (Could not initialize class org.codehaus.groovy.reflection.ReflectionCache) issue in react native

$
0
0

$ npx react-native run-androidinfo Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 864 file(s) to forward-jetify. Using 4 workers...info Starting JS server...info Launching emulator...error Failed to launch the emulator. Reason: Could not start an emulator within 30 seconds.warn Please launch an emulator manually or connect a device. Otherwise, the app may fail to launch.info Installing the app...

FAILURE: Build failed with an exception.

  • What went wrong:Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

  • 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.org

BUILD FAILED in 1m 23s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • What went wrong:Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

  • 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.org

BUILD FAILED in 1m 23s

at checkExecSyncError (child_process.js:629:11)at execFileSync (child_process.js:647:13)at runOnAllDevices (E:\work\react-native\AwesomeProject1\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)

I have error when i run android app by react native

$
0
0

BUILD FAILED in 25serror Failed to install the app. Command failed with exit code 1: gradlew.bat tasks FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\Admin\Desktop\Attendance_MoblieApp\android\app\build.gradle' line: 128 * What went wrong: A problem occurred evaluating project ':app'. > Plugin with id 'org.jetbrains.kotlin.android' not found. * 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.org BUILD FAILED in 25s
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details > Task :gradle-plugin:compileKotlin UP-TO-DATE > Task :gradle-plugin:compileJava NO-SOURCE > Task :gradle-plugin:pluginDescriptors UP-TO-DATE > Task :gradle-plugin:processResources UP-TO-DATE > Task :gradle-plugin:classes UP-TO-DATE > Task :gradle-plugin:jar UP-TO-DATE > Task :gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE 5 actionable tasks: 5 up-to-date.

I have get this error went to run npx react-native run-android

I want resolve this problem Can every help me resolve this

I have error when i run android app by react native: Plugin with id 'org.jetbrains.kotlin.android' not found

$
0
0
BUILD FAILED in 25serror Failed to install the app. Command failed with exit code 1: gradlew.bat tasks FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\Admin\Desktop\Attendance_MoblieApp\android\app\build.gradle' line: 128 * What went wrong: A problem occurred evaluating project ':app'.> Plugin with id 'org.jetbrains.kotlin.android' not found. * 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.org BUILD FAILED in 25s     Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details> Task :gradle-plugin:compileKotlin UP-TO-DATE> Task :gradle-plugin:compileJava NO-SOURCE> Task :gradle-plugin:pluginDescriptors UP-TO-DATE> Task :gradle-plugin:processResources UP-TO-DATE> Task :gradle-plugin:classes UP-TO-DATE> Task :gradle-plugin:jar UP-TO-DATE> Task :gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE 5 actionable tasks: 5 up-to-date. 

I have get this error went to run npx react-native run-android

I want resolve this problem Can every help me resolve this

React-native unable to run-android

$
0
0

Following this: https://facebook.github.io/react-native/docs/getting-started.html ,I've created an empty project and am trying to run it by doing:sudo react-native run-androidThis is what is produced:

Starting JS server...Building and installing the app on the device (cd android && ./gradlew installDebug...Downloading https://services.gradle.org/distributions/gradle-2.4-all.zipException in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

(I can post the rest of the error if that would be useful). Does anyone have any advice?

react-native-modal-datetime-picker issue with daylight saving time zone

$
0
0

I have been using react-native-modal-datetime-picker package for my react native mobile application and came across an issue.

In the date picker I need to have a default selected date as '1985-08-17' and when the time zone is America/Mexico_City (-05:00) the default selected date becomes the previous day which is '1985-08-16'.

Is there any thing that I have done wrong in the below code sample?

<DateTimePicker    isVisible={true}    date={new Date('1985-01-17')}    onConfirm={()=>()}    onCancel={()=>()}    mode={'date'}/>

In the same CDT time zone when I change the device timezone to America/Chicago this issue is not reproducible.


react native 0.73.6 authorization header not sent in fetch

$
0
0

Status Code: 401 Unauthorized

this is the header request

access-control-request-headers: authorization,x-requested-withauthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiMzEyNzc2ZmFiZGQyYjllYTBiMWM1ODRjNmI0Mzg2NzQ5YmVlY2YwM2ZlMGIwOGE4NDgxMmFkYmRlNDcyZDNiNTE3NjkxY2RmOGNiYjQzNTAiLCJpYXQiOjE3MTM3NjQxMzIuNjEwMjM3LCJuYmYiOjE3MTM3NjQxMzIuNjEwMjQzLCJleHAiOjE3NDUzMDAxMzIuNTk2Njc2LCJzdWIiOiIxNSIsInNjb3BlcyI6W119.ejjZExqN7EhoXAp0p_wUeBVq6gzQlOGBNzAhmbXyKzCzVdL5pw5BcySlns1K2rLn5KoyVU8kw_-VJfT3RWe_UB83uakzz47-w1fd2a89NpwIY1e36eKbOFS9QLpX6xDzeiLou1RS06Lpw66ukD5MdsPJrooIiuleD_2KjEMfXjF0PRRn3khk0smi1ze4C7P1HCzWplXosG4OMSw_zeyBgVSDp3WNv7rHfOIFlt9vSjLk0BmdwhV5a61IA948txJQyMRmTAtXy06C7enSQ39S6DQiNPolCtHvJkqdkYE2A8nlQyVt-aeRUgwFPqXdlBXSwfe5E9FB5Pyis1OJykwxXM6b3e_VzoP6sCYH-8TO_3C38W-XHuiWVAnQdnc673HEK0j8evKMNotnjEJf4hLqsae4ufmJNOiOXdgANZL-gxdSllX7HVWh1H2pJk9clAI8ZhL0fe9qTMTrtpCoypc7jF_5tAyQFKnxI632cHHyjedVByA9Nog-a3_rqduMTmsvc8km4bo-ss1u84L_DrS4IrYoJnP3sEiRgI8dMDwHvwpaNm51tvVIY9oLBRRg3UFYxvq-TaR69WVatkgd2ilPFIu_818tTzjsopF95PBlV_09qurHSGMnH3nKq7tjqSlprgG3vZiKxHgsaikbjvpzdOnU8sSdtsO74HjmRyf4FmA

export const listCompany = async (data) => {try {const res = await axios.post(http://myserver:8000/collect_review/public/index.php/api/company/list,null,{ headers:{'Authorization': Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiMzEyNzc2ZmFiZGQyYjllYTBiMWM1ODRjNmI0Mzg2NzQ5YmVlY2YwM2ZlMGIwOGE4NDgxMmFkYmRlNDcyZDNiNTE3NjkxY2RmOGNiYjQzNTAiLCJpYXQiOjE3MTM3NjQxMzIuNjEwMjM3LCJuYmYiOjE3MTM3NjQxMzIuNjEwMjQzLCJleHAiOjE3NDUzMDAxMzIuNTk2Njc2LCJzdWIiOiIxNSIsInNjb3BlcyI6W119.ejjZExqN7EhoXAp0p_wUeBVq6gzQlOGBNzAhmbXyKzCzVdL5pw5BcySlns1K2rLn5KoyVU8kw_-VJfT3RWe_UB83uakzz47-w1fd2a89NpwIY1e36eKbOFS9QLpX6xDzeiLou1RS06Lpw66ukD5MdsPJrooIiuleD_2KjEMfXjF0PRRn3khk0smi1ze4C7P1HCzWplXosG4OMSw_zeyBgVSDp3WNv7rHfOIFlt9vSjLk0BmdwhV5a61IA948txJQyMRmTAtXy06C7enSQ39S6DQiNPolCtHvJkqdkYE2A8nlQyVt-aeRUgwFPqXdlBXSwfe5E9FB5Pyis1OJykwxXM6b3e_VzoP6sCYH-8TO_3C38W-XHuiWVAnQdnc673HEK0j8evKMNotnjEJf4hLqsae4ufmJNOiOXdgANZL-gxdSllX7HVWh1H2pJk9clAI8ZhL0fe9qTMTrtpCoypc7jF_5tAyQFKnxI632cHHyjedVByA9Nog-a3_rqduMTmsvc8km4bo-ss1u84L_DrS4IrYoJnP3sEiRgI8dMDwHvwpaNm51tvVIY9oLBRRg3UFYxvq-TaR69WVatkgd2ilPFIu_818tTzjsopF95PBlV_09qurHSGMnH3nKq7tjqSlprgG3vZiKxHgsaikbjvpzdOnU8sSdtsO74HjmRyf4FmA,'Accept': 'application/json','Content-Type': 'application/json',
}})
console.log(res)return res}catch (err) {return err}}

How can i solve this type of exception

$
0
0

FAILURE: Build failed with an exception.

  • What went wrong:java.io.UncheckedIOException: Could not move temporary workspace (C:\Users\subug\OneDrive\Desktop\React CLI Project\AwesomeProject\android.gradle\8.6\dependencies-accessors\423f0288fa7dffe069445ffa4b72952b4629a15a-00f145fb-33a6-47aa-96fd-300b0f75f2e0) to immutable location (C:\Users\subug\OneDrive\Desktop\React CLI Project\AwesomeProject\android.gradle\8.6\dependencies-accessors\423f0288fa7dffe069445ffa4b72952b4629a15a)

Could not move temporary workspace (C:\Users\subug\OneDrive\Desktop\React CLI Project\AwesomeProject\android.gradle\8.6\dependencies-accessors\423f0288fa7dffe069445ffa4b72952b4629a15a-00f145fb-33a6-47aa-96fd-300b0f75f2e0) to immutable location (C:\Users\subug\OneDrive\Desktop\React CLI Project\AwesomeProject\android.gradle\8.6\dependencies-accessors\423f0288fa7dffe069445ffa4b72952b4629a15a)

How to solve this exception.Give me an solution.

React Native: Failed to launch emulator - "The emulator quit before it finished opening"

$
0
0

I'm encountering an issue while trying to run my React Native project on Android using npx react-native run-android. The error message I'm receiving is:

Failed to launch emulator. Reason: The emulator quit before itfinished opening. You can try starting the emulator manually from theterminal with: emulator @INFO | Storing crashdata in:/tmp/android-mypc/emu-crash-34.1.18.db, detection is enabled forprocess: 21525.

I've tried running the emulator manually as suggested, but I'm still facing the same problem. Can anyone help me understand what might be causing this issue and how to resolve it?

I'm using a macOS system.

React Native system gesture

$
0
0

enter image description hereenter image description hereTo use system gestures (Pixel 6a), you need to duplicate themso that a bar appears at the bottom.How to make it respond to system gestures immediately by default and make the bar at the bottom always active

I've been doing a lot of research and looking at the libs, and I can't find anything.

React Native Expo hide android hide navigation bar

$
0
0

enter image description here

I'm developing an app and I want users to not be able to exit the app via the Android navigation bar, what can I do?

In the app.json file, I'm putting the following:enter image description here

When I'm in development using npx expo start, the navigation bar behaves as expected. But when I create an APK, the bar always remains visible.

To have the bar always hidden.

Viewing all 29467 articles
Browse latest View live


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