facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.77k stars 24.29k forks source link

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 :ReactNative:Unexpected empty result of running 'npx.cmd --quiet --no-install react-native config' command from 'null' directory. :ReactNative:Running 'npx.cmd --quiet --no-install react-native config' command from 'null' directory failed. #27443

Closed siddiqaQ closed 4 years ago

siddiqaQ commented 4 years ago

FAILURE: Build failed with an exception.

BUILD FAILED in 3s

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 :ReactNative:Unexpected empty result of running 'npx.cmd --quiet --no-install react-native config' command from 'null' directory. :ReactNative:Running 'npx.cmd --quiet --no-install react-native config' command from 'null' directory failed.

FAILURE: Build failed with an exception.

BUILD FAILED in 3s

at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\react\zinia\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\react\zinia\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\react\zinia\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\react\zinia\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:164:9)

React Native version:

Steps To Reproduce

siddiqaQ commented 4 years ago

System: OS: Windows 10 10.0.18362 CPU: (4) x64 Intel(R) Core(TM) i7-4610M CPU @ 3.00GHz Memory: 1.48 GB / 7.91 GB Binaries: Node: 12.13.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.19.1 - C:\Users\Dell\AppData\Roaming\npm\yarn.CMD npm: 6.13.2 - C:\Users\Dell\AppData\Roaming\npm\npm.CMD IDEs: Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5900203 npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5

please help :(

renancarlos98 commented 4 years ago

Hello siddiqaQ , what you do to solve this problem?!

fdobre commented 4 years ago

@rickhanlonii what was the reason for closing this? Any information that could allow us to trace the cause of the issue will be greatly appreciated.

stevelee2497 commented 4 years ago

I faced the same problem. npx --quiet react-native config or npx.cmd --quiet react-native config That command, if you execute in the root directory of your react native project, will produce JSON output (if everything is configured correctly). The problem is, I did not locate my react native project in the root folder of the git repository. After then, I created another git repo and set the root folder of the repo to be the root folder of the react native project, and everything is ok then.

JosimarGomes commented 4 years ago

I had this same problem. In my case I was using an old version of npm (3.10.3) and all I did was upgrade to 6.12.1. It worked for me.

rickhanlonii commented 4 years ago

Thanks everyone for the help!

I closed this issue because it didn’t fit the template or include a meaningful description.

The comment must have got lost in the process sorry about that.

Arwiz commented 4 years ago

I am also facing the same problem . Is there any work around?

musiquarc commented 4 years ago

On my side issue 838 allowed me to solve the issue. I uninstalled and reinstalled globally:

npm uninstall -g react-native react-native-cli npm install -g react-native react-native-cli react-native start --reset-cache Then cleaned the project and built again.

Don't be too harsh if it doesn't work for you ;) Also, I am not 100% it helps in this case, but the interesting read that led me to the solution was issue #804, because at core it seems to be related to the build script not calling npx from the root React Native directory.

rickhanlonii commented 4 years ago

If anyone is still seeing this issue, please submit a new issue that conforms to the bug template and we'll take a look.

Satur-nity commented 4 years ago

I am also facing same issue...

:ReactNative:Unexpected empty result of running 'npx.cmd --quiet --no-install react-native config' command from 'null' directory.
:ReactNative:Running 'npx.cmd --quiet --no-install react-native config' command from 'null' directory failed.
heihuhei2013 commented 4 years ago

ERROR: Command config unrecognized. Make sure that you have run npm install and that you are inside a react-native project.

malashkevich commented 4 years ago

@rickhanlonii I've created #27707 using a template. Let me know if you nee more information.

Emex4gman commented 4 years ago

I faced the same problem. npx --quiet react-native config or npx.cmd --quiet react-native config That command, if you execute in the root directory of your react native project, will produce JSON output (if everything is configured correctly). The problem is, I did not locate my react native project in the root folder of the git repository. After then, I created another git repo and set the root folder of the repo to be the root folder of the react native project, and everything is ok then.

This was helpful. Thanks

parthya commented 4 years ago

Check if local.properties file is missing.

Athira-Murali commented 4 years ago

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 Unable to install C:\Users\Athira\Desktop\ReactProjects\demo2\android\app\build\outputs\apk\debug\app-debug.apk com.android.ddmlib.InstallException: Unknown failure: Error: failed to write; Failed to allocate 23022086 because only 0 allocatable at com.android.ddmlib.Device.installRemotePackage(Device.java:1063) at com.android.ddmlib.Device.installPackage(Device.java:903) at com.android.ddmlib.Device.installPackage(Device.java:881) at com.android.ddmlib.Device.installPackage(Device.java:870) at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:126) at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:179) at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:110) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:702) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:669) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:401) 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.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:390) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:373) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:79) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:210) at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54) at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31) at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:201) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49) at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43) at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:77) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48) at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:117) at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108) at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67) at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49) 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.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)

FAILURE: Build failed with an exception.

BUILD FAILED in 17s

at checkExecSyncError (child_process.js:611:11)
at execFileSync (child_process.js:629:15)
lylest commented 4 years ago

same problem here

infinitbility commented 4 years ago

same problem here

please check your devices connected Or USB debugging on ( causes of a lot of time )

lylest commented 4 years ago

I checked bro I even listed the device using adb devices comand

RxMz commented 4 years ago

Facing the same problem 😞

ethanwc commented 4 years ago

Same

noguerajulioces commented 4 years ago

same

rickhanlonii commented 4 years ago

This appears to have been a bug in the react-native cli which has been fixed in the latest version, see: https://github.com/react-native-community/cli/issues/804

Rameshzende commented 4 years ago

the same bug I am also facing

mohammednur1997 commented 4 years ago

the same bug .. I ever have seen

sametpalitci commented 4 years ago

same

chialuka commented 4 years ago

I'm facing the same bug too after moving to react native 0.62

rickhanlonii commented 4 years ago

As mentioned in https://github.com/facebook/react-native/issues/27707, this issue was in the react-native cli and should be fixed.

If you're still seeing this, please comment or open a new issue in the CLI.

Going to lock this so that the +1 comments don't burry this message.