Sharpie Binding Error.

Joel Leo 0 Reputation points
2024-06-06T05:55:04.53+00:00

Hai, I'm trying to bind an objective C/Swift ios static library with maui binding project. I'm getting the following error when i use the command line to generate the binding for me. It is not very clear as to what is causing is error. Kindly guide me with next steps on how to resolve this.

If you need any further information please let me know. Thanks.

sharpie bind --output=iphoneframework --namespace=VideoKit -sdk iphoneos17.0 -scope ./VideoKit.xcframework/ios-arm64/Headers ./VideoKit.xcframework/ios-arm64/Headers/*.h

Parsing 19 header files...

Binding...

System.ArgumentNullException: Value cannot be null.

Parameter name: annotation

  at ICSharpCode.NRefactory.AbstractAnnotatable.AddAnnotation (System.Object annotation) [0x00003] in <3da4147b9a604f9db333cbe03c63b39e>:0 

  at ICSharpCode.NRefactory.CSharp.AstNode.AddAnnotation (System.Object annotation) [0x00013] in <d13506fb97ad43d4921602b66d9361a9>:0 

  at Sharpie.Bind.Massagers.AnonymousStructMassager.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) [0x0009d] in /Users/runner/work/1/s/Sharpie.Bind/Massagers/AnonymousStructMassager.cs:47 

  at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor (ICSharpCode.NRefactory.CSharp.IAstVisitor visitor) [0x00000] in <d13506fb97ad43d4921602b66d9361a9>:0 

  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00010] in <d13506fb97ad43d4921602b66d9361a9>:0 

  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) [0x00000] in <d13506fb97ad43d4921602b66d9361a9>:0 

  at Sharpie.Bind.Massagers.AnonymousStructMassager.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) [0x0000f] in /Users/runner/work/1/s/Sharpie.Bind/Massagers/AnonymousStructMassager.cs:30 

  at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor (ICSharpCode.NRefactory.CSharp.IAstVisitor visitor) [0x00000] in <d13506fb97ad43d4921602b66d9361a9>:0 

  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00010] in <d13506fb97ad43d4921602b66d9361a9>:0 

  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitSyntaxTree (ICSharpCode.NRefactory.CSharp.SyntaxTree syntaxTree) [0x00000] in <d13506fb97ad43d4921602b66d9361a9>:0 

  at Sharpie.Bind.DocumentSyntaxTree.AcceptVisitor (ICSharpCode.NRefactory.CSharp.IAstVisitor visitor) [0x00015] in /Users/runner/work/1/s/Sharpie.Bind/DocumentSyntaxTree.cs:37 

  at Sharpie.Bind.BindingMassager.Massage (ICSharpCode.NRefactory.CSharp.AstNode astNode, Sharpie.Bind.BindingTarget bindingTarget) [0x00033] in /Users/runner/work/1/s/Sharpie.Bind/BindingMassager.cs:136 

  at Sharpie.Bind.BindingFrontend.Bind (Clang.Ast.Decl decl) [0x00112] in /Users/runner/work/1/s/Sharpie.Bind/BindingFrontend.cs:93 

  at Sharpie.BindTool.HandleTranslationUnit (Clang.Ast.TranslationUnitDecl decl) [0x00191] in /Users/runner/work/1/s/Sharpie/BindTool.cs:166 

  at Clang.Driver.HandleTranslationUnit (Clang.Ast.TranslationUnitDecl translationUnit) [0x00000] in /Users/runner/work/1/s/Clang/Driver.cs:158 

  at Clang.Driver.HandleTranslationUnit (System.IntPtr translationUnit) [0x00000] in /Users/runner/work/1/s/Clang/Driver.cs:148 

  at (wrapper managed-to-native) Clang.Driver.RunInternal(Clang.Driver,string[],string,Clang.Frontend.DiagnosticConsumer)

  at Clang.Driver.Run (System.String[] inputFiles, System.String[] clangArgs, Clang.Frontend.DiagnosticConsumer diagnosticConsumer) [0x00177] in /Users/runner/work/1/s/Clang/Driver.cs:139 

  at Sharpie.ParseTool.Run () [0x005d3] in /Users/runner/work/1/s/Sharpie/ParseTool.cs:582 

  at Sharpie.BindTool.CoreRun () [0x00001] in /Users/runner/work/1/s/Sharpie/BindTool.cs:117 

  at Sharpie.BindTool.Run () [0x00026] in /Users/runner/work/1/s/Sharpie/BindTool.cs:95 

Done. Exiting with error code 1.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,579 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,002 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.