Search code examples
c#xamarin.iosxamarinportable-class-library

New PCL project not building on Mac/Xamarin studio


We're trying to get our projects to build, which wasn't a problem until today.

We got a solution with multiple projects including Portable Class Library (PCL) projects. We've successfully built those before but our Macbook lost the capability to build those projects.

I get a total of 31 build errors for every PCL project:

- The predefined type 'System.Object' is not defined or imported (CS0518)
- The predefined type 'System.ValueType' is not defined or imported (CS0518)
- The predefined type 'System.Attribute' is not defined or imported (CS0518)
- 28 more times the same error stating other basic classes like Int16, Int32, Double, Single, etc.

To see if this always happens, I've created a new solution with a new PCL project. Tried to compile that and I got the same errors there. After checking the references, I see that they're all 'red'.

I'm using Xamarin Studio 4.0.10 but I also tried it in MonoDevelop. Both without success.

I can simply create a project in VS + Xamarin.iOS plugin and push that to the mac and it'll just run. But building on the Mac itself, doesn't work anymore.

Extra, possibly related info:

  • We were developing on the Mac before. After extending out monotouch license, we downloaded the Xamarin.iOS plugin and continued development on a Windows machine.
  • After extending the license, we also got the new updates for monotouch and Xamarin studio
  • We didn't build directly on the Mac since extending the license.
  • We decided to build directly on the Mac today, because we couldn't run the app on the actual device from Visual Studio.

Any possible solutions are welcome.


Solution

  • This is a bug in the current version (3.2.0)

    You can:

    • use Visual Studio to build your PCL projects or
    • switch to the alpha channel and upgrade to 3.2.1 alpha. Go to Xamarin Studio > Check for Updates > and set the update channel to Alpha. This includes a hotfix for 3.2.0 which I believe is regarding the broken PCL

    Update

    Although the alpha build (3.2.1) is able to build a new PCL project but that's all about it. For me it fails to recognise many keywords and gives nonsense errors on my actual project. If I find a fix I'll post it here.