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

Install Telerik Xamarin

16 Answers 399 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 2
Iron
Iron
Pierre asked on 22 Sep 2017, 09:00 PM

hi, I try to manually install Telerik on my Xamarin.forms projet. 

I do not use the normal Portable Class but a .Net Standard Instead with Xamarin Forms 2.4.0.269-pre2. I manage to install all the DLL required for the Listview control. But when I compile I got several error on the Android projet:

SeverityCodeDescriptionProjectFileLineSuppression State
Errorerror: package com.telerik.android.primitives.widget.sidedrawer does not exist
com.telerik.android.primitives.widget.sidedrawer.DrawerChangeListenerTechCenter.AndroidC:\Data\_Dev\Xamarin\TechCenter\TechCenter\TechCenter.Android\obj\Debug\android\src\mono\com\telerik\android\primitives\widget\sidedrawer\DrawerChangeListenerImplementor.java8

I work on Android API25 for now and I install the lastest Telerik build 2017-3-913-3

 

Any suggestion?

 

16 Answers, 1 is accepted

Sort by
0
Accepted
Stefan Nenchev
Telerik team
answered on 27 Sep 2017, 12:35 PM
Hello, Pierre,

.NET Standard is still in pre-release for Xamarin.Forms (i.e. you can't add Xamarin.Forms NuGet package to a .NET Standard PCL w/out using pre-release packages). We target our packages to meet the latest Xamarin.Forms package at the time of release. Therefore, we do not have official support for .NET Standard yet. This feature should be available soon though.

In the meantime, we have managed to get a project targeting .NET Standard to work with our controls. I have attached the sample for your reference. Please have in mind that references are manually added and the Nuget package is not used. Can you have a look at it and try to run it at your end?

Regards,
Stefan Nenchev
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
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 27 Sep 2017, 08:21 PM

Thanks for the sample application.

I try to add manually all the DLL to my 4 projects fromt the Telerik 2017.3.913.3_DEV. But when I compile (I do not add any telerik code for now) I got one error and 740 warning on the Android project only:

Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'SkiaSharp, Version=1.59.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'. Perhaps it doesn't exist in the Mono for Android profile?
 
Warning     Skipping TechCenter.Droid.Resource.Drawable.ic_media_pause. Please check that your Nuget Package versions are compatible.
....
....

 

I add all the DLL that I use into your sample project and everything is working. I think I got some garbage on my project/Solution! I delete the bin and OBJ of the Android project and do a Clean and Rebuil of the solution. Same problem. Any Idea?

0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 27 Sep 2017, 08:28 PM

More info. 

I add this to my app.config:

<dependentAssembly>
  <assemblyIdentity name="SkiaSharp" publicKeyToken="0738eb9f132ed756" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-1.58.0.0" newVersion="1.58.0.0" />
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="SkiaSharp.Views.Android" publicKeyToken="0738eb9f132ed756" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-1.58.0.0" newVersion="1.58.0.0" />
</dependentAssembly>

And I see that in the packages.config in you project you have:

<package id="SkiaSharp" version="1.58.1" targetFramework="monoandroid60" />
<package id="SkiaSharp.Views" version="1.58.1" targetFramework="monoandroid60" />
<package id="SkiaSharp.Views.Forms" version="1.58.1" targetFramework="monoandroid60" />
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
<package id="Xamarin.Android.Support.Design" version="23.3.0" targetFramework="MonoAndroid60" />
<package id="Xamarin.Android.Support.v4" version="23.3.0" targetFramework="MonoAndroid60" />
<package id="Xamarin.Android.Support.v7.AppCompat" version="23.3.0" targetFramework="MonoAndroid60" />
<package id="Xamarin.Android.Support.v7.CardView" version="23.3.0" targetFramework="MonoAndroid60" />
<package id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" targetFramework="MonoAndroid60" />
<package id="Xamarin.Android.Support.v7.RecyclerView" version="23.3.0" targetFramework="MonoAndroid60" />
<package id="Xamarin.Android.Support.v8.RenderScript" version="23.3.0" targetFramework="MonoAndroid60" />
<package id="Xamarin.Android.Support.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
<package id="Xamarin.Forms" version="2.4.0.266-pre1" targetFramework="monoandroid60" />

 

And in mine (I am targeting the 25.4 and monoandroid71):

<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Annotations" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Compat" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Core.UI" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Core.Utils" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.CustomTabs" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Design" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Fragment" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Media.Compat" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Transition" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.v4" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.v7.AppCompat" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.v7.CardView" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.v7.MediaRouter" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.v7.Palette" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.v7.RecyclerView" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Android.Support.Vector.Drawable" version="25.4.0.2" targetFramework="monoandroid71" />
<package id="Xamarin.Forms" version="2.4.0.269-pre2" targetFramework="monoandroid71" />
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 27 Sep 2017, 08:30 PM

More info. I add the 2 dependent assembly that you have in the app.config.

But in my packages.config, I do not target the same adnroid version that you have in your project. I use 25.4.0.2 and monoAndroid71 instead of 23.3.0 monoAndroid60

Maybe is the point?

0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 27 Sep 2017, 08:51 PM

Ooo I forgot to add the SkiaShark nuget. 

So now I get rid of the Skia Error, but the 740 warning are still there and I go a new Java.lang.OutOfMemory ;-)

0
Lance | Manager Technical Support
Telerik team
answered on 27 Sep 2017, 09:22 PM
Hi Pierre,

To resolve this, increase your Java Heap to 1G. 

If you're not familiar with setting the heap size, it's in the Android project's properties. We cover this in more detail here in our Troubleshooting section of the UI for Xamarin documentation.

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
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 02 Oct 2017, 09:49 PM

Thanks for your help. I manage to make the list view working. I remove several not needed assemblies. When we change the selection color background or the ListviewTemplateCell.View do I explicitly need to create custom renderers for IOS and Android?The design is working (Grid, image and Label), but selectedColor, itemcolor and border modification work only on UWP.

<telerikDataControls:RadListView x:Name="listView" ItemsSource="{Binding Source}" SelectionMode="Single">
    <telerikDataControls:RadListView.SelectedItemStyle>
        <telerikListView:ListViewItemStyle BackgroundColor="{StaticResource SideItemSelBgColor}" BorderWidth="3" BorderLocation="Bottom"/>
    </telerikDataControls:RadListView.SelectedItemStyle>
    <telerikDataControls:RadListView.ItemTemplate>
        <DataTemplate>
            <telerikListView:ListViewTemplateCell>
                <telerikListView:ListViewTemplateCell.View>
                    <Grid Padding="5,10">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="30"/>
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Image Source="{Binding Icon}" WidthRequest="30" HeightRequest="30" Aspect="AspectFit" VerticalOptions="Center" />
                        <Label Grid.Column="1" Text="{Binding Title}" HeightRequest="30" Style="{StaticResource MenuItemLabel}" VerticalOptions="Center"/>
                    </Grid>
                </telerikListView:ListViewTemplateCell.View>
            </telerikListView:ListViewTemplateCell>
        </DataTemplate>
    </telerikDataControls:RadListView.ItemTemplate>
</telerikDataControls:RadListView>

 

0
Accepted
Lance | Manager Technical Support
Telerik team
answered on 02 Oct 2017, 10:16 PM
Hello Pierre,

To isolate the issue can you bind that static resource color to another UI element on the page (outside of the RadListView). For example, put a BoxView above or below the RadListView, set it's background to that resource and confirm that you're seeing the color on all 3 platforms?

To help you further with this, please open a support ticket here and attach the files responsible for the resources and Views. I'll see the ticket arrive and investigate further.

A Support Ticket guarantees a support engineer will review it and respond within the ticket's time-frame We try to monitor the public forum threads, however this is subject to available resources and may take longer to get back to you.

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
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 03 Oct 2017, 01:43 PM

Thanks for your help! My error. In fact, the selected background color was working
expectedly. But the "normal" item background was set to white when the selection
change. I just add this code and all is working now!

<telerikDataControls:RadListView.ItemStyle>
    <telerikListView:ListViewItemStyle BackgroundColor="{StaticResource SideBgColor}"></telerikListView:ListViewItemStyle>
</telerikDataControls:RadListView.ItemStyle>
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 03 Oct 2017, 08:28 PM

Just another small listview question. Do you support command binding like:

SelectionChanged="{Binding SelectionChangedCommand}"

Then

public RelayCommand SelectionChangedCommand;
 
public MasterViewModel(INavigationService navigationService)
{
     _navigationService = navigationService;
     // Initialize commands
     SelectionChangedCommand = new RelayCommand(OnSelection);
}

I got this error:

SeverityCodeDescriptionProjectFileLineSuppression State
ErrorUnable to cast object of type 'Xamarin.Forms.Xaml.ElementNode' to type 'Xamarin.Forms.Xaml.ValueNode'.

On the xaml listview definition. If I remove the Selection Changed all is working.

 

 

0
Lance | Manager Technical Support
Telerik team
answered on 03 Oct 2017, 09:53 PM
Hello Pierre,

SelectionChanged is an event and thus not directly bindable to a ICommand. For this, you need to use an EventToCommand binding. For Xamairn.Forms you can do this with an EventToCommand behavior.

Xamarin has a great blog post on this as well as a demo application.

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
Hari
Top achievements
Rank 1
answered on 04 Jan 2018, 05:25 AM
Hi, is there a timeline related to implementing netstandard support for these components?
0
Hari
Top achievements
Rank 1
answered on 04 Jan 2018, 05:41 AM
Xamarin.Forms 2.5.0.121934 supports netstandard1.0
0
Hari
Top achievements
Rank 1
answered on 04 Jan 2018, 05:42 AM
Xamarin.Forms 2.5.0.121934 supports netstandard1.0
0
David Yardy
Top achievements
Rank 1
answered on 05 Jan 2018, 12:39 AM

Using Xamarin Forms 2.5.0.121934 with .net standard 2 library.

Telerik UI for Xamarin does not appear to be compatible "SeverityCodeDescriptionProjectFileLineSuppression State
WarningNU1701Package 'Telerik.UI.for.Xamarin 2017.3.1214.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.App3C:\Temp\xamarin\App3\App3\App3\App3.csproj1"

0
Stefan Nenchev
Telerik team
answered on 05 Jan 2018, 12:45 PM
Hello, David,

As advised in the ticket you have raised, the version you are referring to is compatible with .NET standard 2.0. Please follow the ticket communication for more information and diagnosing what might be causing the undesired behavior at your end.

Regards,
Stefan Nenchev
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
Tags
General Discussions
Asked by
Pierre
Top achievements
Rank 2
Iron
Iron
Answers by
Stefan Nenchev
Telerik team
Pierre
Top achievements
Rank 2
Iron
Iron
Lance | Manager Technical Support
Telerik team
Hari
Top achievements
Rank 1
David Yardy
Top achievements
Rank 1
Share this question
or