Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Dec 7, 2019 · 27 comments
Labels
Bug 🌐Networking Related to a networking API. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@siddiqaQ
Copy link

siddiqaQ commented Dec 7, 2019

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\react\zinia\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 170

  • What went wrong:
    A problem occurred evaluating script.

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

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

  • Where:
    Script 'C:\react\zinia\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 170

  • What went wrong:
    A problem occurred evaluating script.

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

  • 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 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 siddiqaQ added the Bug label Dec 7, 2019
@siddiqaQ
Copy link
Author

siddiqaQ commented Dec 7, 2019

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 :(

@react-native-bot react-native-bot added Platform: Android Android applications. 🌐Networking Related to a networking API. labels Dec 7, 2019
@renancarlos98
Copy link

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

@fdobre
Copy link

fdobre commented Dec 10, 2019

@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
Copy link

stevelee2497 commented Dec 10, 2019

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
Copy link

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
Copy link
Member

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
Copy link

Arwiz commented Dec 13, 2019

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

@musiquarc
Copy link

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
Copy link
Member

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
Copy link

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
Copy link

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

@malashkevich
Copy link

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

@Emex4gman
Copy link

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
Copy link

parthya commented Jan 30, 2020

Check if local.properties file is missing.

@Athira-Murali
Copy 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
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.

  • What went wrong:
    Execution failed for task ':app:installDebug'.

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure: Error: failed to write; Failed to allocate 23022086 because only 0 allocatable

  • 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 17s

at checkExecSyncError (child_process.js:611:11)
at execFileSync (child_process.js:629:15)

@lylest
Copy link

lylest commented Apr 8, 2020

same problem here

@infinitbility
Copy link

same problem here

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

@lylest
Copy link

lylest commented Apr 8, 2020

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

@RxMz
Copy link

RxMz commented Apr 19, 2020

Facing the same problem 😞

@ethanwc
Copy link

ethanwc commented Apr 19, 2020

Same

@noguerajulioces
Copy link

same

@rickhanlonii
Copy link
Member

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

@Rameshzende
Copy link

the same bug I am also facing

@mohammednur1997
Copy link

the same bug .. I ever have seen

@sametpalitci
Copy link

same

@chialuka
Copy link

chialuka commented Jul 6, 2020

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

@rickhanlonii
Copy link
Member

As mentioned in #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.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 6, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug 🌐Networking Related to a networking API. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests