ChilliCream / ChilliCream/graphql-platform

Error creating Maui app package: GraphQLDefRule rule is missing the "{ItemType}" property

Open
#6,801 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ strawberry shake
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Is there an existing issue for this?
  • I have searched the existing issues
Product

Strawberry Shake

Describe the bug

The visual studio encountered an error when publishing the Android mobile app and was unable to create [app archive]. The error message is "Failed to create app. The 'GraphQLDefRule' rule is missing the '{ItemType}' property". If you write [app archive] for iOS the same, there are no errors. Also, when you publish Android with CLI commands, the apk file is generated without errors.

Steps to reproduce
  1. Create Android MAUI Project
  2. Add reference StrawberryShake.Server
  3. Add StrawberryShake Client Builder in MauiProgram.cs
  4. Android App Archive
Relevant log output
Xamarin.VisualStudio.Publishing.ArchiveManager Error: 0 : System.InvalidOperationException: Failed to create app. The "GraphQLDefRule" rule is missing the "{ItemType}" property
   Location: Microsoft.Verify.Operation(Boolean condition, String unformattedMessage, Object arg1, Object arg2)
   Location: Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicTypeBrowseObject.<<get_ItemType>b__116_0>d.MoveNext()
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   Location: Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   Location: Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   Location: Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAPropertyInfo.get_Value()
   Location: Clide.ItemProperties.GetValue(String name)
   Location: Clide.ItemProperties.TryGetMember(GetMemberBinder binder, Object& result)
   Location: CallSite.Target(Closure , CallSite , Object )
   Location: System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   Location: Clide.AndroidClideExtensions.<>c.<GetAndroidResources>b__1_0(IItemNode itemNode) File D:\a\_work\1\s\src\Core\VisualStudio.Android\ProjectSystem\Extensions.cs:Line 22
   Location: System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   Location: System.Linq.Enumerable.<DistinctIterator>d__64`1.MoveNext()
   Location: System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   Location: System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   Location: Xamarin.VisualStudio.Android.Publishing.AndroidArchiveToolsService.<CreateParametersAsync>d__20.MoveNext() File D:\a\_work\1\s\src\Core\VisualStudio.Android\Services\Publishing\Archival\AndroidArchiveToolsService.cs:Line 185
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   Location: Xamarin.VisualStudio.Android.Publishing.AndroidArchiveToolsService.<ArchiveAsync>d__17.MoveNext() File D:\a\_work\1\s\src\Core\VisualStudio.Android\Services\Publishing\Archival\AndroidArchiveToolsService.cs:Line 107
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   Location: Xamarin.VisualStudio.Publishing.ArchivableProjectBase.<ArchiveAsync>d__12.MoveNext() File D:\a\_work\1\s\src\Core\VisualStudio.Publishing\Archival\ArchivableProjectBase.cs:Line 30
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   Location: Xamarin.VisualStudio.Publishing.ArchiveManager.<ArchiveAsync>d__18.MoveNext() File D:\a\_work\1\s\src\Core\VisualStudio.Publishing\Archival\ArchiveManager.cs:Line 254: 01-06-2024 07:40:30Z
    DateTime=2024-01-06T07:40:30.4715105Z: 01-06-2024 07:40:30Z
Xamarin.VisualStudio.ProgressReport Error: 0 : System.InvalidOperationException: Failed to create app. The "GraphQLDefRule" rule is missing the "{ItemType}" property
   Location: Microsoft.Verify.Operation(Boolean condition, String unformattedMessage, Object arg1, Object arg2)
   Location: Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicTypeBrowseObject.<<get_ItemType>b__116_0>d.MoveNext()
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   Location: Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   Location: Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   Location: Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAPropertyInfo.get_Value()
   Location: Clide.ItemProperties.GetValue(String name)
   Location: Clide.ItemProperties.TryGetMember(GetMemberBinder binder, Object& result)
   Location: CallSite.Target(Closure , CallSite , Object )
   Location: System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   Location: Clide.AndroidClideExtensions.<>c.<GetAndroidResources>b__1_0(IItemNode itemNode) File D:\a\_work\1\s\src\Core\VisualStudio.Android\ProjectSystem\Extensions.cs:Line 22
   Location: System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   Location: System.Linq.Enumerable.<DistinctIterator>d__64`1.MoveNext()
   Location: System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   Location: System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   Location: Xamarin.VisualStudio.Android.Publishing.AndroidArchiveToolsService.<CreateParametersAsync>d__20.MoveNext() File D:\a\_work\1\s\src\Core\VisualStudio.Android\Services\Publishing\Archival\AndroidArchiveToolsService.cs:Line 185
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   Location: Xamarin.VisualStudio.Android.Publishing.AndroidArchiveToolsService.<ArchiveAsync>d__17.MoveNext() File D:\a\_work\1\s\src\Core\VisualStudio.Android\Services\Publishing\Archival\AndroidArchiveToolsService.cs:Line 107
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   Location: Xamarin.VisualStudio.Publishing.ArchivableProjectBase.<ArchiveAsync>d__12.MoveNext() File D:\a\_work\1\s\src\Core\VisualStudio.Publishing\Archival\ArchivableProjectBase.cs:Line 30
--- End of stack tracking of previous location where exception was rolled ---
   Location: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   Location: System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   Location: Xamarin.VisualStudio.Publishing.ArchiveManager.<ArchiveAsync>d__18.MoveNext() File D:\a\_work\1\s\src\Core\VisualStudio.Publishing\Archival\ArchiveManager.cs:Line 254: 01-06-2024 07:40:30Z
    DateTime=2024-01-06T07:40:30.4725091Z: 01-06-2024 07:40:30Z
Additional Context?

No response

Version

13.8.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Android MAUI archive failure with Strawberry Shake 13.8.1, then inspect Core/VisualStudio.Android/ProjectSystem/Extensions.cs at line 22 and AndroidArchiveToolsService.cs at lines 107 and 185 from the stack trace. Done means publishing an Android app archive completes without the missing "GraphQLDefRule" ItemType error, while CLI APK generation and iOS archiving continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp, graphql
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.