exception

9 posts, 0 answers
  1. Abdou
    Abdou avatar
    14 posts
    Member since:
    Jul 2018

    Posted 25 Jun 2019 Link to this post

    hallo,

     

    after update last telerik XF DLLs i get this error linker in Release Mode see screenshot

     

    Gruß

    Abdou

     

     

  2. Abdou
    Abdou avatar
    14 posts
    Member since:
    Jul 2018

    Posted 28 Jun 2019 in reply to Abdou Link to this post

    hello,

    i can compile in debug Mode but in Release NOT.

    There is a new Update or fix for this problem ?

    VG

  3. Petar Marchev
    Admin
    Petar Marchev avatar
    1029 posts

    Posted 28 Jun 2019 Link to this post

    Hello Abdou,

    Our library does not support linking at the moment and this may be the origin of the problem. Perhaps the linker strips away some stuff that we use. Try to set None Linking in the Android Options tab of the project. Let us know how it goes.

    Regards,
    Petar Marchev
    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
  4. Abdou
    Abdou avatar
    14 posts
    Member since:
    Jul 2018

    Posted 28 Jun 2019 in reply to Petar Marchev Link to this post

    hello petar,

    it works but it build slowly and the size of the apk is up to 84 Mb !!

    it went before in Release Mode ! 

    Gruß

    Abdou

  5. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1195 posts

    Posted 28 Jun 2019 Link to this post

    Hello Abdou,

    Correct, when you have SDK-only, the linker will not remove other external assembly code.  I have a couple other options you can look into to see if it helps to go back to LinkAll.

    1. XAML Compilation

    Make sure you enable XamlC at the assembly level. This will prevent compilation from stripping out any code that is defined in XAML that doesn't have an x:Name. Although I do not think this will solve your problem, it's one line of code to rule it out and is good practice anyways.

    [assembly: Xamarin.Forms.Xaml.XamlCompilation(Xamarin.Forms.Xaml.XamlCompilationOptions.Compile)]
    namespace YourApp
    {
        
    }

    Without XamlC enabled, any element defined in XAML without an x:Name to have a reference to the class, it will be stripped by the linker. For example, if you have a RadBarcode with an x:Name, but the nested elements do not have one, it will get stripped out:



    After you've enabled XamlC, do a Clean and Rebuild to ensure everything in the bin is refreshed, then try a Release build with LinkAll enabled.


    2. Linker Manipulation

    A more likely solution is to configure the linker. You could try to prevent the linker from removing the code that your app relies on, see the following articles about advanced linking. 

    - Linking on iOS: Controlling the Linker
    - Custom Linker configuration

    Looking at the error, it actually looks like the Linker is removing SkiaSharp classes that the Telerik drawing libraries need, not a Telerik class.  You could try making dummy instances of the classes you see in any errors.

    For example, using the class I see in the screenshot:

    public partial class App : Application
    {
        public App()
        {
            InitializeComponent();
     
            // dummy instance to prevent iOS Linker from stripping out SkiaSharp classes
            new SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs(null,null);
        }
    }

    That trick forces the linker to keep the class because there is a direct reference to it.

    Demo Test


    I have tested a Release build with just the RadBarcode XAML seen above, with XamlC and LinkAll enabled. It build and deploys successfully, here's a screenshot of the results:




    Further Investigation

    It's highly likely that my test code is not representative of your project. If you still have issues after applying my suggestions, we will need to take a closer look to see if there are any suggestions we can offer.

    Take the following steps:

    1. Prepare a small isolated test project with your code that reproduces the error (you can use the File > New > Telerik Xamarin UI project template to quickly get started)
    2. Go to the Contact Support Team web page
    3. Open a new UI for Xamarin Support Ticket, attach the project and summarize the issue (you can paste a URL to this thread to help describe the issue)

    Though ultimately, like Petar mentions at this time we don't support full linking, I would recommend using the Link Framework SDKs Only option or setting up the Linker with custom options not to strip out the code causing the error.

    Regards,
    Lance | Technical Support Engineer, Principal
    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
  6. Abdou
    Abdou avatar
    14 posts
    Member since:
    Jul 2018

    Posted 01 Jul 2019 in reply to Lance | Manager Technical Support Link to this post

    Hi Lance,

    thanks for the detailed answer.

    Unfortunately it still does not work. I added the  2 lines in the Portable App Class.

    I only use the "sdk assembly only" link and not all. the error message comes from Android Project! not from ios left

     

    [assembly: Xamarin.Forms.Xaml.XamlCompilation(Xamarin.Forms.Xaml.XamlCompilationOptions.Compile)]
    namespace Wilkinson.Portable
    {
     
        public partial class App : Application
        {
            private const string FILESENDEN = "senden_ok.txt";
            private const string APKDELETE = "apkdelete.txt";
            private const string APKNAME = "ws.apk";
            private const string TABLE_ZIP = "tabellen.zip";
     
     
            public App()
            {
                InitializeComponent();
     
                new SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs(null,default(SkiaSharp.GRBackendRenderTargetDesc));
                MainPage = new NavigationPage(new StartPage());
     
            }
     

    Gruß

     

  7. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1195 posts

    Posted 01 Jul 2019 Link to this post

    Hi Abdou,

    Thank you for the update. I suspected that my test code wouldn't be sufficient to replicate your scenario. At this point, we'll need to directly investigate in order for us to see if there's something we can do to help.

    If you would like us to see if there's a possibility for you to use full linking, even though it's not officially supported, please follow the Support Ticket instructions at the end of my last reply (in the 'Further Investigation' section).

    With that reproducible project, we can have a better understanding of what objects your project needs and try to track down what might be getting stripped out. Once that is known, a workaround may be possible.

    Regards,
    Lance | Technical Support Engineer, Principal
    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. Abdou
    Abdou avatar
    14 posts
    Member since:
    Jul 2018

    Posted 02 Jul 2019 Link to this post

    Hi Lance,

    the following scenario:

    I have installed the SkiaSharp v.1.60.0 and after update to latest Veriosn 1.68.0 the problem is solved and the error processing is gone. Now the problem in the latest version 1.68.0 is a bug (my post from 30.01)

    https://www.telerik.com/forums/exception-d1ad2310bb9f

    I think I wait until version 1.68.1 comes out?!

     

    Gruß

    Abdou

  9. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1195 posts

    Posted 02 Jul 2019 Link to this post

    Hi Abdou,

    I'm happy you were able to identify the issue. Our minimum SkiaSharp version is 1.59.3, it is the version we currently use internally. We can only promise 100% compatibility and functionality with 1.59.3

    There was indeed a bug in SkiaSharp in 1.60 which is why Microsoft quickly released 1.68 not too soon afterwards. If you're having trouble with SkiaSharp in versions above that then we recommend you drop down to 1.59.3. If you have to use 1.6 or later for other reasons, then yes unfortunately  you will need to wait for 1.68.1 (it is expected to come out soon).

    Regards,
    Lance | Technical Support Engineer, Principal
    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