问:
Apollo subscription only onConnected() is called. But subscription not invoked when there is update from server side
I have successfully implmented GraphQL with Apollo. Now I want to implment subscription part to receive live updates from server.
But for that when I apply com.amazonaws.appsync plugin it throws following error.

```<code>An exception occurred applying plugin request [id: 'com.amazonaws.appsync']
> Failed to apply plugin 'com.amazonaws.appsync'.
   > Cannot add extension with name 'apollo', as there is an extension already registered with that name.
org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'com.amazonaws.appsync']
Caused by: java.lang.IllegalArgumentException: Cannot add extension with name 'apollo', as there is an extension already registered with that name.
</code>```

1

```<code>plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
    id 'androidx.navigation.safeargs'
    id 'com.apollographql.apollo'
    id 'com.amazonaws.appsync'
}

</code>```

when I add last appsync plugin then I got below error

```Build file '/Volumes/EVO_Data/Client_Project/Halo_Android/halo-android/app/build.gradle' line: 7

An exception occurred applying plugin request [id: 'com.amazonaws.appsync']
> Failed to apply plugin 'com.amazonaws.appsync'.
   > Cannot add extension with name 'apollo', as there is an extension already registered with that name.

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

* Exception is:
org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'com.amazonaws.appsync']
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.exceptionOccurred(DefaultPluginRequestApplicator.java:228)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:210)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:148)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$200(DefaultPluginRequestApplicator.java:62)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1$1.lambda$add$1(DefaultPluginRequestApplicator.java:121)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$applyPlugins$0(DefaultPluginRequestApplicator.java:144)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:144)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:117)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
    at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
    at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:360)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:378)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:359)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:109)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:360)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$2(DefaultProjectStateRegistry.java:408)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:270)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:408)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:389)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:359)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:100)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:72)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:760)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:151)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.ensureConfigured(DefaultProjectStateRegistry.java:328)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:33)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:49)
    at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:50)
    at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:64)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40)
    at org.gradle.initialization.VintageBuildModelController.lambda$prepareProjects$3(VintageBuildModelController.java:89)
    at org.gradle.internal.model.StateTransitionController.lambda$doTransition$12(StateTransitionController.java:227)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:238)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:226)
    at org.gradle.internal.model.StateTransitionController.lambda$transitionIfNotPreviously$10(StateTransitionController.java:201)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:34)
    at org.gradle.internal.model.StateTransitionController.transitionIfNotPreviously(StateTransitionController.java:197)
    at org.gradle.initialization.VintageBuildModelController.prepareProjects(VintageBuildModelController.java:89)
    at org.gradle.initialization.VintageBuildModelController.getConfiguredModel(VintageBuildModelController.java:64)
    at org.gradle.internal.build.DefaultBuildLifecycleController.lambda$withProjectsConfigured$1(DefaultBuildLifecycleController.java:121)
    at org.gradle.internal.model.StateTransitionController.lambda$notInState$4(StateTransitionController.java:143)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44)
    at org.gradle.internal.model.StateTransitionController.notInState(StateTransitionController.java:139)
    at org.gradle.internal.build.DefaultBuildLifecycleController.withProjectsConfigured(DefaultBuildLifecycleController.java:121)
    at org.gradle.internal.build.DefaultBuildToolingModelController.locateBuilderForTarget(DefaultBuildToolingModelController.java:57)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildTreeModelController.lambda$locateBuilderForTarget$0(DefaultBuildTreeModelCreator.java:73)
    at org.gradle.internal.build.DefaultBuildLifecycleController.withToolingModels(DefaultBuildLifecycleController.java:178)
    at org.gradle.internal.build.AbstractBuildState.withToolingModels(AbstractBuildState.java:111)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildTreeModelController.locateBuilderForTarget(DefaultBuildTreeModelCreator.java:73)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildTreeModelController.locateBuilderForDefaultTarget(DefaultBuildTreeModelCreator.java:68)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getTarget(DefaultBuildController.java:157)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getModel(DefaultBuildController.java:101)
    at org.gradle.tooling.internal.consumer.connection.ParameterAwareBuildControllerAdapter.getModel(ParameterAwareBuildControllerAdapter.java:39)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.getModel(UnparameterizedBuildController.java:113)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.getModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:97)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:81)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:66)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:116)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:42)
    at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.runAction(AbstractClientProvidedBuildActionRunner.java:131)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.beforeTasks(AbstractClientProvidedBuildActionRunner.java:99)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator.beforeTasks(DefaultBuildTreeModelCreator.java:52)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$fromBuildModel$1(DefaultBuildTreeLifecycleController.java:75)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$runBuild$4(DefaultBuildTreeLifecycleController.java:106)
    at org.gradle.internal.model.StateTransitionController.lambda$transition$6(StateTransitionController.java:166)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:238)
    at org.gradle.internal.model.StateTransitionController.lambda$transition$7(StateTransitionController.java:166)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44)
    at org.gradle.internal.model.StateTransitionController.transition(StateTransitionController.java:166)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.runBuild(DefaultBuildTreeLifecycleController.java:103)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.fromBuildModel(DefaultBuildTreeLifecycleController.java:74)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner.runClientAction(AbstractClientProvidedBuildActionRunner.java:43)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:53)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.internal.buildtree.ProblemReportingBuildActionRunner.run(ProblemReportingBuildActionRunner.java:49)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:69)
    at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:119)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
    at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.lambda$execute$0(RootBuildLifecycleBuildActionExecutor.java:40)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:128)
    at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.execute(RootBuildLifecycleBuildActionExecutor.java:40)
    at org.gradle.internal.buildtree.DefaultBuildTreeContext.execute(DefaultBuildTreeContext.java:40)
    at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.lambda$execute$0(BuildTreeLifecycleBuildActionExecutor.java:65)
    at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53)
    at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.execute(BuildTreeLifecycleBuildActionExecutor.java:65)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:61)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:57)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor.execute(RunAsBuildOperationBuildActionExecutor.java:57)
    at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.lambda$execute$0(RunAsWorkerThreadBuildActionExecutor.java:36)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:270)
    at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:119)
    at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.execute(RunAsWorkerThreadBuildActionExecutor.java:36)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecutor.execute(ContinuousBuildActionExecutor.java:103)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecutor.execute(SubscribableBuildActionExecutor.java:64)
    at org.gradle.internal.session.DefaultBuildSessionContext.execute(DefaultBuildSessionContext.java:46)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:100)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:88)
    at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:69)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:62)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:41)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:63)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:58)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
    at org.gradle.util.internal.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'com.amazonaws.appsync'.
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:173)
    at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:137)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$applyPlugin$1(DefaultPluginRequestApplicator.java:150)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:206)
    ... 173 more
Caused by: java.lang.IllegalArgumentException: Cannot add extension with name 'apollo', as there is an extension already registered with that name.
    at org.gradle.internal.extensibility.ExtensionsStorage.add(ExtensionsStorage.java:40)
    at org.gradle.internal.extensibility.DefaultConvention.add(DefaultConvention.java:120)
    at org.gradle.internal.extensibility.DefaultConvention.addWithDefaultPublicType(DefaultConvention.java:212)
    at org.gradle.internal.extensibility.DefaultConvention.create(DefaultConvention.java:126)
    at jdk.internal.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at com.apollographql.apollo.gradle.ApolloPlugin.applyApolloPlugin(ApolloPlugin.groovy:60)
    at com.apollographql.apollo.gradle.ApolloPlugin.apply(ApolloPlugin.groovy:51)
    at com.apollographql.apollo.gradle.ApolloPlugin.apply(ApolloPlugin.groovy)
    at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
    at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:51)
    at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:187)
    at org.gradle.api.internal.plugins.DefaultPluginManager.access$100(DefaultPluginManager.java:52)
    at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:282)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.api.internal.plugins.DefaultPluginManager.lambda$doApply$0(DefaultPluginManager.java:167)
    at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:166)
    ... 176 more
```

I've tried solution from the same issue posted on apollo-kotlin issues 1864

But no luck.

Kindly help if anyone knows the fix

Thanks in Advance

Body:
I have successfully implmented GraphQL with Apollo. Now I want to implment subscription part to receive live updates from server.
But for that when I apply com.amazonaws.appsync plugin it throws following error.

An exception occurred applying plugin request [id: 'com.amazonaws.appsync']
> Failed to apply plugin 'com.amazonaws.appsync'.
   > Cannot add extension with name 'apollo', as there is an extension already registered with that name.
org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'com.amazonaws.appsync']
Caused by: java.lang.IllegalArgumentException: Cannot add extension with name 'apollo', as there is an extension already registered with that name.

1

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
    id 'androidx.navigation.safeargs'
    id 'com.apollographql.apollo'
    id 'com.amazonaws.appsync'
}

when I add last appsync plugin then I got below error

Build file '/Volumes/EVO_Data/Client_Project/Halo_Android/halo-android/app/build.gradle' line: 7

An exception occurred applying plugin request [id: 'com.amazonaws.appsync']
> Failed to apply plugin 'com.amazonaws.appsync'.
   > Cannot add extension with name 'apollo', as there is an extension already registered with that name.

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

* Exception is:
org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'com.amazonaws.appsync']
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.exceptionOccurred(DefaultPluginRequestApplicator.java:228)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:210)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:148)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$200(DefaultPluginRequestApplicator.java:62)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1$1.lambda$add$1(DefaultPluginRequestApplicator.java:121)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$applyPlugins$0(DefaultPluginRequestApplicator.java:144)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:144)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:117)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
    at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
    at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:360)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:378)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:359)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:109)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:360)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$2(DefaultProjectStateRegistry.java:408)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:270)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:408)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:389)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:359)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:100)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:72)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:760)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:151)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.ensureConfigured(DefaultProjectStateRegistry.java:328)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:33)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:49)
    at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:50)
    at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:64)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40)
    at org.gradle.initialization.VintageBuildModelController.lambda$prepareProjects$3(VintageBuildModelController.java:89)
    at org.gradle.internal.model.StateTransitionController.lambda$doTransition$12(StateTransitionController.java:227)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:238)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:226)
    at org.gradle.internal.model.StateTransitionController.lambda$transitionIfNotPreviously$10(StateTransitionController.java:201)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:34)
    at org.gradle.internal.model.StateTransitionController.transitionIfNotPreviously(StateTransitionController.java:197)
    at org.gradle.initialization.VintageBuildModelController.prepareProjects(VintageBuildModelController.java:89)
    at org.gradle.initialization.VintageBuildModelController.getConfiguredModel(VintageBuildModelController.java:64)
    at org.gradle.internal.build.DefaultBuildLifecycleController.lambda$withProjectsConfigured$1(DefaultBuildLifecycleController.java:121)
    at org.gradle.internal.model.StateTransitionController.lambda$notInState$4(StateTransitionController.java:143)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44)
    at org.gradle.internal.model.StateTransitionController.notInState(StateTransitionController.java:139)
    at org.gradle.internal.build.DefaultBuildLifecycleController.withProjectsConfigured(DefaultBuildLifecycleController.java:121)
    at org.gradle.internal.build.DefaultBuildToolingModelController.locateBuilderForTarget(DefaultBuildToolingModelController.java:57)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildTreeModelController.lambda$locateBuilderForTarget$0(DefaultBuildTreeModelCreator.java:73)
    at org.gradle.internal.build.DefaultBuildLifecycleController.withToolingModels(DefaultBuildLifecycleController.java:178)
    at org.gradle.internal.build.AbstractBuildState.withToolingModels(AbstractBuildState.java:111)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildTreeModelController.locateBuilderForTarget(DefaultBuildTreeModelCreator.java:73)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildTreeModelController.locateBuilderForDefaultTarget(DefaultBuildTreeModelCreator.java:68)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getTarget(DefaultBuildController.java:157)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getModel(DefaultBuildController.java:101)
    at org.gradle.tooling.internal.consumer.connection.ParameterAwareBuildControllerAdapter.getModel(ParameterAwareBuildControllerAdapter.java:39)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.getModel(UnparameterizedBuildController.java:113)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.getModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:97)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:81)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:66)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:116)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:42)
    at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.runAction(AbstractClientProvidedBuildActionRunner.java:131)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.beforeTasks(AbstractClientProvidedBuildActionRunner.java:99)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator.beforeTasks(DefaultBuildTreeModelCreator.java:52)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$fromBuildModel$1(DefaultBuildTreeLifecycleController.java:75)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$runBuild$4(DefaultBuildTreeLifecycleController.java:106)
    at org.gradle.internal.model.StateTransitionController.lambda$transition$6(StateTransitionController.java:166)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:238)
    at org.gradle.internal.model.StateTransitionController.lambda$transition$7(StateTransitionController.java:166)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44)
    at org.gradle.internal.model.StateTransitionController.transition(StateTransitionController.java:166)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.runBuild(DefaultBuildTreeLifecycleController.java:103)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.fromBuildModel(DefaultBuildTreeLifecycleController.java:74)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner.runClientAction(AbstractClientProvidedBuildActionRunner.java:43)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:53)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.internal.buildtree.ProblemReportingBuildActionRunner.run(ProblemReportingBuildActionRunner.java:49)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:69)
    at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:119)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
    at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.lambda$execute$0(RootBuildLifecycleBuildActionExecutor.java:40)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:128)
    at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.execute(RootBuildLifecycleBuildActionExecutor.java:40)
    at org.gradle.internal.buildtree.DefaultBuildTreeContext.execute(DefaultBuildTreeContext.java:40)
    at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.lambda$execute$0(BuildTreeLifecycleBuildActionExecutor.java:65)
    at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53)
    at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.execute(BuildTreeLifecycleBuildActionExecutor.java:65)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:61)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:57)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor.execute(RunAsBuildOperationBuildActionExecutor.java:57)
    at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.lambda$execute$0(RunAsWorkerThreadBuildActionExecutor.java:36)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:270)
    at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:119)
    at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.execute(RunAsWorkerThreadBuildActionExecutor.java:36)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecutor.execute(ContinuousBuildActionExecutor.java:103)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecutor.execute(SubscribableBuildActionExecutor.java:64)
    at org.gradle.internal.session.DefaultBuildSessionContext.execute(DefaultBuildSessionContext.java:46)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:100)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:88)
    at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:69)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:62)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:41)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:63)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:58)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
    at org.gradle.util.internal.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'com.amazonaws.appsync'.
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:173)
    at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:137)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$applyPlugin$1(DefaultPluginRequestApplicator.java:150)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:206)
    ... 173 more
Caused by: java.lang.IllegalArgumentException: Cannot add extension with name 'apollo', as there is an extension already registered with that name.
    at org.gradle.internal.extensibility.ExtensionsStorage.add(ExtensionsStorage.java:40)
    at org.gradle.internal.extensibility.DefaultConvention.add(DefaultConvention.java:120)
    at org.gradle.internal.extensibility.DefaultConvention.addWithDefaultPublicType(DefaultConvention.java:212)
    at org.gradle.internal.extensibility.DefaultConvention.create(DefaultConvention.java:126)
    at jdk.internal.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at com.apollographql.apollo.gradle.ApolloPlugin.applyApolloPlugin(ApolloPlugin.groovy:60)
    at com.apollographql.apollo.gradle.ApolloPlugin.apply(ApolloPlugin.groovy:51)
    at com.apollographql.apollo.gradle.ApolloPlugin.apply(ApolloPlugin.groovy)
    at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
    at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:51)
    at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:187)
    at org.gradle.api.internal.plugins.DefaultPluginManager.access$100(DefaultPluginManager.java:52)
    at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:282)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.api.internal.plugins.DefaultPluginManager.lambda$doApply$0(DefaultPluginManager.java:167)
    at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:166)
    ... 176 more

I've tried solution from the same issue posted on apollo-kotlin issues 1864

But no luck.

Kindly help if anyone knows the fix

Thanks in Advance


来源: stackexchange

问:
why wso2 api manager gateway respond in unknown binary format after each 2 successful hit to specific api?
when I send requests to api manager gateway(port:8243) for specific api(actually when I call an api ) repeatedly,after second successful call(https://apigw.ir/public/v1/otherInfo/client) and with right response(in json format), in third api call ,api manager gateway respond in unknown binary format and here is a picture :

what is the problem ?

ContentLicense: CC BY-SA 4.0


问:
Razor View Component not rendering
I have a view component to create a responsive image. The Invoke signature is as follows:

```<code>public IViewComponentResult Invoke(string imageUrl, string alt, bool lazyLoad, string cssClass, string deferClassName)
</code>```

I have all the tag helpers registered in _ViewImports. Cleared bin and obj folders, restarted, cleaned and rebuilt.

I've added all params when calling the view component.

I did however notice though that intellisense only picks it up when I add a second parameter:

The same thing happens if alt is the param I add to the view component.

Anyway, either way the view component doesn't render and my breakpoint in the Invoke method isn't hit during debugging.

I'm using .net-core 6.0 and VS2022

ANSWER: I was passing the bool param as a string

Title: Razor View Component not rendering

Body:
I have a view component to create a responsive image. The Invoke signature is as follows:

public IViewComponentResult Invoke(string imageUrl, string alt, bool lazyLoad, string cssClass, string deferClassName)

I have all the tag helpers registered in _ViewImports. Cleared bin and obj folders, restarted, cleaned and rebuilt.

I've added all params when calling the view component.

I did however notice though that intellisense only picks it up when I add a second parameter:

The same thing happens if alt is the param I add to the view component.

Anyway, either way the view component doesn't render and my breakpoint in the Invoke method isn't hit during debugging.

I'm using .net-core 6.0 and VS2022

ANSWER: I was passing the bool param as a string


问:
How to pass Parameters to MainLayout in Blazor?
I have a problem with passing parameters in my BlazorWeb Project Net 6.0.

Description of the problem:
I have a razor components which is usually called Layout_1. I changed it to Startpage. On this page the User can type in a Project Number and if the Number is valid I´m calling a function which gets me all User information from a Model which was created in a Service called AuthentificationService.
After the function has finished it´s work I can see in debug mode that it has all information correctly received.
Now I want to pass this Model to my MainLayout and from there I want to use it on different Razor pages.
This does not work and I could not find any solution.

Code on my Layout_1(Startpage)

```<code>@inherits LayoutComponentBase
@inject NavigationManager NavigationManager
@inject AuthenticationStateProvider _AuthenticationStateProvider
@inject AuthentificationService _AuthentificationService
@inject GetProjektInfoService _GetProjektInfoService

<div class="page">
    <div class="container-fluid title-container">
        <h1>@Title</h1>
        <p>@Subtitle</p>
    </div>
    <div class="input-group-container">
        <form>
            <h5>Testing</h5>

            <div class="form-inline">
                 <EditForm Model="@model" OnSubmit="FormSubmit">
                    <DataAnnotationsValidator />
                     <div class="form-inline">
                        <InputText placeholder="@WatermarkText" class="radius" @bind-Value="@model.ProjectNumber"></InputText>
                        <button class="btn radius">@ButtonText</button>
                       </div>
                        <ValidationMessage For="()=> model.ProjectNumber" />
                    @if(model.ErrorMessage != "")
                    {
                        <label class="text-danger">@model.ErrorMessage</label>
                    }
                </EditForm>
            </div>
        </form>
    </div>
    </div>

<div>
    <div class="footer">
        <img src="/img/Homepage/Chart.png" />
        <img src="/img/Homepage/Database.png" />
        <img src="/img/Homepage/Cycle.png" />
        <img src="/img/Homepage/Table.png" />
        <img src="/img/Homepage/StatusDisplay.png" />
        <img src="/img/Homepage/PieChart.png" />
        <img src="/img/Homepage/BarChart.png" />
        <img src="/img/Homepage/Money.png" />
    </div>
</div>

@code {
    private string Title = "test1";
    public string Subtitle = "test2";
    public string ButtonText = "Start your configuration";
    public string WatermarkText = "Project number";

    public ValidationModel model { get; set; } = new();
    public class ValidationModel
    {
        [RegularExpression(@"^.*[K][-][0-9][0-9][0-9][0-9]$", ErrorMessage = "Input format is wrong! Please enter your format as follow: K-XXXX.")]
        public string ProjectNumber { get; set; } = "K-XXXX";

        public string ErrorMessage { get; set; } = "";
    }

    public AuthModel authModel = new();

    [CascadingParameter]
    public MainLayout MainLayout { get; set; } = new MainLayout();

}

@functions
{

    private void KeyPressHandler(KeyboardEventArgs e)
    {
        if (e.Key == "Enter")
        {
            return;
        }
    }

    public async Task FormSubmit(EditContext editContext)
    {
        bool FormIsValid = editContext.Validate();

        if (FormIsValid)
        {
            //user has entered a project number
            authModel = await _AuthentificationService.CheckAccess(true, true, model.ProjectNumber);

            MainLayout.authModel = authModel;

            bool use = await _GetProjektInfoService.Get(model.ProjectNumber);
            MainLayout.ProjectNumber = model.ProjectNumber;
            if (use)
            {
                NavigationManager.NavigateTo(String.Format("/projectdata/{0}", model.ProjectNumber));
            }
            else
            {
                model.ErrorMessage = "This project number can not be used in this context.";
            }
        }

    }

    protected async override Task OnInitializedAsync()
    {
        authModel = await _AuthentificationService.CheckAccess(true,false, model.ProjectNumber);
    }

}
</code>```

Code on my MainLayout:

```<code>@inherits LayoutComponentBase
@inject NavigationManager _NavigationManager
@inject AuthentificationService _AuthentificationService
@inject ProjectDataService _ProjectDataService
@inject GetISPService _GetISPService

@if (ShowSearchbar)
{
    <SearchBar ></SearchBar>
}
<div class="page">
    @if (ShowSidebar)
    {
        <SideNavBar SideBarMenu="@SideBarMenu" ShowSideNavMenu="@ShowSideNavMenu" Project="@Project" authModel="@authModel"></SideNavBar>
    }
    <div class="main">
            <CascadingValue Value="@this" >
            @if (ShowTopNavBar)
            {
                <TopNavBar Project="@Project" authModel="@authModel"></TopNavBar>
            }
            @*<CascadingValue Value="@this" >*@
            <div class="content px-4">
                @Body
            </div>
            </CascadingValue>
    </div>
</div>

@code{
    //main layout
    public bool ShowSearchbar { get; set; } = true;
    public bool ShowSidebar{ get; set; } = true;
    public bool ShowTopNavBar{ get; set; } = true;
    //side bar
    public string SideBarMenu { get; set; } = "Default";
    public bool ShowSideNavMenu { get; set; } = true;

    public ProductModel Product { get; set; } = new ProductModel();
    public ProductMatrixModel MatrixModel { get; set; } = new ProductMatrixModel();
    //Authenfification and User Data
    public AuthModel authModel { get; set; } = new AuthModel();

    //Currency binding from TopNav
    public string SelectedCurrency { get; set; }
    //PartModel
    public List<PartModel> Parts { get; set; }
    //Project Data
    public ProjectModel Project { get; set; } = new ProjectModel();

}
@functions{
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        await InvokeAsync(()=> StateHasChanged());

    }
</code>```

So as you can see I get on Layout_1 all information and passing them to MainLayout with MainLayout.authModel = authModel. Same with ProjectNumber. If I am debugging on this page, I can see that MainLayout has the correct values, but when it jumps to MainLayout it does not have any Information. Its alway null.
I hope I could describe my Problem well. I can provide more information when needed.
Thanks for any help.

Body:
I have a problem with passing parameters in my BlazorWeb Project Net 6.0.

Description of the problem:
I have a razor components which is usually called Layout_1. I changed it to Startpage. On this page the User can type in a Project Number and if the Number is valid I´m calling a function which gets me all User information from a Model which was created in a Service called AuthentificationService.
After the function has finished it´s work I can see in debug mode that it has all information correctly received.
Now I want to pass this Model to my MainLayout and from there I want to use it on different Razor pages.
This does not work and I could not find any solution.

Code on my Layout_1(Startpage)

@inherits LayoutComponentBase
@inject NavigationManager NavigationManager
@inject AuthenticationStateProvider _AuthenticationStateProvider
@inject AuthentificationService _AuthentificationService
@inject GetProjektInfoService _GetProjektInfoService

@Title

@Subtitle

        <form>

Testing

                 <EditForm Model="@model" OnSubmit="FormSubmit">
                    <DataAnnotationsValidator />

                        <InputText placeholder="@WatermarkText" class="radius" @bind-Value="@model.ProjectNumber"></InputText>
                        <button class="btn radius">@ButtonText</button>

                        <ValidationMessage For="()=> model.ProjectNumber" />
                    @if(model.ErrorMessage != "")
                    {
                        @model.ErrorMessage
                    }
                </EditForm>

        </form>

@code {
    private string Title = "test1";
    public string Subtitle = "test2";
    public string ButtonText = "Start your configuration";
    public string WatermarkText = "Project number";

    public ValidationModel model { get; set; } = new();
    public class ValidationModel
    {
        [RegularExpression(@"^.*[K][-][0-9][0-9][0-9][0-9]$", ErrorMessage = "Input format is wrong! Please enter your format as follow: K-XXXX.")]
        public string ProjectNumber { get; set; } = "K-XXXX";

        public string ErrorMessage { get; set; } = "";
    }

    public AuthModel authModel = new();

    [CascadingParameter]
    public MainLayout MainLayout { get; set; } = new MainLayout();

}

@functions
{

    private void KeyPressHandler(KeyboardEventArgs e)
    {
        if (e.Key == "Enter")
        {
            return;
        }
    }

    public async Task FormSubmit(EditContext editContext)
    {
        bool FormIsValid = editContext.Validate();

        if (FormIsValid)
        {
            //user has entered a project number
            authModel = await _AuthentificationService.CheckAccess(true, true, model.ProjectNumber);

            MainLayout.authModel = authModel;

            bool use = await _GetProjektInfoService.Get(model.ProjectNumber);
            MainLayout.ProjectNumber = model.ProjectNumber;
            if (use)
            {
                NavigationManager.NavigateTo(String.Format("/projectdata/{0}", model.ProjectNumber));
            }
            else
            {
                model.ErrorMessage = "This project number can not be used in this context.";
            }
        }

    }

    protected async override Task OnInitializedAsync()
    {
        authModel = await _AuthentificationService.CheckAccess(true,false, model.ProjectNumber);
    }

}

Code on my MainLayout:

@inherits LayoutComponentBase
@inject NavigationManager _NavigationManager
@inject AuthentificationService _AuthentificationService
@inject ProjectDataService _ProjectDataService
@inject GetISPService _GetISPService

@if (ShowSearchbar)
{
    <SearchBar ></SearchBar>
}

    @if (ShowSidebar)
    {
        <SideNavBar SideBarMenu="@SideBarMenu" ShowSideNavMenu="@ShowSideNavMenu" Project="@Project" authModel="@authModel"></SideNavBar>
    }

            <CascadingValue Value="@this" >
            @if (ShowTopNavBar)
            {
                <TopNavBar Project="@Project" authModel="@authModel"></TopNavBar>
            }
            @*<CascadingValue Value="@this" >*@

                @Body

            </CascadingValue>

@code{
    //main layout
    public bool ShowSearchbar { get; set; } = true;
    public bool ShowSidebar{ get; set; } = true;
    public bool ShowTopNavBar{ get; set; } = true;
    //side bar
    public string SideBarMenu { get; set; } = "Default";
    public bool ShowSideNavMenu { get; set; } = true;

    public ProductModel Product { get; set; } = new ProductModel();
    public ProductMatrixModel MatrixModel { get; set; } = new ProductMatrixModel();
    //Authenfification and User Data
    public AuthModel authModel { get; set; } = new AuthModel();

    //Currency binding from TopNav
    public string SelectedCurrency { get; set; }
    //PartModel
    public List<PartModel> Parts { get; set; }
    //Project Data
    public ProjectModel Project { get; set; } = new ProjectModel();

}
@functions{
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        await InvokeAsync(()=> StateHasChanged());

    }

So as you can see I get on Layout_1 all information and passing them to MainLayout with MainLayout.authModel = authModel. Same with ProjectNumber. If I am debugging on this page, I can see that MainLayout has the correct values, but when it jumps to MainLayout it does not have any Information. Its alway null.
I hope I could describe my Problem well. I can provide more information when needed.
Thanks for any help.


问:
Extract value from its key using SQL
I want to extract value from a column using its key. The data is stored as a dictionary. I want the values of "hotel_id" from the column.

Data in column is stored like this: (Examples)

["search_params": {"region": "PK", "sort_by": "POPULARITY", "currency": "PKR", "hotel_id": "688867", "slot_only": false, "segment_id": "6f9a9cc5-be52-4ae4-b5d2-cc19c6753085", "occupancies": [{"rooms": 1, "adults": 2, "children": 0, "child_age_list": []}], "check_in_date": "2022-11-13"]

[ "search_result": {"hotel_dict": {"241825": {"source": 3, "hotel_id": 241825, "availability": {"rooms": {"rooms_id_list": [3187909, 3187910, 3187911, 3187912], "rooms_data_dict": {"3187909": {"room_id": 3187909, "rate_options": [{"adult": 3, "child": 0, "bar_rate": 7500, "rate_key": "542984|991065", "extra_bed": 0, "occupancy": {"2": 1}]

I tried a query but it works for specific number of characters and does not ignore spaces and commas (dirty data).

```<code>    SELECT substr(substr(info, instr(info, 'hotel_id') + 11),
    2,
    instr(substr(info, instr(info, 'hotel_id') + 1), '"') - 2
    ) result
from df
</code>```

The result I get is:

result
0   688867
1   41825,
2   41771,
3   394910
4   ull, "
5   394910

Title: Extract value from its key using SQL

Body:
I want to extract value from a column using its key. The data is stored as a dictionary. I want the values of "hotel_id" from the column.

Data in column is stored like this: (Examples)

["search_params": {"region": "PK", "sort_by": "POPULARITY", "currency": "PKR", "hotel_id": "688867", "slot_only": false, "segment_id": "6f9a9cc5-be52-4ae4-b5d2-cc19c6753085", "occupancies": [{"rooms": 1, "adults": 2, "children": 0, "child_age_list": []}], "check_in_date": "2022-11-13"]

[ "search_result": {"hotel_dict": {"241825": {"source": 3, "hotel_id": 241825, "availability": {"rooms": {"rooms_id_list": [3187909, 3187910, 3187911, 3187912], "rooms_data_dict": {"3187909": {"room_id": 3187909, "rate_options": [{"adult": 3, "child": 0, "bar_rate": 7500, "rate_key": "542984|991065", "extra_bed": 0, "occupancy": {"2": 1}]

I tried a query but it works for specific number of characters and does not ignore spaces and commas (dirty data).

    SELECT substr(substr(info, instr(info, 'hotel_id') + 11),
    2,
    instr(substr(info, instr(info, 'hotel_id') + 1), '"') - 2
    ) result
from df

The result I get is:

result
0   688867
1   41825,
2   41771,
3   394910
4   ull, "
5   394910


问:
Marshalling arrays of structures in VB.NET
I have a third-party C DLL that I am trying to call from VB.NET.

The API has in and out structures that are multi-level. For the sake of brevity:

```<code>typedef struct
{
    int                 nObjectID;
    char                szObjectType[128];
    int                 nConfidence;
    int                 nAction;
    DH_RECT             BoundingBox;
    DH_POINT            Center;
    int                 nPolygonNum;
    DH_POINT            Contour[DH_MAX_POLYGON_NUM];
    DWORD               rgbaMainColor;
    <snip>
}
</code>```

refers to two other structures (DH_RECT & DH_POINT). These are defined as:

```<code>typedef struct
{
    long                    left;
    long                    top;
    long                    right;
    long                    bottom;
} DH_RECT, *LPDH_RECT;
typedef struct
{
    short                   nx;
    short                   ny;
} DH_POINT, *LPDH_POINT, NET_POINT, *LPNET_POINT;
</code>```

In my VB.NET version, I used this:

```<code>    <StructLayout(LayoutKind.Sequential, Pack:=1)>
    Public Structure DH_RECT
        Public left As Int32
        Public top As Int32
        Public right As Int32
        Public bottom As Int32
    End Structure
    <StructLayout(LayoutKind.Sequential, Pack:=1)>
    Public Structure DH_POINT
        Public nx As Int16
        Public ny As Int16
    End Structure
   <StructLayout(LayoutKind.Sequential, Pack:=4)>
    Public Structure DH_MSG_OBJECT
        Public nObjectID As Int32
        <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)>
        Public szObjectType As String
        Public nConfidence As Int32
        Public nAction As Int32
        Public BoundingBox As DH_RECT
        Public Center As DH_POINT
        Public nPolygonNum As Int32
        <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)>
        Public Contour() As DH_POINT
        Public rgbaMainColor As UInt32
    <snip>
</code>```

After calling the DLL function and moving the result into the structure using Marshal.PtrToStructure, everything after nPolygonNum is 0 or garbage. Mostly 0.

I suspect the error to be in the declaration for Contour. This is supposed to be an array of 16 of the type structure DH_POINT. I think the declaration should not be <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> but can't get any other type to work.

Body:
I have a third-party C DLL that I am trying to call from VB.NET.

The API has in and out structures that are multi-level. For the sake of brevity:

typedef struct
{
    int                 nObjectID;
    char                szObjectType[128];
    int                 nConfidence;
    int                 nAction;
    DH_RECT             BoundingBox;
    DH_POINT            Center;
    int                 nPolygonNum;
    DH_POINT            Contour[DH_MAX_POLYGON_NUM];
    DWORD               rgbaMainColor;
    <snip>
}

refers to two other structures (DH_RECT & DH_POINT). These are defined as:

typedef struct
{
    long                    left;
    long                    top;
    long                    right;
    long                    bottom;
} DH_RECT, *LPDH_RECT;
typedef struct
{
    short                   nx;
    short                   ny;
} DH_POINT, *LPDH_POINT, NET_POINT, *LPNET_POINT;

In my VB.NET version, I used this:

    <StructLayout(LayoutKind.Sequential, Pack:=1)>
    Public Structure DH_RECT
        Public left As Int32
        Public top As Int32
        Public right As Int32
        Public bottom As Int32
    End Structure
    <StructLayout(LayoutKind.Sequential, Pack:=1)>
    Public Structure DH_POINT
        Public nx As Int16
        Public ny As Int16
    End Structure
   <StructLayout(LayoutKind.Sequential, Pack:=4)>
    Public Structure DH_MSG_OBJECT
        Public nObjectID As Int32
        <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)>
        Public szObjectType As String
        Public nConfidence As Int32
        Public nAction As Int32
        Public BoundingBox As DH_RECT
        Public Center As DH_POINT
        Public nPolygonNum As Int32
        <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)>
        Public Contour() As DH_POINT
        Public rgbaMainColor As UInt32
    <snip>

After calling the DLL function and moving the result into the structure using Marshal.PtrToStructure, everything after nPolygonNum is 0 or garbage. Mostly 0.

I suspect the error to be in the declaration for Contour. This is supposed to be an array of 16 of the type structure DH_POINT. I think the declaration should not be <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> but can't get any other type to work.


问:
Why with this char "؋" everything I wrote on the right side appear on the left?
I want to display on an Xcode project the following char: "؋" which is a currency, and on the right a value.
For example (in dollars): $100.
But with this char everything I wrote on the right side appears on the left, and I don't know why.
Hear how it appears: ؋100.
The sign is on the right, but I wrote "100" with the cursor on the right of the currency symbol.</p>


问:
Twilio video + Vue - issue with track.attach() and re-rendering of components
I'm using Twilio video JS SDK with inline Vue 2 for a group video conference app and I'm having an issue with losing audio/video tracks attached to participant components, when one participant disconnects.

Take a room with 4 participants, all have audio and video tracks attached. Now when participant #2 disconnects, the tracks of participant #3 and #4 stop playing (video is stuck, audio not playing anymore).

It's probably caused by re-rendering - when participant disconnects, he is deleted from state.participants and all folowing participants have to re-render - they still have the  and  elements, just not playing the previously attached tracks.

I've temporarily solved this by keeping all the disconnected participants in the state, and just visually hiding them with v-show="item.connected", but I'm planning to add other functionality like pinning, and would generally like to keep my options open with being able to re-render the participant boxes without losing the attached video/audio tracks.

I've looked at some Twilio-video + Vue examples, but all were 1-on-1 rooms, where the track containers were always in place and not moving around. Does anyone know how to tackle this kind of situation in a manner, that uses the reactive DOM principles, instead of trying to bypass them?

Here's HTML

```<code><div class="attendants-window">
  <template v-for="item in participants" :key="item.identity">
    <div class="twilio-attendant-col" v-show="item.connected">
      <div class="twilio-attendant">
        <div v-if="!item.video || !videoEnabled" class="twilio-avatar">{{ item.name }}</div>
        <div v-show="item.video || !videoEnabled"  class="twilio-video" :ref="'media' + item.identity">
          // <video> and <audio> are attached here
        </div>
        <div class="twilio-attendant-controls">
          <button @click="onToggleAudio(item.identity)" class="btn">
            <i v-if="item.audio" class="fa fa-microphone"></i>
            <i v-else class="fa fa-microphone-slash"></i>
          </button>
          <button v-if="videoEnabled" @click="onToggleVideo(item.identity)" class="btn">
            <i class="fa fa-camera position-relative">
              <div v-if="!item.video" class="icon-slash"></div>
            </i>
          </button>
          <button @click="onTogglePinned(item.identity)" class="btn">
            <i class="fa fa-thumb-tack"></i>
          </button>
        </div>
      </div>
    </div>
  </template>
</div>
</code>```

And here's the vue method that attaches the tracks

```<code>attachMedia(id, track) {
  this.callUsers[id][track.kind] = true
  $(this.$refs['media' + id]).append(track.attach())
},
</code>```

Body:
I'm using Twilio video JS SDK with inline Vue 2 for a group video conference app and I'm having an issue with losing audio/video tracks attached to participant components, when one participant disconnects.

Take a room with 4 participants, all have audio and video tracks attached. Now when participant #2 disconnects, the tracks of participant #3 and #4 stop playing (video is stuck, audio not playing anymore).

It's probably caused by re-rendering - when participant disconnects, he is deleted from state.participants and all folowing participants have to re-render - they still have the  and  elements, just not playing the previously attached tracks.

I've temporarily solved this by keeping all the disconnected participants in the state, and just visually hiding them with v-show="item.connected", but I'm planning to add other functionality like pinning, and would generally like to keep my options open with being able to re-render the participant boxes without losing the attached video/audio tracks.

I've looked at some Twilio-video + Vue examples, but all were 1-on-1 rooms, where the track containers were always in place and not moving around. Does anyone know how to tackle this kind of situation in a manner, that uses the reactive DOM principles, instead of trying to bypass them?

Here's HTML

  <template v-for="item in participants" :key="item.identity">

{{ item.name }}

          // <video> and <audio> are attached here

          <button @click="onToggleAudio(item.identity)" class="btn">

          </button>
          <button v-if="videoEnabled" @click="onToggleVideo(item.identity)" class="btn">

          </button>
          <button @click="onTogglePinned(item.identity)" class="btn">

          </button>

  </template>

And here's the vue method that attaches the tracks

attachMedia(id, track) {
  this.callUsers[id][track.kind] = true
  $(this.$refs['media' + id]).append(track.attach())
},


问:
iOS WKWebView does not load url
I try to open webView, it works fine after first app download. But after several times clicking on it I get 401 error. The url works for Android and Web.
I tried to user SFSafariViewController and WKWebView, but result is the same.
Please help me to find the reason of this.

URL: https://milliard-pozdravlenij.gt.stoloto.ru/

```<code>//      let controller = SFSafariViewController(url: url)

        let controller = UIViewController()
        let webView = WKWebView(frame: controller.view.frame, configuration: WKWebViewConfiguration())
        controller.view.addSubviews(webView)
        let request = URLRequest(url: url)
        webView.load(request)
</code>```

Error: this happens only with simulator

```<code>Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xed662242 5fb7c0a8 1bf3f783 33b5c275 ... 5cef5e61 5d97a96c }, _LSLine=478, WrongSimulatorHash={length = 32, bytes = 0x3190f8e7 217931fc b7f7be3d 298bbb9a ... 8472784b 30a84b1d }}
</code>```

Title: iOS WKWebView does not load url

Body:
I try to open webView, it works fine after first app download. But after several times clicking on it I get 401 error. The url works for Android and Web.
I tried to user SFSafariViewController and WKWebView, but result is the same.
Please help me to find the reason of this.

URL: https://milliard-pozdravlenij.gt.stoloto.ru/

//      let controller = SFSafariViewController(url: url)

        let controller = UIViewController()
        let webView = WKWebView(frame: controller.view.frame, configuration: WKWebViewConfiguration())
        controller.view.addSubviews(webView)
        let request = URLRequest(url: url)
        webView.load(request)

Error: this happens only with simulator

Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xed662242 5fb7c0a8 1bf3f783 33b5c275 ... 5cef5e61 5d97a96c }, _LSLine=478, WrongSimulatorHash={length = 32, bytes = 0x3190f8e7 217931fc b7f7be3d 298bbb9a ... 8472784b 30a84b1d }}


问:
Coroutines getting and setting a theme on an activity
How would I set the theme of an activity before it is created, when the theming information must be retrieved from DataStore?

Since the data needs to come immediately, a runBlocking has been necessary. Can I work around using a runBlocking in this case?

Example:

```<code>override fun onCreate(savedInstanceState: Bundle?) {
    runBlocking {
        val theme = settingsRepository.getTheme()
        this@ThemedActivity.setTheme(theme)
    }

    super.onCreate(savedInstanceState)
}
</code>```

Body:
How would I set the theme of an activity before it is created, when the theming information must be retrieved from DataStore?

Since the data needs to come immediately, a runBlocking has been necessary. Can I work around using a runBlocking in this case?

Example:

override fun onCreate(savedInstanceState: Bundle?) {
    runBlocking {
        val theme = settingsRepository.getTheme()
        this@ThemedActivity.setTheme(theme)
    }

    super.onCreate(savedInstanceState)
}


问:
Patch request does not working using axios
So I created react mern stack app. The app using express and node js as the backend service, redux thunk, redux toolkit and axios for the network calling to the server. The issue is that I am trying to create update the service for the posts the user upload, but the request always failling. When I am sending the parameters to the request to the server and trying to print the data through the server I get them as undefined, although the data I send is valid.
I have no idea what went wrong here. Can someone please help me?

The api class in the front side(I copied only the patch calling):

```<code>import axios from 'axios';

axios.defaults.withCredentials=true;
const baseURL="http://localhost:8000";
axios.defaults.withCredentials=true;
const API=axios.create({
    baseURL,
    credentials: 'include',
    headers: {
        'Accept': 'application/json',
        'Content-Type':'application/x-www-form-urlencoded',
        // 'Content-Type': 'application/json',
        'Access-Control-Allow-Origin':'*'
   },
});
export const changePostData=(id,formData)=>API.patch(`/post/updatePost/${id}`, formData);
</code>```

My redux thunk slice(also copied only the part relevant):

```<code>import * as api from "../api/Api";

export const updatePost=createAsyncThunk('post/update',async({id,formData},{fulfillWithValue,rejectWithValue})=>{
   try{
  const response=await api.changePostData(id,formData);
  if(response.statusCode==='404'){
   throw new Error("Not found any results")
  }
  fulfillWithValue(response.data);
   }catch(err){
      console.log(err.message);
   }
});
const PostSlice=createSlice({
    name:'post',
    initialState,
    reducers:{
}
})
export const postActions=PostSlice.actions;
export default PostSlice;
</code>```

The editing post page(also copied only relevant functions):

```<code>const BlogForm=()=>{
const location=useLocation();
const{sendId,sendUserId,sendTitle,sendContent,sendThumbnail,sendCategory}=location.state;
const initialState={id:sendId,title:sendTitle,content:sendContent,category:sendCategory,thumbnail:sendThumbnail,createdAt:new Date().toISOString()};
const history=useHistory();
const dispatch=useDispatch();
const[formData,setFormData]=useState(initialState);
const changeHandler=(e)=>{
  setFormData(prev=>e.target?{...prev,[e.target.name]:e.target.value}:{...prev,content:e})
}

const submitHandler=(e)=>{
  e.preventDefault();
    dispatch(updatePost({id,formData}))
    .unwrap()
   .then((originalPromiseResults)=>{
       console.log("User signed in successfully");
       history.push('/profile')
    }).catch((err)=>{
       console.log(err.message);
    })
}
    return (
...........)
</code>```

Post controller function in my backend:

```<code>export const updatePost=catchAsync(async(req,res,next)=>{
    const{title,content,category,thumbnail,createdAt}=req.body;
    const updatedPost = {
        title,
        content,
        category,
        thumbnail,
        createdAt
      };
      const post=await Post.findByIdAndUpdate(id, updatedPost, { new: true });
  if(!post){
        return next(new ErrorHandlng("Post id does not exists",404));
      }
     res.status(201).json({
          status:"success",
          data:{
              post
          }
      })
  })
</code>```

Body:
So I created react mern stack app. The app using express and node js as the backend service, redux thunk, redux toolkit and axios for the network calling to the server. The issue is that I am trying to create update the service for the posts the user upload, but the request always failling. When I am sending the parameters to the request to the server and trying to print the data through the server I get them as undefined, although the data I send is valid.
I have no idea what went wrong here. Can someone please help me?

The api class in the front side(I copied only the patch calling):

import axios from 'axios';

axios.defaults.withCredentials=true;
const baseURL="http://localhost:8000";
axios.defaults.withCredentials=true;
const API=axios.create({
    baseURL,
    credentials: 'include',
    headers: {
        'Accept': 'application/json',
        'Content-Type':'application/x-www-form-urlencoded',
        // 'Content-Type': 'application/json',
        'Access-Control-Allow-Origin':'*'
   },
});
export const changePostData=(id,formData)=>API.patch(`/post/updatePost/${id}`, formData);

My redux thunk slice(also copied only the part relevant):

import * as api from "../api/Api";

export const updatePost=createAsyncThunk('post/update',async({id,formData},{fulfillWithValue,rejectWithValue})=>{
   try{
  const response=await api.changePostData(id,formData);
  if(response.statusCode==='404'){
   throw new Error("Not found any results")
  }
  fulfillWithValue(response.data);
   }catch(err){
      console.log(err.message);
   }
});
const PostSlice=createSlice({
    name:'post',
    initialState,
    reducers:{
}
})
export const postActions=PostSlice.actions;
export default PostSlice;

The editing post page(also copied only relevant functions):

const BlogForm=()=>{
const location=useLocation();
const{sendId,sendUserId,sendTitle,sendContent,sendThumbnail,sendCategory}=location.state;
const initialState={id:sendId,title:sendTitle,content:sendContent,category:sendCategory,thumbnail:sendThumbnail,createdAt:new Date().toISOString()};
const history=useHistory();
const dispatch=useDispatch();
const[formData,setFormData]=useState(initialState);
const changeHandler=(e)=>{
  setFormData(prev=>e.target?{...prev,[e.target.name]:e.target.value}:{...prev,content:e})
}

const submitHandler=(e)=>{
  e.preventDefault();
    dispatch(updatePost({id,formData}))
    .unwrap()
   .then((originalPromiseResults)=>{
       console.log("User signed in successfully");
       history.push('/profile')
    }).catch((err)=>{
       console.log(err.message);
    })
}
    return (
...........)

Post controller function in my backend:

export const updatePost=catchAsync(async(req,res,next)=>{
    const{title,content,category,thumbnail,createdAt}=req.body;
    const updatedPost = {
        title,
        content,
        category,
        thumbnail,
        createdAt
      };
      const post=await Post.findByIdAndUpdate(id, updatedPost, { new: true });
  if(!post){
        return next(new ErrorHandlng("Post id does not exists",404));
      }
     res.status(201).json({
          status:"success",
          data:{
              post
          }
      })
  })


问:
Max width for iPhone with small notch
When I put a photo as background for my page, it always has problem with iPhones.
But it is fullscreen correctly by samsung devices and works good.
Is there any solutions for this bug?

You can see here the white spaces

iphone notch css width

I set up the width to 100vw but still I can see two white spaces in both sides of the screen.
Also I haven't used any libraries like Bootstrap etc.

Title: Max width for iPhone with small notch


问:
Do I need Deauthorization and Data Deletion requests in my app for review app approval by Facebook?
I am right now working on a practice project in ROR and in that project I have made user able to create memories in Memories model. For that I have created APIs that fetch user media of a specific user (who actually authorizes). These extracted posts are then stored in DB as memories.
For getting my app approved by Facebook, Do I have to make deauthorization and Data Deletion request?
Further Notes:

there is no such issue for domain for redirect uri as I am already taking care of that.

there is no Facebook login either, just sign in to Instagram and redirect back to my app showing all posts.

I am not sure in which direction i have to move further.


问:
Issues with setting up React/Express solution with multiple projects
I am new to React and Express and I had some questions about how to structure my projects (which is leading to some maintainability issues.  First, here is my current project structure (This is a React front end with an Express Server backend.  I am using VS Code for my IDE):

```<code>MERNAPP
  --ExpressServerApp
     -- controllers (folder)
     -- helpers (folder)
     -- middleware (folder)
     -- routes (folder)
     --server.js
     --ExpressServer.code-workspace
  -- ReactApp
     -- node_modules (folder)
     -- public (folder)
     -- setupFiles (folder)
     -- src (folder)
     --.env
     -- package-lock.json
     -- pacakge.json
     -- ReactApp.code-workspace
  -- node_modules (folder that gets auto generated.)
  --.env
  -- MERNAPP.code-workspace
  -- package-lock.json
  -- package.json
</code>```

Questions:

I am not sure why, when I install npm libraries for ExpressServerApp, the node_modules folder is not placed inside the ExpressServerApp folder?  Instead, it got created at the project root.  Is this correct?

This overall React/Express solution seems to be sharing a number of npm libraries.  How can I share these libraries among all projects in my solution without having to install them in each solution?  In other words, it seems redundant to install the same library across multiple projects in one solution.  Can they be shared so there is on node_modules folder that all projects point to?

As this is one solution with multiple projects, I would like to centralize all configuration files into one location.  But, right now, I have a ".env" file for each project.  Again, I am not sure why the .env gets placed outside the ExpressServerApp root folder?  But, how can I share one config/env file across multiple applications in the same solution?  If my React app tries to access any files outside its src folder, I get an error.

Should I have a separate .code-workspace for each project and solution, or should there just be one for the entire solution?

Body:
I am new to React and Express and I had some questions about how to structure my projects (which is leading to some maintainability issues.  First, here is my current project structure (This is a React front end with an Express Server backend.  I am using VS Code for my IDE):

MERNAPP
  --ExpressServerApp
     -- controllers (folder)
     -- helpers (folder)
     -- middleware (folder)
     -- routes (folder)
     --server.js
     --ExpressServer.code-workspace
  -- ReactApp
     -- node_modules (folder)
     -- public (folder)
     -- setupFiles (folder)
     -- src (folder)
     --.env
     -- package-lock.json
     -- pacakge.json
     -- ReactApp.code-workspace
  -- node_modules (folder that gets auto generated.)
  --.env
  -- MERNAPP.code-workspace
  -- package-lock.json
  -- package.json

Questions:

I am not sure why, when I install npm libraries for ExpressServerApp, the node_modules folder is not placed inside the ExpressServerApp folder?  Instead, it got created at the project root.  Is this correct?

This overall React/Express solution seems to be sharing a number of npm libraries.  How can I share these libraries among all projects in my solution without having to install them in each solution?  In other words, it seems redundant to install the same library across multiple projects in one solution.  Can they be shared so there is on node_modules folder that all projects point to?

As this is one solution with multiple projects, I would like to centralize all configuration files into one location.  But, right now, I have a ".env" file for each project.  Again, I am not sure why the .env gets placed outside the ExpressServerApp root folder?  But, how can I share one config/env file across multiple applications in the same solution?  If my React app tries to access any files outside its src folder, I get an error.

Should I have a separate .code-workspace for each project and solution, or should there just be one for the entire solution?


问:
Join table and keep the row repeatedly
I have a table A like

Date

Day 1

Day 2

Day 3

Day 4

And table B:

Date
item

sale

Day 1
A
100

Day 3
A
200

Day 1
B
100

Day 3
B   200

The expected result when join table A with table B:

Date
item
sale

Day 1
A
100

Day 2

Day 3
A
200

Day 4

Day 1
B
100

Day 2

Day 3
B
200

Day 4

I try with Left Join but it only work in case that I have only 1 item

Title: Join table and keep the row repeatedly


问:
I have a trouble with updating the tippy's content on the go
I have a WEBGl application, where I use tippy.js in the interface. I need to add the language translation system, so when the user clicks a button, the interface language changes. So the tippy's content needs to change as well. I tried various combinations of setContent function but nothing works (you can see my combinations below). I am not a developer so I would ask to explain to me which combination I need to use to updated the tippy's content.

I need to change the wording for object with ID share_copy_link, it's class it's tooltip-link.

I would appreciate your help a lot!

I tried the following phrases in different combinations:

window.getElementById('share_copy_link').setAttribute('data-tippy-content', 'Link skopiowany!');

const instance = tippy(document.querySelector('.tooltip-link'));

const instance = document.getElementById('share_copy_link');

const instance = tippy(document.querySelector('#share_copy_link'));

const instance = document.querySelector("#share_copy_link")

instance.disable();

instance._tippy.setContent('New content');

instance.setAttribute('data-tippy-content', 'Link skopiowany!');

instance.setContent("Updated content!");

const element = tippy(document.querySelectorAll('.tooltip-link'));

tippy(element);

const instance = element._tippy;

instance._tippy.setContent('New content');

const myElement = tippy(document.getElementById('share_copy_link'));

myElement._tippy.setContent(Hello);

const element = document.getElementById('share_copy_link');

tooltippy.setAttribute('data-tippy-content', 'Link skopiowany!');

element.setContent('New content');


问:
Programmatically trigger a SageMaker's Notebook instance
So to start with, I currently have a system on AWS that does the following

Collects user data (consent is assumed of course) and store it in an S3 bucket

Uses Sagemaker notebook instance to train on the user data and deploys an endpoint. The endpoint is later invoked by a lambda function (I followed this tutorial)

The problem is, I have to

manually run the notebook instance

manually change the path for each user's data

What I would like to do,

First:

Trigger the notebook instance programmatically.

This can be periodically or through an event. I could call the notebook instance from a lambda function or another AWS service.

Second:

Pass an argument to the notebook instance (e.g., bucket path where
data is stored)

Approach

Notebook Jobs

I found some resources that suggested Notebook jobs. However, notebook jobs only give the ability to schedule notebooks.

There is an option to send parameters (which I was not able to get to work), but that option just means you pass the same argument on every run.

My question is this, am I following the right approach? Or is there something else I should consider?

Thanks in advance