Adding today extension project reference to iOS App - xamarin

I am trying to add a today widget to my Xamarin iOS app and when I try to add it as a reference I get this error:
a reference to could not be added. adding this project as a reference would cause a circular dependency`
I am running VS 2015 update 2 and the stable version of Xamarin
Any help would be amazing, Thanks in advance! :)

Your iOS App project will have a reference to your Today Extension Project. You don't need a reference from the Today Extension to the App project as you interact with the extension like this from your App project:
var controller = NCWidgetController.GetWidgetController ();
controller.SetHasContent (true, "<your today extensions bundle id>");
You references should look like this:
Have a look at how this sample code for a Today extension is put together. Documentation on extension project

Related

How to correct reference Xamarin PCL class?

In Visual Studio 2017, a fresh new Xamarin solution is created with Portable Class Library.
A initial build shows success. But a run gives an error message:
warnings like
Unable to add a reference to project 'App1'. The current project's target is not one of or compatible with the targets of Portable Library project 'App1'.
It is in both App1.iOS and App1.Android.
I have not yet upgrade the Xamarin NuGet package yet. The UWP project can run without any warning or exception.
Look into the project reference on the Android project, we see the broken reference to App1.
Trying to reference that PCL project again, I got
Look into the Property of the App1 PCL project,
What could be wrong? How can I fix the PCL project so it can be correctly referenced by Android and iOS projects?

Can't add PCL to existing Xamarin Forms project

Brand new install of Visual Studio Pro 2017, Prism Template Pack, and Xamarin Forms.
I am trying to create my first App and things are going very well so far. I have all the views, view models, etc. set and the app is functioning perfectly. Now I am trying to add some more PCL projects to the solution for things like Domain or Services, etc. so I can keep all the parts separated.
I can create a Xamarin Forms PCL just fine and add all my classes, etc. Problem comes when I try to add a reference to the Domain project from the main PCL project in the solution. I get the "targets of pcl don't match" error message.
This is what I am using to create the new PCL project:
This is the error message I receive when trying to add the PCL project reference:
What am I missing?
Here is the main PCL created with the template pack properties:
Here is the newly added PCL project properties:
PCL properties for template:
Since you are missing the Windows Phone & Silverlight targets in your IDE for some reason, this is a potential workaround:
Open up your .csproj files and make sure the TargetFrameworkProfile elements match up in both PCL projects.
Is it possible that you didn't install the tools for Windows Phone development when you installed Visual Studio?

Newly created xamarin forms app doesn't build

I'm new to Xamarin development. I just tried to create a new Blank Xamarin Forms project in Visual studio. It's really frustrating that this brand new project doesn't build and I can't resolve the issue. I tried to update Xamarin Forms in the Android solution, but it didn't help..
The first error message is: "The type or namespace 'System' could not be found (are you missing a using directive or an assembly reference?)"
This Forms project doesnt have a "references" node so I can't reference anything to it...
Any ideas?
Screenshots:
did you tried to clean & rebuild your solution? Maybe that'll help :)
Check all your references and make sure they are resolving correctly in each project.
I deleted every other project but the android one and it works now, I don't need the others for now, so it's good enough for me.

Xamarin.Forms failed to compile android project with "Droid.Resource.Attribute" does not contain a definition for "actionBarSize"

I have a Xamarin.Forms project, and it worked just fine until I updated my Xamarin Studio Community to latest 5.10.3 (build 51) and updated Xamarin.Forms to 2.2.0.31
When I compile my android project, it showed me
"mynamespace.Droid.Resource.Attribute" does not contain a definition for "actionBarSize"
I did not change anything after upgrade and it works before, I know some others faced the same problem like me when I search on google, seems no one asked this in stackoverflow yet so I would like to get some help here.
If the above doesn't work try this
1) Delete Bin and Obj folders in project folder
2) Delete contents of C:\Users{your username}\AppData\Local\Xamarin\zips
3) Rebuild project
*This will take a while because xamarin will re-download the required files. it should work after its done.
That's a bug listed here. There are different workarounds about this, please try:
Failed to use Android Support Library v4
Creating a Hello World in Visual Studio with Xamarin Forms Fails
Xamarin cross-platform (portable class) project compilation error

Can't find App.cs in Xamarin PCL project in Visual Studio 2015

I do as tutorial here
https://msdn.microsoft.com/en-us/library/mt679501.aspx
and when I try to change default page in App.cs.
I can't find this App.cs file in PCL project.
What I do wrong or how can I create App.cs file?
Thank you in advance.
in xamarin.android remove the reference of xamarin.forms project and add it again. it worked for me.
The newer versions of the Forms project templates will name the default startup class file "MyProject.cs" (ie, whatever you named your project when you created it) instead of App.cs.

Resources