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

exception

8 Answers 65 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
Abdou
Top achievements
Rank 1
Abdou asked on 25 Jun 2019, 12:15 PM

hallo,

 

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

 

Gruß

Abdou

 

 

8 Answers, 1 is accepted

Sort by
0
Abdou
Top achievements
Rank 1
answered on 28 Jun 2019, 10:46 AM

hello,

i can compile in debug Mode but in Release NOT.

There is a new Update or fix for this problem ?

VG

0
Petar Marchev
Telerik team
answered on 28 Jun 2019, 10:56 AM
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
0
Abdou
Top achievements
Rank 1
answered on 28 Jun 2019, 11:14 AM

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

0
Lance | Manager Technical Support
Telerik team
answered on 28 Jun 2019, 06:38 PM
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
0
Abdou
Top achievements
Rank 1
answered on 01 Jul 2019, 07:08 AM
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ß

 

0
Lance | Manager Technical Support
Telerik team
answered on 01 Jul 2019, 03:14 PM
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
0
Abdou
Top achievements
Rank 1
answered on 02 Jul 2019, 08:30 AM

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

0
Lance | Manager Technical Support
Telerik team
answered on 02 Jul 2019, 03:48 PM
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
Tags
DataGrid
Asked by
Abdou
Top achievements
Rank 1
Answers by
Abdou
Top achievements
Rank 1
Petar Marchev
Telerik team
Lance | Manager Technical Support
Telerik team
Share this question
or