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

EdgeLight: Screen borders are not going beyond the notch and softkeys in react native

$
0
0

I am just trying to implement "edge light" Ref in react native.

I have this below code to achieve it.

<Layout style={{ flex: 1, paddingTop: 18, paddingBottom: 18, paddingLeft: 28, paddingRight: 28, borderWidth: 10, borderColor: '#36ABA5', justifyContent: 'center', backgroundColor: '#000', color: '#fff' }}> // All my code </Layout>

This seems to be working fine for the mobiles which are having straigh screens. But I am facing 2 issues,

  1. The same is not working when the mobile has notch or the mobile's softkeys are enabled.
  2. In Honor 8x the border itself is not coming when softkeys are disabled, when those are enabled, the border comes above the softkeys.

I tried calculating the window height, screen height and put the border. It seems to be not happening.

In Straight phone

In Straight phone:

In Notch phone:

In Notch phone:

In Softkeys enabled:

enter image description here

In Softkeys disabled:

In Softkeys disabled:

Wanted similar to this, but not colorful/ Expected Results:

Wanted similar to this, but not colorful/ Expected Results:


Exporting APK from react-native project

$
0
0

I'm trying to export APK from a react-native project using this command

./gradlew bundleRelease

it fires this error :

Build file '/Users/mohsen/Desktop/fzapp/android/app/build.gradle' line: 154

here's the full logs from my terminal

trooos-MacBook-Pro:android mohsen$ ./gradlew bundleReleaseFAILURE: Build failed with an exception.* Where:Build file '/Users/mohsen/Desktop/fzapp/android/app/build.gradle' line: 154* What went wrong:Could not compile build file '/Users/mohsen/Desktop/fzapp/android/app/build.gradle'.> startup failed:  build file '/Users/mohsen/Desktop/fzapp/android/app/build.gradle': 154: expecting '}', found ',' @ line 154, column 10.             },              ^  1 error* 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 5strooos-MacBook-Pro:android mohsen$ 

What went wrong ?

Info about my environment

MAC OS CatalinaReact Native version : ~0.61.5Expo version : ~37.0.3

I used Expo first then ejected to a normal react-native project

Package signatures do not match the previously installed version

$
0
0

This my project: https://github.com/kenpeter/my_hak_news, which is a direct copy of https://github.com/grigio/HAgnostic-News.

Git clone https://github.com/kenpeter/my_hak_news, then run react-native run-android

Got this error:

* What went wrong:Execution failed for task ':app:installDebug'.> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.hagnosticnews signatures do not match the previously installed version; ignoring!

Relevant issue: https://github.com/grigio/HAgnostic-News/issues/1, I follow various ways, but not able to resolve this issue.

How to handle multiple API calls in single component in React Native?

$
0
0

I have react native parent component which contain 4 child components. Each child component need the web service data from different API's. If I call the web service, the parent component render 4 times. How to handle this situation and render the particular child component when the API get the responses ?

How can i use the Keystore generated from Android Studio in react native?

$
0
0

I Generated a Keystore using Android Studio Build -> Generate Signed APK -> and provide key info.

the generated file - myKey

myKey without .keystore extension!But In a terminal, as usual, we got the file name my-upload-key.keystore

But now I want to use this key myKey in my react native config Gradle file as wrote here

So is there a way to use this keyStore in this configuration?

Or should I generated the key using terminal and follow the Docs?

accessing built in notes app IOS and Android - React Native

$
0
0

is it possible to open Notes app on Ios and Android when the phone has built in Notes app ?

i cannot find any package or apps name (trying to deeplink) the Notes apps on both android and ios.

is every body ever work with this feature ?

why gradle can't start my react native app

$
0
0

I'm new to react native and im trying to start my first project using android studio.I followed the instructions in "Setting up the development environment" of react native and finally built my project using

npx react-native init AwesomeProject

then I opened my project in android studio to start the AVD but gradle throws following error

:ReactNative:Running '[node, -e, console.log(require('react-native/cli').bin);]' command failed.

FAILURE: Build failed with an exception.

  • Where:Script '/home/deadshot/Documents/playground/AwesomeProject/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 179

  • What went wrong:A problem occurred evaluating script.

    Cannot run program "node" (in directory "/home/deadshot/Documents/playground/AwesomeProject/android"): error=2, No such file or directory

  • Try:Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:org.gradle.api.GradleScriptException: A problem occurred evaluating script.at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:237)at org.gradle.configuration.DefaultScriptTarget.addConfiguration(DefaultScriptTarget.java:74)at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:242)at org.gradle.configuration.BuildOperationScriptPlugin$1$1.run(BuildOperationScriptPlugin.java:69)at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:66)at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:63)at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:49)at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:63)at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.java:151)at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$000(DefaultObjectConfigurationAction.java:41)at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$1.run(DefaultObjectConfigurationAction.java:74)at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:185)at org.gradle.groovy.scripts.DefaultScript.apply(DefaultScript.java:128)at org.gradle.api.Script$apply.callCurrent(Unknown Source)at settings_emt1eyqku5nj9txmw811c4zsp.run(/home/deadshot/Documents/playground/AwesomeProject/android/settings.gradle:2)at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:237)at org.gradle.configuration.DefaultScriptTarget.addConfiguration(DefaultScriptTarget.java:74)at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:242)at org.gradle.configuration.BuildOperationScriptPlugin$1$1.run(BuildOperationScriptPlugin.java:69)at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:66)at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:63)at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:49)at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:63)at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.applySettingsScript(ScriptEvaluatingSettingsProcessor.java:71)at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.process(ScriptEvaluatingSettingsProcessor.java:64)at org.gradle.initialization.PropertiesLoadingSettingsProcessor.process(PropertiesLoadingSettingsProcessor.java:38)at org.gradle.initialization.SettingsEvaluatedCallbackFiringSettingsProcessor.process(SettingsEvaluatedCallbackFiringSettingsProcessor.java:34)at org.gradle.initialization.RootBuildCacheControllerSettingsProcessor.process(RootBuildCacheControllerSettingsProcessor.java:36)at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:50)at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:47)at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)at org.gradle.initialization.BuildOperationSettingsProcessor.process(BuildOperationSettingsProcessor.java:47)at org.gradle.initialization.DefaultSettingsLoader.findSettingsAndLoadIfAppropriate(DefaultSettingsLoader.java:102)at org.gradle.initialization.DefaultSettingsLoader.findAndLoadSettings(DefaultSettingsLoader.java:45)at org.gradle.initialization.SettingsAttachingSettingsLoader.findAndLoadSettings(SettingsAttachingSettingsLoader.java:35)at org.gradle.internal.composite.CommandLineIncludedBuildSettingsLoader.findAndLoadSettings(CommandLineIncludedBuildSettingsLoader.java:34)at org.gradle.internal.composite.ChildBuildRegisteringSettingsLoader.findAndLoadSettings(ChildBuildRegisteringSettingsLoader.java:52)at org.gradle.internal.composite.CompositeBuildSettingsLoader.findAndLoadSettings(CompositeBuildSettingsLoader.java:35)at org.gradle.initialization.DefaultSettingsPreparer.prepareSettings(DefaultSettingsPreparer.java:36)at org.gradle.initialization.BuildOperatingFiringSettingsPreparer$LoadBuild.doLoadBuild(BuildOperatingFiringSettingsPreparer.java:59)at org.gradle.initialization.BuildOperatingFiringSettingsPreparer$LoadBuild.run(BuildOperatingFiringSettingsPreparer.java:54)at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)at org.gradle.initialization.BuildOperatingFiringSettingsPreparer.prepareSettings(BuildOperatingFiringSettingsPreparer.java:42)at org.gradle.initialization.DefaultGradleLauncher.prepareSettings(DefaultGradleLauncher.java:194)at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:138)at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:130)at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:104)at org.gradle.internal.invocation.GradleBuildController$2.execute(GradleBuildController.java:70)at org.gradle.internal.invocation.GradleBuildController$2.execute(GradleBuildController.java:67)at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:85)at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:78)at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:78)at org.gradle.internal.invocation.GradleBuildController.configure(GradleBuildController.java:67)at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:62)at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:27)at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)at org.gradle.util.Swapper.swap(Swapper.java:38)at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)Caused by: java.io.IOException: Cannot run program "node" (in directory "/home/deadshot/Documents/playground/AwesomeProject/android"): error=2, No such file or directoryat java_lang_Runtime$exec$0.call(Unknown Source)at ReactNativeModules.getCommandOutput(/home/deadshot/Documents/playground/AwesomeProject/node_modules/@react-native-community/cli-platform-android/native_modules.gradle:179)at ReactNativeModules$getCommandOutput$0.callCurrent(Unknown Source)at ReactNativeModules.getReactNativeConfig(/home/deadshot/Documents/playground/AwesomeProject/node_modules/@react-native-community/cli-platform-android/native_modules.gradle:222)at ReactNativeModules$getReactNativeConfig.callCurrent(Unknown Source)at ReactNativeModules.(/home/deadshot/Documents/playground/AwesomeProject/node_modules/@react-native-community/cli-platform-android/native_modules.gradle:83)at native_modules_ckv0ar2tbt1avc4kp1cmnflgi.run(/home/deadshot/Documents/playground/AwesomeProject/node_modules/@react-native-community/cli-platform-android/native_modules.gradle:272)at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)... 148 moreCaused by: java.io.IOException: error=2, No such file or directory... 156 more

  • Get more help at https://help.gradle.org

CONFIGURE FAILED in 448ms

as I have no background of using gradle or android I have no idea what is this error.I would appreciate any help

can’t build the app for android after ejecting to native project

$
0
0

After ejecting my expo project to native one

I can’t export APK file

what I wonder is , why considering this task : ??

Task :app:bundleReleaseExpoUpdatesAssets FAILED

I ejected expo , it fails always in this task

here’s the full logs from Android Studio

Opening `/dev/tty` failed (6): Device not configuredresize:  can't open terminal /dev/tty┌─────────────────────────────────────────────────────────────────────────┐│││   There is a new version of expo-cli available (3.20.0).                ││   You are currently using expo-cli 3.13.8                               ││   Install expo-cli globally using the package manager of your choice;   ││   for example: `npm install -g expo-cli` to get the latest version      │││└─────────────────────────────────────────────────────────────────────────┘[03:17:25] Cannot read property 'publishManifestPath' of undefined[03:17:25] Set EXPO_DEBUG=true in your env to view the stack trace.> Task :app:bundleReleaseExpoUpdatesAssets FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:bundleReleaseExpoUpdatesAssets'.> Process 'command './node_modules/expo-updates/run-expo.sh'' finished with non-zero exit value 1* 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.

How to create a custom React Native component with Android Java Camera View module?

$
0
0

I am trying to build a react-native android app for augmented reality purposes which I need a live camera preview displayed on the screen. So I'm trying to make my own Android camera component instead of using React Native's default react-native-camera package. This is because I need a camera module that would allow me to get camera frames in real time, detect Aruco markers, draw on the image frame, and display it on a camera preview in react-native. So from reading tutorials and articles, I've attempted to create a view manager class and a ReactPackage class to bridge my Android camera view. FYI the CameraBridgeViewBase class is an OpenCV class which extends SurfaceView, which is found in this library: https://github.com/quickbirdstudios/opencv-android/tree/master/opencv3_4_4_contrib

When I run the app, I just keep getting a black screen with no camera preview. I did have camera permissions granted before the view gets created. If there is any suggestions or anyone who has experience in this area that could help. I would greatly appreciate, Thanks.

View Manager Class:

public class JavaCameraViewManager extends SimpleViewManager<CameraBridgeViewBase> implements CameraBridgeViewBase.CvCameraViewListener2 {    public static final String REACT_CLASS = "JavaCameraView";    public CameraBridgeViewBase javaCameraView;    @Override    public String getName() {        return REACT_CLASS;    }    @Override    protected CameraBridgeViewBase createViewInstance(ThemedReactContext reactContext) {        javaCameraView = new JavaCameraView(reactContext, null);        javaCameraView.setVisibility(SurfaceView.VISIBLE);        javaCameraView.setCvCameraViewListener(this);        return javaCameraView;    }    @Override    public void onCameraViewStarted(int width, int height){}    @Override    public void onCameraViewStopped(){}    @Override    public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame){        System.out.println("onCameraFrame$");        return inputFrame.rgba();    }}

React Package class:

public class JavaCameraViewPackage implements ReactPackage {    @Override    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {        return Collections.emptyList();    }    @Override    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {        return Collections.<ViewManager>singletonList(                new JavaCameraViewManager()        );    }}

React Native Camera View Component class:

import React, { Component } from 'react'import { requireNativeComponent} from 'react-native';const JavaCameraView = requireNativeComponent('JavaCameraView', JavaCameraViewView);export default class JavaCameraViewView extends Component {    render () {      return <JavaCameraView {...this.props} />    }  }

App.js:

'use strict';import React, {Component} from 'react';import {Platform, StyleSheet, Text, View} from 'react-native';import { NativeModules, AppRegistry, TouchableOpacity} from 'react-native';import JavaCameraView from './src/JavaCameraViewNativeView'export default class App extends Component  {  render() {    return (<View style={styles.container}><JavaCameraView style={{ flex: 1, width: '100%', height: '100%', backgroundColor:'blue'}} /> </View>    );  }}

React-native build error in 'node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 307

$
0
0

I am facing issues with my react-native app. It was working fine before the re-installation of windows after I have re-setup everything from android studio, whenever I try to run "react-native run-android"this shows up

$ react-native run-androidinfo Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 1041 file(s) to forward-jetify. Using 2 workers...info Starting JS server...info Installing the app...Starting a Gradle Daemon, 2 busy and 2 incompatible and 1 stopped Daemons could not be reused, use --status for detailsFAILURE: Build failed with an exception.* Where:Script 'C:\Users\Robin\Documents\IntoNovus\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line:307* What went wrong:A problem occurred evaluating project ':app'.> native_modules_8hkbashcmevmu4l7wc13mmhka$_run_closure2$_closure4$_closure6$_closure7$_closure8* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan toget full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 3m 12serror 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=8081FAILURE: Build failed with an exception.* Where:Script 'C:\Users\Robin\Documents\IntoNovus\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line:307* What went wrong:A problem occurred evaluating project ':app'.> native_modules_8hkbashcmevmu4l7wc13mmhka$_run_closure2$_closure4$_closure6$_closure7$_closure8* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan toget full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 3m 12s    at checkExecSyncError (child_process.js:621:11)    at execFileSync (child_process.js:639:15)    at runOnAllDevices (C:\Users\Robin\Documents\IntoNovus\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)    at buildAndRun (C:\Users\Robin\Documents\IntoNovus\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)    at C:\Users\Robin\Documents\IntoNovus\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12    at processTicksAndRejections (internal/process/task_queues.js:93:5)    at async Command.handleAction (C:\Users\Robin\Documents\IntoNovus\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:182:9)

Things done so far:updating npm to the latest using npm install npm@latestdeleted node_modulesand run npm install

How to Launch a React-Native App inside other React-Native App

$
0
0
  • I am having a requirement,wherein i have a React-Native app (PrimaryApp),and having a Game-App(Secondary App) which is also developed inReact-native.

  • Now on a button click of Primary App I want to launch SecondaryApp,and play the game as part of Primary-App.Please let me know orguide me,How can I integrate these two separate entities and get thedone.

  • Is there any way,to bundle react-native app and launch in PrimaryApp?

Note :- Since i have hundreds of game's it will be a bad idea to have code of all games in Primary app, so is there any way to launch each game as separate entity or in any bundle form something like that,as part of Primary App.

Thanks for your time.

ReactNative JS text not Updating

$
0
0

After Successfully setup the React Native Environment,after running i got an screen by default text

"Welcome to React Native,To get started ,edit App.js,Double Tap R on your keyboard to reload,shake or press menu button for dev menu"

But my problem is that after changing the file in Text App.js ,i can not able to see the change in my app,alwys showing the by default text.....

and also after shaking the app when i click the Reload button give an error Could not connect to development server..

can you suggest me how to resolve the above issue,,,,,Thanks in advance.

how to send data from android activity to reactNative android bridge module

$
0
0

I've integrated stripe android sdk in my react native application for payments. The flow is like

  1. react native button calls native module (js bridge) and that moduleopens up an android activity for payment page
  2. that collects the card information and returns the payment result id from backend api whether payment is success or not
  3. i want to send that id from android activity to native module so that I can fetch that data from react native

React-Native array of refs

$
0
0

I create my components in a loop, and I need a way to retrieve data from them, but all my refs are undefinded.

<Tile                    id={i} key={i}                    isActive={this.state.isActive}                    num={numbers[i]}                    getNext={() => { return this.state.tilesTapped + 1 }}                    addToList={(id) => this.addToList(id)}                    ref={(input) => { this.tiles[i] = input }}                />

And this is how I call them:

for (var i = 0; i < this.state.maxTiles; i++) {        if (!this.tiles[i].check()) {            res = false;        }    }

Is the syntax incorrect, or the problem is somewhere else?

Task 'installDebug' not found in project ':app'(npx react-native run-android issue)

$
0
0

After running npx react-native run-android i got the common issue "Task 'installDebug' not found in project ':app".'enter image description here

Following an advice i tried to do this https://reactnative.dev/docs/signed-apk-android, but when i run:$ ./gradlew bundleRelease from android directory i got: "Task 'bundleRelease' not found in root project 'MoscowForDummies'."

My gradle.properties:

MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystoreMYAPP_UPLOAD_KEY_ALIAS=my-key-aliasMYAPP_UPLOAD_STORE_PASSWORD=Profit***MYAPP_UPLOAD_KEY_PASSWORD=Profit***

Part of my build.gradle:

android {compileSdkVersion rootProject.ext.compileSdkVersioncompileOptions {    sourceCompatibility JavaVersion.VERSION_1_8    targetCompatibility JavaVersion.VERSION_1_8}defaultConfig {    applicationId "com.moscowfordummies"    minSdkVersion rootProject.ext.minSdkVersion    targetSdkVersion rootProject.ext.targetSdkVersion    versionCode 1    versionName "1.0"}signingConfigs {    release {        if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {            storeFile file(MYAPP_UPLOAD_STORE_FILE)            storePassword MYAPP_UPLOAD_STORE_PASSWORD            keyAlias MYAPP_UPLOAD_KEY_ALIAS            keyPassword MYAPP_UPLOAD_KEY_PASSWORD        }    }}

and my ~/.bash_profile:

export ANDROID_HOME=$HOME/Android/Sdkexport PATH=$PATH:$ANDROID_HOME/emulatorexport PATH=$PATH:$ANDROID_HOME/toolsexport PATH=$PATH:$ANDROID_HOME/tools/binexport PATH=$PATH:$ANDROID_HOME/platform-tools

Does anybody have any advice how to fix the problem?


Best library for horizontal bar charts in react native? [closed]

Can not create generated signed apk in React Native

$
0
0

I have a React Native project which runs a device without any error on debugging. Every time I try to create signed release .apk I have the following error

> Task: app: bundleReleaseJsAndAssets FAILEDinternal / modules / cjs / loader.js: 969throw err; ^Error: Cannot find module '/Users/tos/Desktop/Repos/com.tosanalytics.pakodemy/node_modules/@react-native-community/cli/build/bin.js'at Function.Module._resolveFilename(internal / modules / cjs / loader.js: 966: 17)at Function.Module._load(internal / modules / cjs / loader.js: 859: 27)at Function.executeUserEntryPoint[as runMain](internal / modules / run_main.js: 71: 12)at internal / main / run_main_module.js: 17: 47 {  code: 'MODULE_NOT_FOUND',  requireStack: []}

my package.json

{"name": "com.tosanalytics.pakodemy","version": "1.6.6","private": true,"scripts": {"android": "react-native run-android","android-standalone": "react-native run-android --variant=release","android-release": "cd android && ./gradlew bundleRelease","android-clean": "set -ex adb uninstall com.pakodemy; cd android && ./gradlew clean","android-menu": "adb shell input keyevent 82","ios": "react-native run-ios","ios-standalone": "react-native run-ios --configuration=Release --device","start": "react-native start","start-clean": "watchman watch-del-all && react-native start -- --reset-cache","clean": "watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/metro-* && rm -rf node_modules && yarn cache clean","test": "jest","lint": "eslint .","ios-install-fix": "rm -rf /usr/local/var/run/watchman && brew uninstall watchman && brew install watchman","create-tag": "git tag -a v2.1.1 -m 'Release'","push-all-with-tags": "git push --follow-tags"  },"dependencies": {"@react-native-community/async-storage": "^1.7.0","@react-native-community/cli": "^4.8.0","@react-native-community/viewpager": "^3.3.0","@react-native-firebase/admob": "^6.3.4","@react-native-firebase/analytics": "^6.3.4","@react-native-firebase/app": "^6.3.4","@react-native-firebase/messaging": "^6.3.4","@react-native-firebase/remote-config": "^6.3.4","@terrylinla/react-native-sketch-canvas": "^0.8.0","add": "^2.0.6","axios": "^0.19.2","moment": "^2.24.0","native-base": "^2.13.8","prop-types": "^15.7.2","react": "^16.13.1","react-devtools": "^4.6.0","react-native": "0.63.0-rc.0","react-native-countdown-component": "^2.6.0","react-native-device-info": "^5.4.0","react-native-fast-image": "^8.1.5","react-native-fbsdk": "^1.1.2","react-native-gesture-handler": "^1.6.0","react-native-iap": "^4.4.2","react-native-image-size": "^1.1.3","react-native-media-controls": "^1.1.1","react-native-modal": "^11.5.4","react-native-orientation-locker": "^1.1.8","react-native-permissions": "^2.1.3","react-native-progress-circle": "^2.1.0","react-native-reanimated": "^1.7.0","react-native-responsive-screen": "^1.4.0","react-native-screens": "^1.0.0-alpha.23","react-native-snap-carousel": "^3.8.4","react-native-svg": "^9.13.6","react-native-vector-icons": "^6.6.0","react-native-video": "^4.4.5","react-native-webview": "^8.1.0","react-navigation": "^4.2.2","react-navigation-stack": "^1.10.3","react-navigation-tabs": "^2.8.2","react-redux": "^7.2.0","recyclerlistview": "^3.0.0","redux": "^4.0.4","redux-devtools-extension": "^2.13.8","stacktrace-parser": "0.1.4","validator": "^12.1.0","yarn": "^1.22.4"  },"devDependencies": {"@babel/core": "^7.8.4","@babel/runtime": "^7.8.4","@react-native-community/eslint-config": "^1.0.0","babel-jest": "^25.1.0","babel-plugin-module-resolver": "^3.2.0","eslint": "^6.5.1","eslint-config-airbnb": "^18.0.1","eslint-import-resolver-babel-module": "^5.1.0","eslint-plugin-import": "^2.18.2","eslint-plugin-jsx-a11y": "^6.2.3","eslint-plugin-module-resolver": "^0.15.0","eslint-plugin-react": "^7.14.3","eslint-plugin-react-hooks": "^1.7.0","jest": "^25.1.0","metro-react-native-babel-preset": "^0.59.0"  },"jest": {"preset": "react-native"  }}

End I have already deleted node_modules a couple times and run npm install. It works fine but I can't create release build. I used Android Studio also to create a release build but the error is the same.

React native 0.62.0 - Network request error on Android for file upload

$
0
0

I have upgraded react-native to 0.62 and i got the problem of Network error for Android only, iOS works fine.

I use FormData object to populate data formated as

const data = new FormData(); // On Android i add file protocol to file path - file://... data.append('photos', {    uri: 'file:///data/.../my-image.jpeg',    type: 'image/jpeg',   name: 'my-image.jpeg'});

and other textual data

data.append('description', 'my long description...');

Does anyone have the problem?

I have tried multiple Android SDKs 27, 28, 29, and got same problem on all :(

The things is if i do not upload images, but only textual data request works just fine :(

Any suggestion welcome :)?

React Native - Deeplink doesn't works on android's release build

$
0
0

I have issues with react-native deeplinks on android.Deep link works when in debug mode but when i generate release build, it doesn't works.

It opens app though but doesn't route to expected path.url is null

componentDidMount() {    if(Platform.OS === 'android'){        Linking.getInitialURL().then(url => {            this.navigate(url);        });    }else {        Linking.addEventListener('url', this.handleOpenURL);    }}componentWillUnmount() {     Linking.removeEventListener('url', this.handleOpenURL);  }  handleOpenURL = (event) => {     this.navigate(event.url);  }navigate = (url) => {     const route = url.replace(/.*?:\/\//g, '');    const routeName = route.split('/')[1];    const uri = new URL(url)    if (routeName === 'invitation') {      this.props.router.go('IntroScreen');    };  }

Default Sound notification from firebase not work in Android?

$
0
0

I'm trying to send a notification using cloud functions to android devices,

It's received well but without default notification sound it's silent.

although in sendToDevice option I send it like this

sound: 'default',

Code snippet

// Send notification for provider when his order is cancelled removed!exports.userCancelOrder = functions.database  .ref('/Providers/ProvidersOrders/InProgress/{providerUid}/{orderId}')  .onUpdate(async (snapshot, context) => {    const orderdata = snapshot.before.val();    const {username} = orderdata;    const {providerUid} = context.params;    const userRef = await admin      .database()      .ref(`/Providers/users/${providerUid}`)      .once('value');    console.log('userRef', userRef.val());    const {userToken} = userRef.val(); // FCM user app token    const providerName = userRef.val().name;    try {      const options = {        priority: 'high',        contentAvailable: true, // NOT content_available: true      };      const payload = {        notification: {          body: `hey, ${providerName}, your order canclled by ${username} :) `,          timestamp: Date.now().toString(),          isRead: 'false',          sound: 'default', // here's         },      };      let {sound, ...notification} = payload.notification;      let uid = providerUid;      await admin        .messaging()        .sendToDevice(userToken, payload, options)        .then(() => {          return admin            .database()            .ref(`Notifications/${uid}`)            .push({...notification});        });      console.log('message sent');    } catch (error) {      console.log('Error sending message:', error);    }    return null;  });
Viewing all 28476 articles
Browse latest View live


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