问:
React native android on Windows: Task :app:generateDebugBuildConfig FAILED
I am trying to run an app on an Android emulator. After following the instructions in the React Native docs for installing Android Studio and setting the environment variables, I can create the default project, AwesomeProject, with "npx react-native init" but I cannot run it.

Keep failing the task
:app:generateDebugBuildConfig

I found several posts about this but none of them with the exception
Execution timed out

** Update
Tried ./gradlew clean & react-native run-android --port=8082

the error message:

```
info JS server already running.
info Launching emulator...
adb.exe: failed to check server version: protocol fault (couldn't read status): Connection reset by peer
* daemon not running; starting now at tcp:5037
* daemon started successfully
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

> Task :app:generateDebugBuildConfig
Unable to watch the file system for changes
net.rubygrapefruit.platform.NativeException: Execution timed out
        at net.rubygrapefruit.platform.internal.jni.AbstractFileEventFunctions$NativeFileWatcher.startWatching0(Native Method)
        at net.rubygrapefruit.platform.internal.jni.AbstractFileEventFunctions$NativeFileWatcher.startWatching(AbstractFileEventFunctions.java:198)
        at net.rubygrapefruit.platform.internal.jni.WindowsFileEventFunctions$WindowsFileWatcher.startWatching(WindowsFileEventFunctions.java:59)
        at org.gradle.internal.watch.registry.impl.HierarchicalFileWatcherUpdater.updateWatchedHierarchies(HierarchicalFileWatcherUpdater.java:154)
        at org.gradle.internal.watch.registry.impl.HierarchicalFileWatcherUpdater.virtualFileSystemContentsChanged(HierarchicalFileWatcherUpdater.java:92)
        at org.gradle.internal.watch.registry.impl.DefaultFileWatcherRegistry.virtualFileSystemContentsChanged(DefaultFileWatcherRegistry.java:147)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$updateNotifyingListeners$0(WatchingVirtualFileSystem.java:89)
        at org.gradle.internal.watch.registry.SnapshotCollectingDiffListener.publishSnapshotDiff(SnapshotCollectingDiffListener.java:32)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$updateNotifyingListeners$1(WatchingVirtualFileSystem.java:88)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$withWatcherChangeErrorHandling$7(WatchingVirtualFileSystem.java:313)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.withWatcherChangeErrorHandling(WatchingVirtualFileSystem.java:320)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.withWatcherChangeErrorHandling(WatchingVirtualFileSystem.java:312)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.updateNotifyingListeners(WatchingVirtualFileSystem.java:88)
        at org.gradle.internal.vfs.impl.AbstractVirtualFileSystem.lambda$store$1(AbstractVirtualFileSystem.java:46)
        at org.gradle.internal.vfs.impl.VfsRootReference.update(VfsRootReference.java:40)
        at org.gradle.internal.vfs.impl.AbstractVirtualFileSystem.store(AbstractVirtualFileSystem.java:46)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.snapshot(DefaultFileSystemAccess.java:156)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readLocation$6(DefaultFileSystemAccess.java:171)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$7(DefaultFileSystemAccess.java:196)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess$StripedProducerGuard.guardByKey(DefaultFileSystemAccess.java:219)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$8(DefaultFileSystemAccess.java:193)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:193)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:178)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readLocation(DefaultFileSystemAccess.java:171)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.read(DefaultFileSystemAccess.java:83)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter$SnapshottingVisitor.visitCollection(DefaultFileCollectionSnapshotter.java:61)
        at org.gradle.api.internal.file.AbstractOpaqueFileCollection.visitContents(AbstractOpaqueFileCollection.java:55)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
        at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:119)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.visitSingleFile(UnpackingVisitor.java:111)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:106)
        at org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection.visitChildren(DefaultFileCollectionFactory.java:333)
        at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter.snapshot(DefaultFileCollectionSnapshotter.java:51)
        at org.gradle.internal.execution.DefaultOutputSnapshotter$1.visitOutputProperty(DefaultOutputSnapshotter.java:40)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.visitOutputs(ExecuteActionsTaskExecuter.java:339)
        at org.gradle.internal.execution.DefaultOutputSnapshotter.snapshotOutputs(DefaultOutputSnapshotter.java:37)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionState(CaptureStateBeforeExecutionStep.java:160)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$captureExecutionStateOp$1(CaptureStateBeforeExecutionStep.java:127)
        at org.gradle.internal.execution.steps.BuildOperationStep$1.call(BuildOperationStep.java:37)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.execution.steps.BuildOperationStep.operation(BuildOperationStep.java:34)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionStateOp(CaptureStateBeforeExecutionStep.java:126)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$execute$0(CaptureStateBeforeExecutionStep.java:72)
        at java.base/java.util.Optional.map(Optional.java:265)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:72)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:92)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:92)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:33)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:284)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
        at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        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:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:402)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:389)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:382)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:368)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
        at java.base/java.lang.Thread.run(Thread.java:829)

> Task :app:generateDebugBuildConfig FAILED
2 actionable tasks: 2 executed
Gradle was unable to watch the file system for changes
net.rubygrapefruit.platform.NativeException: Execution timed out
        at net.rubygrapefruit.platform.internal.jni.AbstractFileEventFunctions$NativeFileWatcher.startWatching0(Native Method)
        at net.rubygrapefruit.platform.internal.jni.AbstractFileEventFunctions$NativeFileWatcher.startWatching(AbstractFileEventFunctions.java:198)
        at net.rubygrapefruit.platform.internal.jni.WindowsFileEventFunctions$WindowsFileWatcher.startWatching(WindowsFileEventFunctions.java:59)
        at org.gradle.internal.watch.registry.impl.HierarchicalFileWatcherUpdater.updateWatchedHierarchies(HierarchicalFileWatcherUpdater.java:154)
        at org.gradle.internal.watch.registry.impl.HierarchicalFileWatcherUpdater.virtualFileSystemContentsChanged(HierarchicalFileWatcherUpdater.java:92)
        at org.gradle.internal.watch.registry.impl.DefaultFileWatcherRegistry.virtualFileSystemContentsChanged(DefaultFileWatcherRegistry.java:147)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$updateNotifyingListeners$0(WatchingVirtualFileSystem.java:89)
        at org.gradle.internal.watch.registry.SnapshotCollectingDiffListener.publishSnapshotDiff(SnapshotCollectingDiffListener.java:32)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$updateNotifyingListeners$1(WatchingVirtualFileSystem.java:88)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$withWatcherChangeErrorHandling$7(WatchingVirtualFileSystem.java:313)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.withWatcherChangeErrorHandling(WatchingVirtualFileSystem.java:320)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.withWatcherChangeErrorHandling(WatchingVirtualFileSystem.java:312)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.updateNotifyingListeners(WatchingVirtualFileSystem.java:88)
        at org.gradle.internal.vfs.impl.AbstractVirtualFileSystem.lambda$store$1(AbstractVirtualFileSystem.java:46)
        at org.gradle.internal.vfs.impl.VfsRootReference.update(VfsRootReference.java:40)
        at org.gradle.internal.vfs.impl.AbstractVirtualFileSystem.store(AbstractVirtualFileSystem.java:46)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.snapshot(DefaultFileSystemAccess.java:156)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readLocation$6(DefaultFileSystemAccess.java:171)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$7(DefaultFileSystemAccess.java:196)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess$StripedProducerGuard.guardByKey(DefaultFileSystemAccess.java:219)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$8(DefaultFileSystemAccess.java:193)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:193)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:178)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readLocation(DefaultFileSystemAccess.java:171)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.read(DefaultFileSystemAccess.java:83)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter$SnapshottingVisitor.visitCollection(DefaultFileCollectionSnapshotter.java:61)
        at org.gradle.api.internal.file.AbstractOpaqueFileCollection.visitContents(AbstractOpaqueFileCollection.java:55)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
        at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:119)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.visitSingleFile(UnpackingVisitor.java:111)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:106)
        at org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection.visitChildren(DefaultFileCollectionFactory.java:333)
        at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter.snapshot(DefaultFileCollectionSnapshotter.java:51)
        at org.gradle.internal.execution.DefaultOutputSnapshotter$1.visitOutputProperty(DefaultOutputSnapshotter.java:40)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.visitOutputs(ExecuteActionsTaskExecuter.java:339)
        at org.gradle.internal.execution.DefaultOutputSnapshotter.snapshotOutputs(DefaultOutputSnapshotter.java:37)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionState(CaptureStateBeforeExecutionStep.java:160)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$captureExecutionStateOp$1(CaptureStateBeforeExecutionStep.java:127)
        at org.gradle.internal.execution.steps.BuildOperationStep$1.call(BuildOperationStep.java:37)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.execution.steps.BuildOperationStep.operation(BuildOperationStep.java:34)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionStateOp(CaptureStateBeforeExecutionStep.java:126)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$execute$0(CaptureStateBeforeExecutionStep.java:72)
        at java.base/java.util.Optional.map(Optional.java:265)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:72)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:92)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:92)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:33)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:284)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)

        at java.base/java.lang.Thread.run(Thread.java:829)
Caught exception: Execution timed out
Stopping file watching and invalidating VFS after an error happened

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
> Watcher did not terminate within 5 seconds

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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

BUILD FAILED in 1m

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Caught exception: Execution timed out
Stopping file watching and invalidating VFS after an error happened

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
> Watcher did not terminate within 5 seconds

* 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

```
<p>Any clue what's the problem or maybe solution?</p>
<p>*** Update
Here is some parts of the hs_err_pid .log</p>
```Event: 834.200 Thread 0x00000208caecf800 Exception  (0x00000000f6c00858) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 212]
Event: 834.201 Thread 0x00000208caecf800 Exception  (0x00000000f6c0c9a0) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 212]
Event: 839.256 Thread 0x00000208caecf800 Exception  (0x00000000f6f6f850) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\interpreter\linkResolver
Event: 844.485 Thread 0x00000208caecf800 Implicit null exception at 0x00000208b79e2c5f to 0x00000208b79e4405
Event: 844.486 Thread 0x00000208caecf800 Exception  (0x00000000f5674b38) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\prims\jni.cpp, line 737]
Event: 844.497 Thread 0x00000208cbe2b000 Exception <a 'java/lang/NoSuchMethodError': <clinit>> (0x00000000f571a780) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\prims\jni.cpp, line 1615]
Event: 844.497 Thread 0x00000208cbe2b000 Exception <a 'java/lang/NoSuchMethodError': <clinit>> (0x00000000f571c4e0) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\prims\jni.cpp, line 1615]
```

答:
From the log you sent error Failed to launch emulator. Reason: Could not start emulator within 30 seconds it's an error with the ADB emulator itself.

Launch the android emulator first: Android Studio -> 3 dots in the corner -> Virtual Device Manager -> Play button

Then, try to install the app again.

Body:
I am trying to run an app on an Android emulator. After following the instructions in the React Native docs for installing Android Studio and setting the environment variables, I can create the default project, AwesomeProject, with "npx react-native init" but I cannot run it.

Keep failing the task
:app:generateDebugBuildConfig

I found several posts about this but none of them with the exception
Execution timed out

** Update
Tried ./gradlew clean & react-native run-android --port=8082

the error message:

info JS server already running.
info Launching emulator...
adb.exe: failed to check server version: protocol fault (couldn't read status): Connection reset by peer
* daemon not running; starting now at tcp:5037
* daemon started successfully
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

> Task :app:generateDebugBuildConfig
Unable to watch the file system for changes
net.rubygrapefruit.platform.NativeException: Execution timed out
        at net.rubygrapefruit.platform.internal.jni.AbstractFileEventFunctions$NativeFileWatcher.startWatching0(Native Method)
        at net.rubygrapefruit.platform.internal.jni.AbstractFileEventFunctions$NativeFileWatcher.startWatching(AbstractFileEventFunctions.java:198)
        at net.rubygrapefruit.platform.internal.jni.WindowsFileEventFunctions$WindowsFileWatcher.startWatching(WindowsFileEventFunctions.java:59)
        at org.gradle.internal.watch.registry.impl.HierarchicalFileWatcherUpdater.updateWatchedHierarchies(HierarchicalFileWatcherUpdater.java:154)
        at org.gradle.internal.watch.registry.impl.HierarchicalFileWatcherUpdater.virtualFileSystemContentsChanged(HierarchicalFileWatcherUpdater.java:92)
        at org.gradle.internal.watch.registry.impl.DefaultFileWatcherRegistry.virtualFileSystemContentsChanged(DefaultFileWatcherRegistry.java:147)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$updateNotifyingListeners$0(WatchingVirtualFileSystem.java:89)
        at org.gradle.internal.watch.registry.SnapshotCollectingDiffListener.publishSnapshotDiff(SnapshotCollectingDiffListener.java:32)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$updateNotifyingListeners$1(WatchingVirtualFileSystem.java:88)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$withWatcherChangeErrorHandling$7(WatchingVirtualFileSystem.java:313)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.withWatcherChangeErrorHandling(WatchingVirtualFileSystem.java:320)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.withWatcherChangeErrorHandling(WatchingVirtualFileSystem.java:312)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.updateNotifyingListeners(WatchingVirtualFileSystem.java:88)
        at org.gradle.internal.vfs.impl.AbstractVirtualFileSystem.lambda$store$1(AbstractVirtualFileSystem.java:46)
        at org.gradle.internal.vfs.impl.VfsRootReference.update(VfsRootReference.java:40)
        at org.gradle.internal.vfs.impl.AbstractVirtualFileSystem.store(AbstractVirtualFileSystem.java:46)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.snapshot(DefaultFileSystemAccess.java:156)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readLocation$6(DefaultFileSystemAccess.java:171)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$7(DefaultFileSystemAccess.java:196)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess$StripedProducerGuard.guardByKey(DefaultFileSystemAccess.java:219)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$8(DefaultFileSystemAccess.java:193)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:193)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:178)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readLocation(DefaultFileSystemAccess.java:171)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.read(DefaultFileSystemAccess.java:83)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter$SnapshottingVisitor.visitCollection(DefaultFileCollectionSnapshotter.java:61)
        at org.gradle.api.internal.file.AbstractOpaqueFileCollection.visitContents(AbstractOpaqueFileCollection.java:55)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
        at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:119)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.visitSingleFile(UnpackingVisitor.java:111)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:106)
        at org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection.visitChildren(DefaultFileCollectionFactory.java:333)
        at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter.snapshot(DefaultFileCollectionSnapshotter.java:51)
        at org.gradle.internal.execution.DefaultOutputSnapshotter$1.visitOutputProperty(DefaultOutputSnapshotter.java:40)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.visitOutputs(ExecuteActionsTaskExecuter.java:339)
        at org.gradle.internal.execution.DefaultOutputSnapshotter.snapshotOutputs(DefaultOutputSnapshotter.java:37)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionState(CaptureStateBeforeExecutionStep.java:160)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$captureExecutionStateOp$1(CaptureStateBeforeExecutionStep.java:127)
        at org.gradle.internal.execution.steps.BuildOperationStep$1.call(BuildOperationStep.java:37)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.execution.steps.BuildOperationStep.operation(BuildOperationStep.java:34)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionStateOp(CaptureStateBeforeExecutionStep.java:126)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$execute$0(CaptureStateBeforeExecutionStep.java:72)
        at java.base/java.util.Optional.map(Optional.java:265)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:72)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:92)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:92)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:33)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:284)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
        at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        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:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:402)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:389)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:382)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:368)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
        at java.base/java.lang.Thread.run(Thread.java:829)

> Task :app:generateDebugBuildConfig FAILED
2 actionable tasks: 2 executed
Gradle was unable to watch the file system for changes
net.rubygrapefruit.platform.NativeException: Execution timed out
        at net.rubygrapefruit.platform.internal.jni.AbstractFileEventFunctions$NativeFileWatcher.startWatching0(Native Method)
        at net.rubygrapefruit.platform.internal.jni.AbstractFileEventFunctions$NativeFileWatcher.startWatching(AbstractFileEventFunctions.java:198)
        at net.rubygrapefruit.platform.internal.jni.WindowsFileEventFunctions$WindowsFileWatcher.startWatching(WindowsFileEventFunctions.java:59)
        at org.gradle.internal.watch.registry.impl.HierarchicalFileWatcherUpdater.updateWatchedHierarchies(HierarchicalFileWatcherUpdater.java:154)
        at org.gradle.internal.watch.registry.impl.HierarchicalFileWatcherUpdater.virtualFileSystemContentsChanged(HierarchicalFileWatcherUpdater.java:92)
        at org.gradle.internal.watch.registry.impl.DefaultFileWatcherRegistry.virtualFileSystemContentsChanged(DefaultFileWatcherRegistry.java:147)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$updateNotifyingListeners$0(WatchingVirtualFileSystem.java:89)
        at org.gradle.internal.watch.registry.SnapshotCollectingDiffListener.publishSnapshotDiff(SnapshotCollectingDiffListener.java:32)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$updateNotifyingListeners$1(WatchingVirtualFileSystem.java:88)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.lambda$withWatcherChangeErrorHandling$7(WatchingVirtualFileSystem.java:313)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.withWatcherChangeErrorHandling(WatchingVirtualFileSystem.java:320)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.withWatcherChangeErrorHandling(WatchingVirtualFileSystem.java:312)
        at org.gradle.internal.watch.vfs.impl.WatchingVirtualFileSystem.updateNotifyingListeners(WatchingVirtualFileSystem.java:88)
        at org.gradle.internal.vfs.impl.AbstractVirtualFileSystem.lambda$store$1(AbstractVirtualFileSystem.java:46)
        at org.gradle.internal.vfs.impl.VfsRootReference.update(VfsRootReference.java:40)
        at org.gradle.internal.vfs.impl.AbstractVirtualFileSystem.store(AbstractVirtualFileSystem.java:46)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.snapshot(DefaultFileSystemAccess.java:156)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readLocation$6(DefaultFileSystemAccess.java:171)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$7(DefaultFileSystemAccess.java:196)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess$StripedProducerGuard.guardByKey(DefaultFileSystemAccess.java:219)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$8(DefaultFileSystemAccess.java:193)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:193)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:178)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readLocation(DefaultFileSystemAccess.java:171)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.read(DefaultFileSystemAccess.java:83)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter$SnapshottingVisitor.visitCollection(DefaultFileCollectionSnapshotter.java:61)
        at org.gradle.api.internal.file.AbstractOpaqueFileCollection.visitContents(AbstractOpaqueFileCollection.java:55)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
        at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:119)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.visitSingleFile(UnpackingVisitor.java:111)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:106)
        at org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection.visitChildren(DefaultFileCollectionFactory.java:333)
        at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter.snapshot(DefaultFileCollectionSnapshotter.java:51)
        at org.gradle.internal.execution.DefaultOutputSnapshotter$1.visitOutputProperty(DefaultOutputSnapshotter.java:40)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.visitOutputs(ExecuteActionsTaskExecuter.java:339)
        at org.gradle.internal.execution.DefaultOutputSnapshotter.snapshotOutputs(DefaultOutputSnapshotter.java:37)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionState(CaptureStateBeforeExecutionStep.java:160)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$captureExecutionStateOp$1(CaptureStateBeforeExecutionStep.java:127)
        at org.gradle.internal.execution.steps.BuildOperationStep$1.call(BuildOperationStep.java:37)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.execution.steps.BuildOperationStep.operation(BuildOperationStep.java:34)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionStateOp(CaptureStateBeforeExecutionStep.java:126)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$execute$0(CaptureStateBeforeExecutionStep.java:72)
        at java.base/java.util.Optional.map(Optional.java:265)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:72)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:92)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:92)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:33)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:284)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)

        at java.base/java.lang.Thread.run(Thread.java:829)
Caught exception: Execution timed out
Stopping file watching and invalidating VFS after an error happened

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
> Watcher did not terminate within 5 seconds

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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

BUILD FAILED in 1m

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Caught exception: Execution timed out
Stopping file watching and invalidating VFS after an error happened

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
> Watcher did not terminate within 5 seconds

* 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

Any clue what's the problem or maybe solution?

*** Update
Here is some parts of the hs_err_pid .log

Event: 834.200 Thread 0x00000208caecf800 Exception  (0x00000000f6c00858) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 212]
Event: 834.201 Thread 0x00000208caecf800 Exception  (0x00000000f6c0c9a0) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 212]
Event: 839.256 Thread 0x00000208caecf800 Exception  (0x00000000f6f6f850) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\interpreter\linkResolver
Event: 844.485 Thread 0x00000208caecf800 Implicit null exception at 0x00000208b79e2c5f to 0x00000208b79e4405
Event: 844.486 Thread 0x00000208caecf800 Exception  (0x00000000f5674b38) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\prims\jni.cpp, line 737]
Event: 844.497 Thread 0x00000208cbe2b000 Exception <a 'java/lang/NoSuchMethodError': <clinit>> (0x00000000f571a780) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\prims\jni.cpp, line 1615]
Event: 844.497 Thread 0x00000208cbe2b000 Exception <a 'java/lang/NoSuchMethodError': <clinit>> (0x00000000f571c4e0) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u281\880\hotspot\src\share\vm\prims\jni.cpp, line 1615]


来源: stackexchange

问:
How to show text in original format from database?
I have a text, recorded in db as 'text'. In query it looks as it was - with all whitespaces.
But when I'm trying to output this text using {{$text}} in view - text loses all whitespaces and become jammed, like it was written all in one string.
I've tried to use Str::of($text)->toHtmlString(); but it throws Method Illuminate\Support\Stringable::toHtmlString does not exist

答:
If your data at '$text' something like this

 This example data

You can try this {!! $text !!} at your view

ContentLicense: CC BY-SA 4.0


问:
The method 'firstWhere' isn't defined for the type 'Object' in flutter
Here is the code in which I'm getting two errors.
The first error I am getting is- "The method 'firstWhere' isn't defined for the object in flutter" and second one is-"The argument type 'Object?' can't be assigned to the parameter type 'List'"

I am new in fetching data from api and working with these things so I am not sure how to shorten this.

```<code>                  FutureBuilder(
                    future: countryList,
                      builder: (context,snapshot){
                      if(snapshot.hasData){
                        return TypeAheadFormField(
                          textFieldConfiguration: TextFieldConfiguration(
                            controller: this._typeAheadController,
                            decoration: InputDecoration(
                              hintText: 'Type here country name',
                              hintStyle: TextStyle(fontSize: 16),
                              border: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(15),
                                borderSide: BorderSide(
                                  width: 0,
                                  style: BorderStyle.none,
                                ),
                              ),
                              filled: true,
                              fillColor: Colors.grey[200],
                              contentPadding: EdgeInsets.all(20),
                              prefixIcon: Padding(
                                padding: EdgeInsets.only(left: 24.0, right: 16.0),
                                child: Icon(
                                  Icons.search,
                                  color: Colors.black,
                                  size: 28,
                                ),
                              ),
                            ),
                          ),
                          suggestionsCallback: (pattern) {
                            return _getSuggestions(snapshot.data, pattern);

                          },
                          itemBuilder: (context, suggestion) {
                            return ListTile(
                              title: Text(suggestion.toString()),
                            );
                          },
                          transitionBuilder: (context, suggestionsBox, controller) {
                            return suggestionsBox;
                          },
                          onSuggestionSelected: (suggestion) {
                            this._typeAheadController.text = suggestion.toString();
                        setState(() {
                          summaryList = covidService.getCountrySummary(
                              snapshot.data! .firstWhere((element) => element.country == suggestion).slug);

                        });
                          },
                        );
                      }
                      else return Text("Loading...");
                      }
                      ),
                    FutureBuilder(
                      future: summaryList,
                      builder: (context,snapshot){
                           if(snapshot.hasData){
                              return Final_Data(summaryList:snapshot.data);
                           }
                           else if(snapshot.connectionState==ConnectionState.active){
                             return Text("Connections state");
                           }
                           else if(snapshot.hasError){
                             return Text("Error");
                           }
                           else return Text("Eroro adl");
                      },
                    ),
</code>```

Error...

```<code>The method 'firstWhere' isn't defined for the type 'Object'.
The argument type 'Object?' can't be assigned to the parameter type 'List<CountrySummaryModel>'.
</code>```

答:
Have you tried using generics? Give a specific type to your FutureBuilder like:

FutureBuilder<List<String>>(
// your code here
);
```

Body:
Here is the code in which I'm getting two errors.
The first error I am getting is- "The method 'firstWhere' isn't defined for the object in flutter" and second one is-"The argument type 'Object?' can't be assigned to the parameter type 'List'"

I am new in fetching data from api and working with these things so I am not sure how to shorten this.

                  FutureBuilder(
                    future: countryList,
                      builder: (context,snapshot){
                      if(snapshot.hasData){
                        return TypeAheadFormField(
                          textFieldConfiguration: TextFieldConfiguration(
                            controller: this._typeAheadController,
                            decoration: InputDecoration(
                              hintText: 'Type here country name',
                              hintStyle: TextStyle(fontSize: 16),
                              border: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(15),
                                borderSide: BorderSide(
                                  width: 0,
                                  style: BorderStyle.none,
                                ),
                              ),
                              filled: true,
                              fillColor: Colors.grey[200],
                              contentPadding: EdgeInsets.all(20),
                              prefixIcon: Padding(
                                padding: EdgeInsets.only(left: 24.0, right: 16.0),
                                child: Icon(
                                  Icons.search,
                                  color: Colors.black,
                                  size: 28,
                                ),
                              ),
                            ),
                          ),
                          suggestionsCallback: (pattern) {
                            return _getSuggestions(snapshot.data, pattern);

                          },
                          itemBuilder: (context, suggestion) {
                            return ListTile(
                              title: Text(suggestion.toString()),
                            );
                          },
                          transitionBuilder: (context, suggestionsBox, controller) {
                            return suggestionsBox;
                          },
                          onSuggestionSelected: (suggestion) {
                            this._typeAheadController.text = suggestion.toString();
                        setState(() {
                          summaryList = covidService.getCountrySummary(
                              snapshot.data! .firstWhere((element) => element.country == suggestion).slug);

                        });
                          },
                        );
                      }
                      else return Text("Loading...");
                      }
                      ),
                    FutureBuilder(
                      future: summaryList,
                      builder: (context,snapshot){
                           if(snapshot.hasData){
                              return Final_Data(summaryList:snapshot.data);
                           }
                           else if(snapshot.connectionState==ConnectionState.active){
                             return Text("Connections state");
                           }
                           else if(snapshot.hasError){
                             return Text("Error");
                           }
                           else return Text("Eroro adl");
                      },
                    ),

Error...

The method 'firstWhere' isn't defined for the type 'Object'.
The argument type 'Object?' can't be assigned to the parameter type 'List<CountrySummaryModel>'.


问:
Google's BottomSheet appears at top of screen
I'm using android's new BottomSheet inside Design Library.
Problem is that I'm using it inside a Fragment and It cause that it appear at top of screen instead of appearing at bottom.

This is my Activity xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="ir.aidinsoft.quicktaxi.MainActivity">

    <android.support.v7.widget.Toolbar
        android:id="@+id/tlbr_acMain"
        android:elevation="5dp"
        android:background="@color/colorPrimary"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/crdl_acMain"
        android:layout_below="@+id/tlbr_acMain"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v4.widget.NestedScrollView
            android:id="@+id/nscv_acMain"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <RelativeLayout
                android:id="@+id/frml_acMain"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </android.support.v4.widget.NestedScrollView>

    </android.support.design.widget.CoordinatorLayout>

</RelativeLayout>
```

<p>And This Is My Fragment xml:</p>

<pre class="lang-xml prettyprint-override"><code><android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="ir.aidinsoft.quicktaxi.MyFragment">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <io.codetail.widget.RevealFrameLayout
            android:id="@+id/rvfl_frTaxi"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="invisible">

            <fragment
                android:id="@+id/frag_frTaxi_map"
                android:name="com.google.android.gms.maps.SupportMapFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </io.codetail.widget.RevealFrameLayout>

    </RelativeLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/facb_frTaxi_request"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <!-- My Bottom Sheet Layout -->
    <FrameLayout
        android:id="@+id/frml_frTaxi_bottomSheet"
        android:layout_width="match_parent"
        android:layout_height="360dp"
        android:background="@color/colorPrimaryLight"
        app:behavior_hideable="true"
        app:layout_behavior="android.support.design.widget.BottomSheetBehavior" />

</android.support.design.widget.CoordinatorLayout>
</code>```

So after Replacing Fragment in Layout with this code:

getSupportFragmentManager().beginTransaction().replace(R.id.frml_acMain,  taxiFragment).commit();
```

<p>I adde this code to reveal BottomSheet on FAB clicked state.
Java Code for Fragment:</p>

<pre class="lang-java prettyprint-override"><code>@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment, container, false);
    fab = (FloatingActionButton) view.findViewById(R.id.facb_frTaxi_request);
    bottomSheet = view.findViewById(R.id.frml_frTaxi_bottomSheet);
    BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
    return view;
}

@Override
public void onResume() {
    super.onResume();
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
        }
    });
}
</code>```

What is the problem? what I'm doing wrong?
TnQ

答: If you are using animateLayoutChanges inside your layout, removing it can fix your problem.

ContentLicense: CC BY-SA 3.0

Body:
I'm using android's new BottomSheet inside Design Library.
Problem is that I'm using it inside a Fragment and It cause that it appear at top of screen instead of appearing at bottom.

This is my Activity xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="ir.aidinsoft.quicktaxi.MainActivity">

    <android.support.v7.widget.Toolbar
        android:id="@+id/tlbr_acMain"
        android:elevation="5dp"
        android:background="@color/colorPrimary"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/crdl_acMain"
        android:layout_below="@+id/tlbr_acMain"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v4.widget.NestedScrollView
            android:id="@+id/nscv_acMain"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <RelativeLayout
                android:id="@+id/frml_acMain"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </android.support.v4.widget.NestedScrollView>

    </android.support.design.widget.CoordinatorLayout>

</RelativeLayout>

And This Is My Fragment xml:

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="ir.aidinsoft.quicktaxi.MyFragment">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <io.codetail.widget.RevealFrameLayout
            android:id="@+id/rvfl_frTaxi"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="invisible">

            <fragment
                android:id="@+id/frag_frTaxi_map"
                android:name="com.google.android.gms.maps.SupportMapFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </io.codetail.widget.RevealFrameLayout>

    </RelativeLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/facb_frTaxi_request"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <FrameLayout
        android:id="@+id/frml_frTaxi_bottomSheet"
        android:layout_width="match_parent"
        android:layout_height="360dp"
        android:background="@color/colorPrimaryLight"
        app:behavior_hideable="true"
        app:layout_behavior="android.support.design.widget.BottomSheetBehavior" />

</android.support.design.widget.CoordinatorLayout>

So after Replacing Fragment in Layout with this code:

getSupportFragmentManager().beginTransaction().replace(R.id.frml_acMain,  taxiFragment).commit();

I adde this code to reveal BottomSheet on FAB clicked state.
Java Code for Fragment:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment, container, false);
    fab = (FloatingActionButton) view.findViewById(R.id.facb_frTaxi_request);
    bottomSheet = view.findViewById(R.id.frml_frTaxi_bottomSheet);
    BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
    return view;
}

@Override
public void onResume() {
    super.onResume();
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
        }
    });
}

What is the problem? what I'm doing wrong?
TnQ


问:
Pull password from gnome keyring in Julia?
I’ve looked around but can not find a julia package that will let me pull an encrypted password which is stored in my linux gnome keyring. I use it for keeping scripts that connect to SQL servers, anonymous because I have to distribute them to several group members.

In R, the “keyringer” package has a “decrypt_gk_pw” function that can pull a stored password right from the gnome keyring. Is there anything analogous in Julia or would we have to build it?

答:
This is my final solution, and it does work to hide the password, but anyone who knows Julia can simply remove the semicolon at the end, and it will appear, so not exactly what I wanted. I have to circulate this code to colleagues and others. The syntax for the ODBC connection is very specific with respect to “,” and “;” . Thx. J</p>
```<code>con3 = ODBC.Connection(
    "Driver=ODBC Driver 17 for SQL Server;
    SERVER=66.66.66.66;
    DATABASE=dbname;
    UID=username;
    PWD=$(read(`secret-tool lookup word1 word2 word3 word4`,String))");
</code>```

Body:
This is my final solution, and it does work to hide the password, but anyone who knows Julia can simply remove the semicolon at the end, and it will appear, so not exactly what I wanted. I have to circulate this code to colleagues and others. The syntax for the ODBC connection is very specific with respect to “,” and “;” . Thx. J

con3 = ODBC.Connection(
    "Driver=ODBC Driver 17 for SQL Server;
    SERVER=66.66.66.66;
    DATABASE=dbname;
    UID=username;
    PWD=$(read(`secret-tool lookup word1 word2 word3 word4`,String))");


问:
Can't remove open logical volume
I am trying to remove a logical volume but it is throwing the error:

Can't remove open logical volume "TestDeliveries"

does anyone know the problem

答:
Try this one.

```<code>while [ $? -eq "5" ]; do lvremove -f /dev/vg_laptop/lv_home ;
done
Can't remove open logical volume "lv_home"
Can't remove open logical volume "lv_home"
Can't remove open logical volume "lv_home"
Logical volume "lv_home" successfully removed
</code>```

From https://bugzilla.redhat.com/show_bug.cgi?id=577798

Title: Can't remove open logical volume

Body:
Try this one.

while [ $? -eq "5" ]; do lvremove -f /dev/vg_laptop/lv_home ;
done
Can't remove open logical volume "lv_home"
Can't remove open logical volume "lv_home"
Can't remove open logical volume "lv_home"
Logical volume "lv_home" successfully removed

From https://bugzilla.redhat.com/show_bug.cgi?id=577798


问:
TypeError: not all arguments converted during string formatting - psycopg2 - mogrify - python 3.9.5
I want to save a list of strings to a postgresDB with psycopg2 in python 3.9.5. When I store the data as a python list and send it to the database with execute I get the following error.

TypeError: not all arguments converted during string formatting
My code looks like this

```<code>import psycopg2

dbName = "testDB"

with psycopg2.connect(user="user", password="password") as conn:
    cur = conn.cursor()

    alon = (1,2,3)

    cur.execute("Insert into " + dbName + "(url,arrayInp) VALUES ('test_url',%s)",alon)
</code>```

This error does not occur when I "create" the list inside the execute statement like this

```<code>import psycopg2

dbName = "testDB"

with psycopg2.connect(user="user", password="password") as conn:
    cur = conn.cursor()

    cur.mogrify("Insert into " + dbName + "(url,arrayInp) VALUES ('test_url','{{1},{2},{3}}')")
</code>```

Whenever I try to use mogrify to send commands to the DB it works without errors, but nothing is inserted into the DB

答:
You get the error because cursor.execute() expects its second argument to be a sequence of values, and the number of values should match the number of "%s" placeholders in the SQL statement.  alon has three elements, but there is only one placeholder, so the exception is raised.

If you want to insert an array type, pass a list.  For example:

with psycopg2.connect(dbname='test') as conn:
    cur = conn.cursor()
    alon = [1, 2, 3]
    data = ('test_url', alon)
    # Double-quote table and column names if they contain upper-case characters
    stmt = f"""INSERT INTO "{table_name}" (url, "testInp") VALUES (%s, %s)"""
    cur.execute(stmt, data)
```
<p>If you want to insert only the array, wrap the list in a tuple:</p>
<pre class="lang-py prettyprint-override"><code>cur.execute("""INSERT INTO tbl (array_column) VALUES (%s)""", ([1, 2, 3],))
</code>```

cursor.mogrify builds a statement from placeholders and values, it doesn't send the statement to the database.

Body:
I want to save a list of strings to a postgresDB with psycopg2 in python 3.9.5. When I store the data as a python list and send it to the database with execute I get the following error.

TypeError: not all arguments converted during string formatting
My code looks like this

import psycopg2

dbName = "testDB"

with psycopg2.connect(user="user", password="password") as conn:
    cur = conn.cursor()

    alon = (1,2,3)

    cur.execute("Insert into " + dbName + "(url,arrayInp) VALUES ('test_url',%s)",alon)

This error does not occur when I "create" the list inside the execute statement like this

import psycopg2

dbName = "testDB"

with psycopg2.connect(user="user", password="password") as conn:
    cur = conn.cursor()

    cur.mogrify("Insert into " + dbName + "(url,arrayInp) VALUES ('test_url','{{1},{2},{3}}')")

Whenever I try to use mogrify to send commands to the DB it works without errors, but nothing is inserted into the DB

Body:
You get the error because cursor.execute() expects its second argument to be a sequence of values, and the number of values should match the number of "%s" placeholders in the SQL statement.  alon has three elements, but there is only one placeholder, so the exception is raised.

If you want to insert an array type, pass a list.  For example:

with psycopg2.connect(dbname='test') as conn:
    cur = conn.cursor()
    alon = [1, 2, 3]
    data = ('test_url', alon)
    # Double-quote table and column names if they contain upper-case characters
    stmt = f"""INSERT INTO "{table_name}" (url, "testInp") VALUES (%s, %s)"""
    cur.execute(stmt, data)

If you want to insert only the array, wrap the list in a tuple:

cur.execute("""INSERT INTO tbl (array_column) VALUES (%s)""", ([1, 2, 3],))

cursor.mogrify builds a statement from placeholders and values, it doesn't send the statement to the database.


问:
Add fields in Serializer dynamically
I have a View in which I receive the request and it returns the serialized data

views.py

```<code>class AllotmentReportsView(APIView):
    permission_classes = (permissions.IsAuthenticated,)

    def get(self, request):
        sfields = request.GET['sfields']           #I can get the fields in params
        serializer = AllotReportSerializer(items, many=True)
        return Response(serializer.data, status=status.HTTP_201_CREATED)
</code>```

serializer.py

```<code>class AllotReportSerializer(serializers.ModelSerializer):

    send_from_warehouse = serializers.SlugRelatedField(read_only=True, slug_field='name')
    transport_by = serializers.SlugRelatedField(read_only=True, slug_field='name')
    sales_order = AllotSOSerializer(many=False)
    flows = AllotFlowsSerializer(many=True)

    class Meta:
        model = Allotment
        fields = ( 'transaction_no', 'dispatch_date', 'sales_order',
                   'is_delivered', 'send_from_warehouse', 'transport_by',
                   'flows', )
</code>```

Instead of defining the fields in serializer can I pass the fields dynamically from the view sfields and pass them to the serializer ?

答:
You do not need to describe the fields in the ModelSerializer -

```<code>class AllotReportSerializer(serializers.ModelSerializer):

    class Meta:
        model = Allotment
        fields = ( 'transaction_no', 'dispatch_date', 'sales_order',
                   'is_delivered', 'send_from_warehouse', 'transport_by',
                   'flows', )
    extra_kwargs = {
           "url": {
               "lookup_field": "slug",
               "view_name": "api-your-model-name-detail",
            }
</code>```

you can define extra kwargs if you want in the above way.
This is enough.

If you want to add all the fields in your model, you can do this -

```<code>class Meta:
    model = Your model name
    fields = "__all__"
</code>```

You can read more about it here - https://www.django-rest-framework.org/api-guide/serializers/

Title: Add fields in Serializer dynamically

Body:
I have a View in which I receive the request and it returns the serialized data

views.py

class AllotmentReportsView(APIView):
    permission_classes = (permissions.IsAuthenticated,)

    def get(self, request):
        sfields = request.GET['sfields']           #I can get the fields in params
        serializer = AllotReportSerializer(items, many=True)
        return Response(serializer.data, status=status.HTTP_201_CREATED)

serializer.py

class AllotReportSerializer(serializers.ModelSerializer):

    send_from_warehouse = serializers.SlugRelatedField(read_only=True, slug_field='name')
    transport_by = serializers.SlugRelatedField(read_only=True, slug_field='name')
    sales_order = AllotSOSerializer(many=False)
    flows = AllotFlowsSerializer(many=True)

    class Meta:
        model = Allotment
        fields = ( 'transaction_no', 'dispatch_date', 'sales_order',
                   'is_delivered', 'send_from_warehouse', 'transport_by',
                   'flows', )

Instead of defining the fields in serializer can I pass the fields dynamically from the view sfields and pass them to the serializer ?

Body:
You do not need to describe the fields in the ModelSerializer -

class AllotReportSerializer(serializers.ModelSerializer):

    class Meta:
        model = Allotment
        fields = ( 'transaction_no', 'dispatch_date', 'sales_order',
                   'is_delivered', 'send_from_warehouse', 'transport_by',
                   'flows', )
    extra_kwargs = {
           "url": {
               "lookup_field": "slug",
               "view_name": "api-your-model-name-detail",
            }

you can define extra kwargs if you want in the above way.
This is enough.

If you want to add all the fields in your model, you can do this -

class Meta:
    model = Your model name
    fields = "__all__"

You can read more about it here - https://www.django-rest-framework.org/api-guide/serializers/


问:
Index.html not accessed when opening website
I have a website, norway-yv.epizy.com. I use InfinityFree to host (I just want to use the website for practise and as a fun hobby project). They use filemanager.ai to manage my files. I have a vast system of files and folders (see below), and instead of having to upload every file and every folder I have made it so that everything is in the website folder. This way, I do not need to upload everything every time I change something in my local copy of the website. I want norway-yv.epizy.com to redirect to norway-yv.epizy.com/website/home.html, and have done this trough an index.html file. However, it only gives error 404.

My files

.htaccess

```<code>DirectoryIndex index.php index.html index.htm index2.html

ErrorDocument 403 https://infinityfree.net/errors/403/
ErrorDocument 404 https://infinityfree.net/errors/404/
ErrorDocument 500 https://infinityfree.net/errors/500/
</code>```

I have configured http://norway-yv.epizy.com/website/myerrorpages/[errornum].html as error page path in InfinityFree control panel

htdocs (folder, automatically created)

index.html

```<code><!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>norway-yv</title>
    </head>
    <body>
        <meta http-equiv="refresh" content="0; url=website/home.html">
    </body>
</html>
</code>```

website (folder, manually created)

index.html

```<code><!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>norway-yv</title>
    </head>
    <body>
        <meta http-equiv="refresh" content="0; url=home.html">
    </body>
</html>
</code>```

home.html

```<code><html lang="en">
    <head>
        <title>norway-yv | home</title>
        <link rel="icon" type="image/png" href="../files/icons/favicon.png">
        <link rel="stylesheet" href="style/normal.css">
    </head>

    <body>
        <header>
            <a href="home.html">
                <img class="logoTop" src="files/icons/favicon.png" alt="Logo" />
            </a>
        </header>
        <h1>This is the website of norway-yv</h1>
        <p>I'm sorry for the horrible look of my website, but it is the best I can do</p>
        <h2>About me</h2>
        <p>I am a hobby developer who likes programming in Python. I am a student in Norwegian upper secondary school, year 1.<br>
            Some of my best projects can be found <a href="projects.html" >here.</a><br>
            Feel free to contact me trough GitHub.</p>
        <h2>Contact</h2>
        <p>
            <a href="https://stackoverflow.com/users/17496608/norway-yv" >StackOverflow</a><br>
            <a href="https://github.com/norway-yv"> GitHub (via GitHub e-mail)</a><br>
        </p>
    </body>
</html>
</code>```

projects.html

```<code><html lang="en">
    <head>
        <title>norway-yv | projects</title>
        <link rel="icon" type="image/png" href="../files/icons/favicon.png">
        <link rel="stylesheet" href="style/normal.css">
    </head>

    <body>
        <header>
            <a href="home.html">
                <img class="logoTop" src="files/icons/favicon.png" alt="Logo" />
            </a>
        </header>
        <h1>My projects</h1>
        <p>I have made tons more than this, mainly for scientific and mathematic purposes, but these are some of the projects I am most proud of:</p>
        <h2>kode24-calculator</h2>
        <p>An ongoing project, where I try to calculate expected wage for Norwegian developers using many different parametres.<br>
            For more information, see <a href="projects/kode24-calculator.html"> here. </a></p>
        <h2>binary-calculator</h2>
        <p>A project that sort of is finished, but still has a long way to go. Currently, it can calculate the sum of two binary numbers up to 32 bit size and output it.<br>
            For more information, see <a href="projects/binary-calculator.html"> here. </a></p>
    </body>
</html>
</code>```

My comments in the end

I have much more than this in my website, with several other folders. I can add them to the question if that is necessary. But I hope not.
The same problems do occur when previewing (using edge showing the local version). So it's more of a problem with my files than InfinityFree.

答:
Maybe it's not working because you are missing the <base> tag in your .
The base tag defines the base URL, from where relative URLS are redirected.

For more

Body:
I have a website, norway-yv.epizy.com. I use InfinityFree to host (I just want to use the website for practise and as a fun hobby project). They use filemanager.ai to manage my files. I have a vast system of files and folders (see below), and instead of having to upload every file and every folder I have made it so that everything is in the website folder. This way, I do not need to upload everything every time I change something in my local copy of the website. I want norway-yv.epizy.com to redirect to norway-yv.epizy.com/website/home.html, and have done this trough an index.html file. However, it only gives error 404.

My files

.htaccess

DirectoryIndex index.php index.html index.htm index2.html

ErrorDocument 403 https://infinityfree.net/errors/403/
ErrorDocument 404 https://infinityfree.net/errors/404/
ErrorDocument 500 https://infinityfree.net/errors/500/

I have configured http://norway-yv.epizy.com/website/myerrorpages/[errornum].html as error page path in InfinityFree control panel

htdocs (folder, automatically created)

index.html

<!DOCTYPE html>

        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>norway-yv</title>

        <meta http-equiv="refresh" content="0; url=website/home.html">

website (folder, manually created)

index.html

<!DOCTYPE html>

        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>norway-yv</title>

        <meta http-equiv="refresh" content="0; url=home.html">

home.html

        <title>norway-yv | home</title>
        <link rel="icon" type="image/png" href="../files/icons/favicon.png">
        <link rel="stylesheet" href="style/normal.css">

This is the website of norway-yv

I'm sorry for the horrible look of my website, but it is the best I can do

About me

I am a hobby developer who likes programming in Python. I am a student in Norwegian upper secondary school, year 1.

            Some of my best projects can be found here.

            Feel free to contact me trough GitHub.

Contact

            StackOverflow

             GitHub (via GitHub e-mail)

projects.html

        <title>norway-yv | projects</title>
        <link rel="icon" type="image/png" href="../files/icons/favicon.png">
        <link rel="stylesheet" href="style/normal.css">

My projects

I have made tons more than this, mainly for scientific and mathematic purposes, but these are some of the projects I am most proud of:

kode24-calculator

An ongoing project, where I try to calculate expected wage for Norwegian developers using many different parametres.

            For more information, see  here.

binary-calculator

A project that sort of is finished, but still has a long way to go. Currently, it can calculate the sum of two binary numbers up to 32 bit size and output it.

            For more information, see  here.

My comments in the end

I have much more than this in my website, with several other folders. I can add them to the question if that is necessary. But I hope not.
The same problems do occur when previewing (using edge showing the local version). So it's more of a problem with my files than InfinityFree.

Body:
Maybe it's not working because you are missing the <base> tag in your <head>.
The base tag defines the base URL, from where relative URLS are redirected.

For more


问:
Write a SQL Server query to modify XML tag not value
In my table column I have a value like:

```<code>    <Config>
        <Aidgets>
            <widget condition="true" typesenums="1,2" templatetypes="a,b">
                <![CDATA[All]]>
            </widget>
            <widget condition="true" typesenums="1" templatetypes="a" >
                <![CDATA[pdfprints]]>
            </widget>
         <Aidgets>
    </Config>
</code>```

Here I have to replace the value of

```<code><widget condition="true" typesenums="1,2" templatetypes="a,b">
</code>```

with

```<code><widget condition="true" typesenums="1,2,3" templatetypes="a,b,c">
</code>```

I have tried this but not working

```<code>UPDATE column
SET table = REPLACE(CAST(table AS NVARCHAR(MAX)), "firstvalue", "newvalue")
WHERE id = 1

</code>```

答:
You can use two XQuery .modify updates to do this

UPDATE [column]
SET [table].modify('replace value of
    (Config/Aidgets/widget[text() = "All"]/@typesenums)[1]
    with "1,2,3"
    ');

UPDATE [column]
SET [table].modify('replace value of
    (Config/Aidgets/widget[text() = "All"]/@templatetypes)[1]
    with "a,b,c"
    ');
```
<p>db<>fiddle</p>
<p>Alternatively, you can rebuild the whole XML instead.</p>
<pre class="lang-sql prettyprint-override"><code>UPDATE [column]
SET [table] = [table].query(
    '<Config>
    <Aidgets>
      {
        for $w in /Config/Aidgets/widget
        return
          if($w/text() = "All") then $w else
          <widget condition="true" typesenums="1,2,3" templatetypes="a,b,c">
            {$w/text()}
          </widget>
      }
    </Aidgets>
    </Config>'
)
</code>```

db<>fiddle

Body:
In my table column I have a value like:

    <Config>
        <Aidgets>
            <widget condition="true" typesenums="1,2" templatetypes="a,b">
                <![CDATA[All]]>
            </widget>
            <widget condition="true" typesenums="1" templatetypes="a" >
                <![CDATA[pdfprints]]>
            </widget>
         <Aidgets>
    </Config>

Here I have to replace the value of

<widget condition="true" typesenums="1,2" templatetypes="a,b">

with

<widget condition="true" typesenums="1,2,3" templatetypes="a,b,c">

I have tried this but not working

UPDATE column
SET table = REPLACE(CAST(table AS NVARCHAR(MAX)), "firstvalue", "newvalue")
WHERE id = 1

Body:
You can use two XQuery .modify updates to do this

UPDATE [column]
SET [table].modify('replace value of
    (Config/Aidgets/widget[text() = "All"]/@typesenums)[1]
    with "1,2,3"
    ');

UPDATE [column]
SET [table].modify('replace value of
    (Config/Aidgets/widget[text() = "All"]/@templatetypes)[1]
    with "a,b,c"
    ');

db<>fiddle

Alternatively, you can rebuild the whole XML instead.

UPDATE [column]
SET [table] = [table].query(
    '<Config>
    <Aidgets>
      {
        for $w in /Config/Aidgets/widget
        return
          if($w/text() = "All") then $w else
          <widget condition="true" typesenums="1,2,3" templatetypes="a,b,c">
            {$w/text()}
          </widget>
      }
    </Aidgets>
    </Config>'
)

db<>fiddle