Install Telerik Xamarin

12 posts, 2 answers
  1. Pierre
    Pierre avatar
    227 posts
    Member since:
    Apr 2007

    Posted 22 Sep Link to this post

    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?

     

  2. Answer
    Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    503 posts

    Posted 27 Sep Link to this post

    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
  3. Pierre
    Pierre avatar
    227 posts
    Member since:
    Apr 2007

    Posted 27 Sep Link to this post

    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?

  4. Pierre
    Pierre avatar
    227 posts
    Member since:
    Apr 2007

    Posted 27 Sep Link to this post

    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" />
  5. Pierre
    Pierre avatar
    227 posts
    Member since:
    Apr 2007

    Posted 27 Sep Link to this post

    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?

  6. Pierre
    Pierre avatar
    227 posts
    Member since:
    Apr 2007

    Posted 27 Sep Link to this post

    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 ;-)

  7. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    419 posts

    Posted 27 Sep Link to this post

    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
  8. Pierre
    Pierre avatar
    227 posts
    Member since:
    Apr 2007

    Posted 02 Oct in reply to Lance | Tech Support Engineer, Sr. Link to this post

    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>

     

  9. Answer
    Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    419 posts

    Posted 02 Oct Link to this post

    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
  10. Pierre
    Pierre avatar
    227 posts
    Member since:
    Apr 2007

    Posted 03 Oct in reply to Lance | Tech Support Engineer, Sr. Link to this post

    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>
  11. Pierre
    Pierre avatar
    227 posts
    Member since:
    Apr 2007

    Posted 03 Oct Link to this post

    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.

     

     

  12. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    419 posts

    Posted 03 Oct Link to this post

    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
Back to Top