This is a migrated thread and some comments may be shown as answers.

Xamarin Forms Couldn't recognize telerik UI

7 Answers 886 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
San
Top achievements
Rank 1
San asked on 28 Jun 2018, 06:06 PM

Hi,

 

Xamarin forms dependency donesn't recognize in telerik UI 

Error : 'telerikPrimitives' is an undeclared prefix. Line 20, position 10.
Error : 'telerikInput' is an undeclared prefix. Line 24, position 14.

Please provide me a solution.

 

Thanks.

7 Answers, 1 is accepted

Sort by
0
Lance | Senior Manager Technical Support
Telerik team
answered on 28 Jun 2018, 06:53 PM
Hi San,

Those are XAML xmlns declarations. You need to have them defined at the top of the XML for any class that is not in the same scope as that XAML page. .

             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:YourApplicationNamespace.Portable"
             xmlns:YOUR_XML_NAMEPSACE="clr-namespace:NAMESPACE;assembly=ASSEMBLY"
             x:Class="RowStyleDemo.Portable.MainPage">


For Telerik namespaces, you'll find them in the Getting Started section of the controls you're using. For example "telerikInput" can be seen in RadNumericInput Getting Started article and the telerikPrimitives can be seen in the RadBorder Getting Started article.


Note that these can be whatever you want them to be, for example:

<ContentPage x:Name="Page"
    xmlns:myAwesomeInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
    xmlns:myAwesomePrimitives="clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives">
 
    <myAwesomeInput:RadNumericInput  />
 
    <myAwesomePrimitives:RadBorder />
 
</ContentPage>

If you're still having trouble, please reply back with the rest of the code so that I can inspect it directly.

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
San
Top achievements
Rank 1
answered on 30 Jun 2018, 10:17 AM
Thanks
0
Taqwa
Top achievements
Rank 1
answered on 07 Nov 2018, 11:48 AM

I need your help please,

 

I'm trying to add button but each time this error appear to me 

xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"

please see attached.

 

while I added the namespace on the top of xaml page

xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"

 

0
Lance | Senior Manager Technical Support
Telerik team
answered on 07 Nov 2018, 03:39 PM
Hello Taqwa,

The namespace is correct. The likely issue is a missing the assembly references or the project doesn't have the NuGet package installed.

Option 1 - Assembly References

Please visit the RadButton's Getting Started > Required Telerik Assemblies article to make sure that all the assembles are referenced in each of the projects.


Option 2 - NuGet (recommended in VS for Mac)

The best way to ensure all of the projects have the appropriate references is to use the Telerik NuGet server instead of assembly references. Follow the instructions in that link and make sure you have the Telerik.UI.for.Xamarin NuGet package installed to all the projects.


Demo

Once you've added Telerik NuGet server to Visual Studio's NuGet package sources, you can use my attached demo to see the RadButton in action.

For your convenience, here's the code on MainPage:

<?xml version="1.0" encoding="utf-8"?>
<ContentPage
    xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
    xmlns:local="clr-namespace:TaqwaDemo"
    x:Class="TaqwaDemo.MainPage">
    <Grid>
        <StackLayout
            VerticalOptions="Center"
            HorizontalOptions="Center"
            Orientation="Horizontal"
            Spacing="5">
            <telerikInput:RadButton
                WidthRequest="120"
                HeightRequest="120"
                Text="A"
                FontSize="Micro"
                TextColor="White"
                BackgroundColor="DarkMagenta"
                CornerRadius="60" />
            <telerikInput:RadButton
                WidthRequest="120"
                HeightRequest="120"
                Text="B"
                FontSize="Micro"
                TextColor="White"
                BackgroundColor="DarkRed"
                CornerRadius="60" />
            <telerikInput:RadButton
                WidthRequest="120"
                HeightRequest="120"
                Text="C"
                FontSize="Micro"
                TextColor="White"
                BackgroundColor="DarkBlue"
                CornerRadius="60" />
        </StackLayout>
    </Grid>
</ContentPage>


Further Assistance

If you have any future issues, please provide us with a way to reproduce the problem. The best way is sharing the project itself so we can investigate directly. Especially in cases where assemblies or NuGet packages are not working.

If you're not able to share the entire project, then please share the code for that ContentPage along with the .csproj files from the relevant projects.

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Taqwa
Top achievements
Rank 1
answered on 11 Nov 2018, 08:09 AM

Hello Eng.Lance,

 

Thanks for your response.

I followed the two option but still iOS project has the same issue.

I upload the project in one drive

 https://ksauhsedu-my.sharepoint.com/:u:/g/personal/dwaibt_ksau-hs_edu_sa/EfuCRQVmv19Fm_x4Qgnosl4BFKtOsACVJmCeI_fKHw6yZQ?e=PLf8s3

 

please help.

thanks,

0
Lance | Senior Manager Technical Support
Telerik team
answered on 11 Nov 2018, 06:29 PM
Hello Taqwa,

Thank you for providing the repro project. There were two things in the project that could cause this:

1 - The Forms project was a PCL, this is a deprecated project type. All Xamarin.Forms apps (v3.x or later) should be using .NET Standard 2.0 

Note: As I mentioned in our support ticket, the Telerik project template still uses a PCL, which is an error on our part. We needed to update this to .NET Standard 2.0 for our 2018 R3 release. This is going to be fixed in the next release.

2 - There was some ambiguity because the Telerik assemblies were still in the project and there were some NuGet references and local assembly references. A duplicate assembly reference will provide duplicate namespaces and cause such an error.


Solution

Here is how you should create a new project until we update the project template for Mac

1- Use the default Xamarin.Forms project template to create a new project
2 - Add the Telerik to the solution by installing the Telerik.UI.for.Xamarin NuGet package to each project in the solution.

Done!

Demo

I have gone ahead and done this for you and copied over the content in your original project. Find it attached. Here's a screenshot at runtime:



Zip Tip

Before I conclude, I wanted to share a tip when it comes to zipping up your project to be shared. You can delete all the bin, obj (and if your project has one, the Packages) folder from every project in the solution. This is because Visual Studio will create and restores these folders when you do a rebuild.  

By removing these autogenerated folders, you reduce the ZIP size from hundreds of MBs down to just a few MB! For example, your project ZIP was 621 MB, while mine is now only 1 MB!


Further Assistance

I hope this is helpful, if you have any future trouble, please open a support ticket so we can investigate directly (you can attach a ZIP to a support ticket).

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Taqwa
Top achievements
Rank 1
answered on 12 Nov 2018, 08:05 AM
Thanks Alot its working now, after using the xamarin template and installing telerik nuget package.
Tags
General Discussions
Asked by
San
Top achievements
Rank 1
Answers by
Lance | Senior Manager Technical Support
Telerik team
San
Top achievements
Rank 1
Taqwa
Top achievements
Rank 1
Share this question
or