locked
Obj-C binding ApiDefinition generated Messaging partial class fails to completely generate RRS feed

  • Question

  • User153755 posted

    Hello! I have recently bound the Objective-C library, iVersion, to a Xamarin.Forms iOS project. When I attempt to compile the binding project, I get the error "Invalid token '' in class, struct, or interface member declaration." Following the error to its source, you can see (below) that it is a result of the ApiDefinition's partial class, Messaging.g.cs, failing to fully generate. Take a look at the class for yourself! Does anyone have a resolution to this problem?

    I have, of course, tried the classic "turn it off, turn it on," "clean and rebuild," and "remove and re-add project."

    //
    // Auto-generated from generator.cs, do not edit
    //
    // We keep references to objects, so warning 414 is expected
    
    #pragma warning disable 414
    
    using System;
    using System.Drawing;
    using System.Diagnostics;
    using System.ComponentModel;
    using System.Threading.Tasks;
    using System.Runtime.InteropServices;
    using System.Runtime.CompilerServices;
    using UIKit;
    using GLKit;
    using Metal;
    using MapKit;
    using ModelIO;
    using Security;
    using SceneKit;
    using CoreVideo;
    using CoreMedia;
    using QuickLook;
    using Foundation;
    using CoreMotion;
    using ObjCRuntime;
    using AddressBook;
    using CoreGraphics;
    using CoreLocation;
    using AVFoundation;
    using NewsstandKit;
    using CoreAnimation;
    using CoreFoundation;
    
    namespace ApiDefinition {
        partial class Messaging {
            static internal System.Reflection.Assembly this_assembly = typeof (Messaging).Assembly;
    
            const string LIBOBJC_DYLIB = "/usr/lib/libobjc.dylib";
    
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static IntPtr IntPtr_objc_msgSend (IntPtr receiever, IntPtr selector);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern static IntPtr IntPtr_objc_msgSendSuper (IntPtr receiever, IntPtr selector);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static IntPtr IntPtr_objc_msgSend_IntPtr (IntPtr receiever, IntPtr selector, IntPtr arg1);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern static IntPtr IntPtr_objc_msgSendSuper_IntPtr (IntPtr receiever, IntPtr selector, IntPtr arg1);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static int int_objc_msgSend_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern static int int_objc_msgSendSuper_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static global::System.Int64 Int64_objc_msgSend_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern static global::System.Int64 Int64_objc_msgSendSuper_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static bool bool_objc_msgSend (IntPtr receiver, IntPtr selector);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern static bool bool_objc_msgSendSuper (IntPtr receiver, IntPtr selector);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static void void_objc_msgSend (IntPtr receiver, IntPtr selector);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern static void void_objc_msgSendSuper (IntPtr receiver, IntPtr selector);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static void void_objc_msgSend_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern static void void_objc_msgSendSuper_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static void void_objc_msgSend_IntPtr_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern static void void_objc_msgSendSuper_IntPtr_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static bool bool_objc_msgSend_IntPtr_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern static bool bool_objc_msgSendSuper_IntPtr_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
            public extern static bool bool_objc_msgSend_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1);
            [DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSendSuper")]
            public extern st
    
    Thursday, April 14, 2016 6:31 PM

Answers

  • User153755 posted

    Ha, that's funny. My local build failed but my CI was fine.

    I'm glad you responded, it reminded me this thread existed. I was able to fix my problem by compiling the binding project in a separate solution and just referencing the DLL, not the project, in my Xamarin solution.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, May 5, 2016 1:57 PM
  • User168147 posted

    So, I figured out what was happening in my environment. I had a different version of Xcode on my CI server than I was running locally (7.3.1 vs 7.2.1). Once I upgraded my CI server to 7.3.1 (which also meant I had to move to El Capitan), the issue went away.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, May 9, 2016 7:25 PM

All replies

  • User168147 posted

    I don't have a solution, but I am having the same problem. My Messaging.g.cs cuts off mid-line as well. It doesn't look exactly like yours though. What's odd for me is that I can build locally, but the CI server fails. I think that both my machine and the CI server have the same packages, configuration, etc.

    Thursday, May 5, 2016 1:09 PM
  • User153755 posted

    Ha, that's funny. My local build failed but my CI was fine.

    I'm glad you responded, it reminded me this thread existed. I was able to fix my problem by compiling the binding project in a separate solution and just referencing the DLL, not the project, in my Xamarin solution.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, May 5, 2016 1:57 PM
  • User168147 posted

    Thanks for the follow-up. Not the ideal solution, but hopefully that will work for me too.

    Thursday, May 5, 2016 2:11 PM
  • User168147 posted

    So, I figured out what was happening in my environment. I had a different version of Xcode on my CI server than I was running locally (7.3.1 vs 7.2.1). Once I upgraded my CI server to 7.3.1 (which also meant I had to move to El Capitan), the issue went away.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, May 9, 2016 7:25 PM