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

React-Native Customized Marker Slows Down Application

$
0
0

When I use customized marker, the system starts to get heavy after a few processes. But if I use it without customization, there is no problem. I share a screenshot of my Marker's code, why I may have encountered such a problem.

So it's okay if I use the default marker. But if I designed it myself it works very slowly.

Number of Markers: 50

Library: react-native-maps, react-native-vector-icons/FontAwesome5

enter image description here


overlay housing society maps

$
0
0

I want to overlay housing society maps on google maps exact like this for my App and website.just like the following link.https://www.zameen.com/plotfinder/It doesn't seem that they overlay the images on google maps because when you zoom-in or zoom-out the quality of text & map changes. The more zoom-in the more good quality for best deep visibility. I want exactly this thing. they used MapBox for this purpose so you can better help me. I don't know which services and plans i have to purchase from your website to accomplish this target.

Also guide me how to do this what they did "https://www.zameen.com/plotfinder/".Did they create new map lines and plot numbers on that?

RegardsMuhammad Adnan

url.pathname or url.searchParams is not a function in android react native

React Native: debug/AndroidManifest.xml vs main/AndroidManifest.xml?

$
0
0

I'm working on a React Native app, and often documentation will refer to AndroidManifest.xml. There are two files: debug/AndroidManifest.xml and main/AndroidManifest.xml. I can usually tell which one they mean by looking at the existing code in each file, but I'm wondering what the difference is between these two files, and specifically, why wouldn't all the code that we apply to one have to be applied to the other as well?

Force Gradle to use HTTP instead of HTTPS

$
0
0

I am trying to build react-native android app, as a dependecy I see I have gradle, but it fails to load on build.Error message:

* What went wrong:A problem occurred configuring root project 'MobileApp'.> Could not resolve all dependencies for configuration ':classpath'.> Could not resolve com.android.tools.build:gradle:1.3.1.     Required by:         :MobileApp:unspecified> Could not resolve com.android.tools.build:gradle:1.3.1.> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom'.> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom'.> Connection to https://jcenter.bintray.com refused

The issue is clear, I am sitting behind corporate proxy that blocks any HTTPSconnections like these in error.So my questions are: how to force gradle to use HTTP in loading these files? Where these properties should be put(which of gradle files, i.e. gradle.properties)?

P.S. I already have set these in gradle properties file:

systemProp.http.proxyHost= myHostsystemProp.http.proxyPort= myPortsystemProp.http.proxyUser= myUsersystemProp.http.proxyPassword= myPassword

Any links, suggestions or etc. will help a lot.

constant variable is not use in react-native at release version

$
0
0

I have a constant variable where I set it as domain address

const webDomain = 'http://projectname.company.com/';

On development mode where I run npx react-native run-android, there is no problem on Splash screen located at ./src/init/initSplash.js to get this variables. But when I build the app as relase apk, the variable is likely not retrieved as there is alert that I placed where it says that it is not connected to my web domain. The variables to be use globally on API fetch URL will be replaced at AppGlobal.constRESTful = webDomain +'api/store';

FULL SPLASH SCREEN SCRIPT:

import React, { Component } from 'react';import { BackHandler, View, Image, Dimensions, StatusBar } from 'react-native';const { width } = Dimensions.get('window');import { Container, Content, Header, Text } from 'native-base';import AsyncStorage from '@react-native-community/async-storage';import DeviceInfo from 'react-native-device-info';import { returnWarning } from '../../components/AwaitModal';import { Base64 } from 'js-base64';import splashLogo from '../../images/splashLogo.png';const webDomain = 'http://projectname.company.com/';import Loader from '../../components/Loader';import * as ApiFunction from '../../services/ApiFunction';import * as AppGlobal from '../../services/AppGlobal';export default class InitSplash extends Component {    constructor(props) {        super(props);        _isMounted = false;        this.state = {            loading: false,            waitText: '',            progressText: '',            isError: false,            isConnected: true,            tokenID: '',            token: '',        };        this.timer = null;        this.handleBackButton = this.handleBackButton.bind(this)    }    componentDidMount = async () => {        AppGlobal.constRESTful = webDomain +'api/store';        BackHandler.addEventListener('hardwareBackPress', this.handleBackButton);        const data = await this.performTimeConsumingTask();        if (data !== null) {            setTimeout(async () => {                this.setState({ progressText: 'Getting app ready...' });            }, 500);            if (AppGlobal.constUserID > -1) {                this.props.navigation.navigate('MainDashboard');            } else {                await this.IsConnectionAvailable()                    .then(async (response) => {                        if (response === 'OK') {                            this.props.navigation.navigate('MainAuth');                        }                    }).catch(async () => {                        await returnWarning('Not connected', 'Failed to check connection with web server.')                        this.props.navigation.navigate('MainAuth');                    });;            }        } else {            setTimeout(() => {                this.setState({ progressText: 'Unable to get all mandatory configuration' });                this.props.navigation.navigate('MainAuth');            }, 500);        }    }    componentWillUnmount() {        this._isMounted = false;        BackHandler.removeEventListener('hardwareBackPress', this.handleBackButton);    }    handleBackButton() {        return true;    }    IsConnectionAvailable = async () => {        return new Promise(async (resolve, reject) => {            await ApiFunction.HelloServer()                .then((response) => {                    this.setState({ progressText: 'Server reply: '+ response, isConnected: true });                    resolve('OK');                })                .catch(e => {                    //console.log('Unable to get response from web server. '+ e);                    this.setState({ progressText: 'Unable to connect to webserver', isConnected: false });                    reject('Unable to connect to webserver');                    throw error;                });        });    }    performTimeConsumingTask = async () => {        return new Promise(async (resolve) => {            await this._loadConfig();            setTimeout(() => { resolve('result') }, 500)        });    }    _loadConfig = async () => {        var userToken = await AsyncStorage.getItem('USER_TOKEN');        if (typeof userToken !== 'undefined') {            var decodeToken = Base64.decode(userToken).split('|');            this.setState({ tokenID: decodeToken[0], token: userToken });            if (parseInt(decodeToken[0]) > -1) {                AppGlobal.constUserID = parseInt(decodeToken[0]);            }        }    }    renderOffline() {        return (<View style={{                backgroundColor: '#b52424',                height: 30,                justifyContent: 'center',                alignItems: 'center',                flexDirection: 'row',                width,                position: 'absolute',                top: 30            }}><Text style={{ color: 'white' }}>No Internet Connection</Text></View>        )    }    render() {        return (<Container><StatusBar hidden={true} /><Loader loading={this.state.loading} waitText={this.state.waitText} /><Header style={{ display: 'none' }} />                {!this.state.isConnected ? this.renderOffline : null}<Content padder contentContainerStyle={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}><Text style={{ fontSize: 40}}>MY STORE</Text><Image                        source={splashLogo}                        style={{                            width: '50%',                            height: '50%',                            alignItems: 'center',                            justifyContent: 'center',                            marginBottom: 10                        }}                        resizeMode={"contain"}                    /><Text>{this.state.progressText}</Text></Content></Container>        );    }}

Why is this happen on release version? Image from folder also cannot read. Just happen for this project currently. On my previous project few month ago, I'm not facing these kind of things. I'm clueless about what is going on.

React - error: package expo.modules.updates does not exist

$
0
0

I ejected expo from my react project. But when I tried to run it on android I got an error saying

error: package expo.modules.updates does not exist

And it actually comes up from MainApplication.java on my android folder.

import expo.modules.constants.ConstantsPackage;import expo.modules.permissions.PermissionsPackage;import expo.modules.filesystem.FileSystemPackage;import expo.modules.updates.UpdatesController;

I think expo not completely removed from my project. How do I resolve this issue? Thanks.

Edit : Here's my package.json maybe it can help.

{"scripts": {"start": "react-native start","android": "react-native run-android","ios": "react-native run-ios","web": "expo start --web"  },"dependencies": {"@babel/runtime": "^7.10.2","@react-native-community/cli-platform-android": "^4.9.0","@react-native-community/masked-view": "0.1.10","@react-navigation/material-top-tabs": "^5.1.10","axios": "^0.19.2","moment": "^2.26.0","native-base": "^2.13.12","prop-types": "^15.7.2","react": "~16.9.0","react-dom": "16.11.0","react-native": "~0.61.5","react-native-cardview": "^2.0.5","react-native-elements": "^2.0.0","react-native-floating-labels": "^1.1.9","react-native-gesture-handler": "^1.6.1","react-native-gifted-chat": "^0.16.1","react-native-hide-show-password-input": "^1.1.0","react-native-image-header-scroll-view": "^0.10.3","react-native-material-menu": "^1.1.3","react-native-reanimated": "^1.8.0","react-native-safe-area-context": "0.7.3","react-native-screens": "^2.7.0","react-native-tab-view": "^2.14.0","react-native-unimodules": "~0.9.0","react-native-vector-icons": "^6.6.0","react-native-web": "~0.11.7","react-navigation": "^4.3.9","react-navigation-stack": "^2.3.13","react-navigation-tabs": "^2.8.12","realm": "^5.0.4"  },"private": true,"devDependencies": {"@babel/core": "^7.9.6","babel-jest": "~25.2.6","jest": "~25.2.6","react-test-renderer": "~16.9.0"  }}

React Native Push Notification works on debug but on release - android

$
0
0

I see there is an open issue for react-native-push-notification. Just wondering if anyone faced this issue.

I have tested my react native app when developing for android 8 and android 9. Push notification does show up in debug on device. But when I build apk from the same code, everything works other than the push notification.

As a note, it is an expo application and I use npx jetify manually for androidX conversion then expo publish and then android release build.


Why is mapPadding Prop not giving any padding on iOS devices when padding is specified?

$
0
0

I'm having an issue in which upon rendering a map using react-native-maps we are not able to display map padding on iOS devices only.

It's interesting because, Android devices do display the map padding properly, but iOS devices won't show any padding at all when that prop is set.

Here is the following code that works on Android devices but NOT iOS devices in regards to mapPadding:

<MapView          ref={(map) => (this.map = map)}          mapPadding={{ top: 0, right: 0, bottom: 550, left: 0 }}          paddingAdjustmentBehavior="always"          initialRegion={{            latitude: 30.2303 - 0.0123,            longitude: -97.7538,            latitudeDelta: 0.2,            longitudeDelta: 0.1,          }}          style={styles.mapStyle}>          {crawlCard.map((crawl, index) => {            return (<Marker                coordinate={{                  latitude: crawl.coords.lat,                  longitude: crawl.coords.lon,                }}                title={crawl.title}                key={index}                onSelect={() => {                  this.map.animateToRegion(                    {                      latitude: crawl.coords.lat,                      longitude: crawl.coords.lon,                    },                    200                  );                }}              />            );          })}</MapView>

Is there any other function/method we need to implement to get this mapPadding prop to work on iOS devices? All examples my team & I have seen have used the mapPadding just like this for both platforms.

We're using:React Native 5.xreact-native-maps 0.26.1

Any assistance would be greatly appreciated. Thank you kindly!

Could not resolve all files for configuration ':classpath'

$
0
0

i am developing sample application in react-native , i faced this issue when i was run- android emulator my sdk tool version is 25 , but i don't know how it is getting this issue please let me suggestion.

> Could not resolve all files for configuration ':classpath'.> Could not resolve com.android.tools.build:gradle:3.1.0.     Required by:         project :> Could not resolve com.android.tools.build:gradle:3.1.0.> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.pom'.> org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)> Could not resolve com.android.tools.build:gradle:3.1.0.> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.pom'.> org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)> Could not resolve com.google.gms:google-services:3.2.0.     Required by:         project :> Could not resolve com.google.gms:google-services:3.2.0.> Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom'.> org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)> Could not resolve com.google.gms:google-services:3.2.0.> Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom'.> org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)* 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

React-Native-Video disables TouchableOpacity in Android

$
0
0

I am working on a react native app which involves a video player (react-native-video), and some simple controls I set up myself. on iOS this works fine, but on Android the TouchableOpacity elements, which I use for controls and navigation, don't seem to detect touches. (Navigation is handles by react-native-fluid-transitions in my app). When I turn on the inspector, a screen-covering View seems to be on top of my controls. However, this is not the case on iOS and I have also not configured such a view.

I installed Atom to use it's inspector feature to see the actual order of my views. It looks as follows:

enter image description here

VideoView is the name of my component, Video is the actual video player and the TouchableOpacity I highlighted is the button I'm trying to get to work. In this view hierarchy, no views seem to be on top of anything. I have also compared this breakdown to other components where my buttons actually work and it looks the same.

My code looks as follows:

return (<View style={internalStyles.container}><Video style={internalStyles.videoContainer}            ref={(ref) => {             this.props.player = ref            }}            source={{uri: url}}            controls={false}            onEnd={() => this.videoEnded()}            paused={this.state.paused}            muted={false}            repeat={false}            resizeMode={"contain"}            volume={1.0}            rate={1.0}            ignoreSilentSwitch={"obey"}          />                      {this.renderControls()}        {Renderer.getInstance().renderNavigationButton()}</View>  );

where renderControls is a function that renders the pause button, and Renderer is a singleton component containing render function for items I use in more components of my app. This all works fine on iOS, but not on Android. react-native-video seems to be incompatible with react-native-fluid-transitions as everything works when I remove one of either.

Does anyone know what might cause this behavior? Any help would be highly appreciated.

on tap of minicontroller is not taking to extended controller in android chromecast

$
0
0

why minicontroller is not taking to extended controller on Tap of it. I added the below code for minicontroller as given in Codelabs

<fragment            android:id="@+id/castMiniController"            class="com.google.android.gms.cast.framework.media.widget.MiniControllerFragment"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_gravity="end"            android:visibility="gone"            app:layout_constraintBottom_toBottomOf="parent"            app:layout_constraintEnd_toEndOf="parent"            app:layout_constraintStart_toStartOf="parent" />

But on in my case the minicontroller's progress bar is not on bottom, it's coming on top of minicontroller block.

And on tapping it it is not taking to Extended controller activity why ?

Task :react-native-webview:compileDebugJavaWithJavac FAILED

$
0
0

I keep getting this error, when I try running my React Native application after installing the react-native.webview package. Please what could I be doing wrong.

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 1135 file(s) to forward-jetify. Using 8 workers...info Starting JS server...info Installing the app...Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details> Task :react-native-webview:compileDebugJavaWithJavac> Task :react-native-webview:compileDebugJavaWithJavac FAILEDDeprecated 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_warnings79 actionable tasks: 14 executed, 65 up-to-dateC:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewModule.java:276: error: cannot find symbol    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {                                                    ^  symbol:   variable Q  location: class VERSION_CODESNote: C:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.java uses or overrides a deprecated API.Note: Recompile with -Xlint:deprecation for details.Note: C:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.1 errorFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':react-native-webview:compileDebugJavaWithJavac'.> Compilation failed; see the compiler error output for details.* 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 1m 37serror 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=8081C:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewModule.java:276: error: cannot find symbol    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {                                                    ^  symbol:   variable Q  location: class VERSION_CODESNote: C:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.java uses or overrides a deprecated API.Note: Recompile with -Xlint:deprecation for details.Note: C:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.1 errorFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':react-native-webview:compileDebugJavaWithJavac'.> Compilation failed; see the compiler error output for details.* 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 1m 37s    at makeError (C:\Projects\React-Native\FUNAI\node_modules\execa\index.js:174:9)    at Promise.all.then.arr (C:\Projects\React-Native\FUNAI\node_modules\execa\index.js:278:16)    at process._tickCallback (internal/process/next_tick.js:68:7)

React Native Responsive Screen

$
0
0

Hi guys I have a question about screen design in React Native.

I am building an App with Expo. It runs on my AS Emulator - Nexus 5x. When I take my real device - Samsung S9 the pages look different for example text on the left and right is cut away because the screen seems to be to small. However both devices have the same width kinda 72mm and 69mm but S9 is curved. How do you guys keep your apps responsive?

I already did some componentWillMount checks where I make the fields height larger if the screen is to high. Should I do the same for the width? Or should I maybe use react-native-responsive-screen package for example? If there are some more experienced RN-Devs please give me a quick tip on how you actually manage this.

Edit :: Is this code below actually a good practice? Its my StyleSheet and I tried to work with absolute position - wich looks nice on the Emulator but I guess it's not good practice.. Should I rewrite the styles?

const styles = StyleSheet.create({  container: {    justifyContent: "center",    alignItems: "center"  },  headerText: {    fontSize: 30,    color: "black"  },  DateContainer: {    marginTop: 10,    marginBottom: 10  },  DateText: {    position: "absolute",    fontSize: 16,    color: "black",    top: 14,    left: -100  },  phaseButton: {    position: "absolute",    top: -42,    right: -95,    height: 30,    backgroundColor: "#a51717",    borderRadius: 45  },  checkbox: {    position: "absolute",    top: -5,    right: -180,    height: 30  },  ZeitText: {    position: "absolute",    fontSize: 16,    color: "black",    top: 12,    left: -199.5  },  ZeitInput: {    position: "absolute",    left: -150,    top: 8,    width: 100,    height: 35,    borderWidth: 1,    textAlign: "center"  },  checkText: {    position: "absolute",    top: 12,    right: -115,    height: 30,    color: "black"  },  button1: {    position: "absolute",    left: -120,    top: 8,    height: 30,    marginHorizontal: 20,    backgroundColor: "#a51717"  },  button2: {    position: "absolute",    left: -60,    top: 8,    height: 30,    backgroundColor: "#a51717"  }});

~Ty Faded.

Photo upload on React Native Android produce Type Error Network Error

$
0
0

I'm executing a photo upload using the fetch API and I keep receiving Type Error Network Request Error. I receive the same error on the emulator and a device. I'm using react-native-image-crop-picker as the source for the photo upload data. Any thoughts?

const handlePhotoUpload =  async (image: any, token: string) => {      const { path, filename, mime } = image;      const uri = path.replace("file://", "")      const file = {        uri,                    type: mime,                   name: filename                   };      const body = new FormData()      body.append('file', file)      const config = {        method: 'POST',         headers: { 'Authorization': 'Bearer '+ token },        body      };      return await fetch(`${<API URL>}/user/photo`, config)}

Adding new components in side drawer navigator dynamically

$
0
0

I have an "ADD" button which when pressed should add a new item to the side navigation drawer. I already have two items in the drawer and want to add 1 item every time the "ADD" button is pressed. How do I do that?

error: '.' expected java React Native App

$
0
0

So my company decided to add their own Native Storage using Native Modules. It worked in iOS. I am struggling to implement the logic in android. When I am running "react-native run-android" I get the below error.

enter image description here

Why is it expecting '.'??? Below is my code screenshot

enter image description here

enter image description here

I tried import com.hanotifapp.HAGoBridgeReactPackage; and this threw "error:cannot find symbol"

I tried import hanotifapp.HAGoBridgeReactPackage; and this threw "error:cannot find symbol"

What am I doing wrong??? Help please!!

Black screen on emulator

$
0
0

I recently uninstalled android studio and realize my emulator is no longer working upon updating to the latest version. Tried looking on past problems in stackoverflow and couldnt resolve

I have tried wiping data, cold boot and installing/update SDK packages (not exactly sure if I install the correct ones), the emulator would not turn on

Edit:"An error occurred while creating the AVD. See idea.log for details. ubuntu 16.04"I also got this error when I delete an AVD device, not sure if its related

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6

$
0
0

I try to get Apk in react-native however it doesn't give me anything. release file which is in Apk file is empty and after Gradlew bundle release is finished, it says

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

I couldn't find how to solve this issue

    react-native run-androidinfo Starting JS server...info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details> Task :app:transformClassesWithDexBuilderForDebug FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.> java.nio.file.AccessDeniedException: /home/kourosh/Projects/FitnessApp/android/app/build/intermediates/transforms/dexBuilder/debug/45/androidx/versionedparcelable/R.dex* 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.orgDeprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warningsBUILD FAILED in 1m 15s19 actionable tasks: 1 executed, 18 up-to-dateerror Could not install the app on the device, read the error above for details.Make sure you have an Android emulator running or a device connected and haveset up your Android development environment:https://facebook.github.io/react-native/docs/getting-started.htmlerror Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.

java version "12.0.1" 2019-04-16node -v v10.16.0npm -v 6.9.0

React Native project can't be open with android emulater

$
0
0

I'm a newbie to react native. I started a new project and followed all the steps. I had android studio before and i started the emulator with it. After running npx react-native run-android command i get this error.

FAILURE: Build failed with an exception.* What went wrong:Task 'installDebug' not found in project ':app'.* Try:Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debugoption to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 34serror 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:Task 'installDebug' not found in project ':app'.* Try:Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debugoption to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 34s

Then I ran abd -d command and i get this.

Android Debug Bridge version 1.0.41Version 29.0.6-6198805Installed as C:\Users\User\AppData\Local\Android\Sdk\platform-tools\adb.exe

Can you please help me with this?

Viewing all 28468 articles
Browse latest View live


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