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

Unable to add RadPdfViewer control to solution

4 Answers 89 Views
PdfViewer
This is a migrated thread and some comments may be shown as answers.
Paul Ridden
Top achievements
Rank 1
Veteran
Paul Ridden asked on 05 Apr 2019, 02:56 PM

Hi,

Having used the demo app, I am now trying to add the RadPdfViewer control only to my solution. I am following these instructions (https://docs.telerik.com/devtools/xamarin/controls/pdfviewer/pdfviewer-getting-started).

I initially tried the NuGet package but ran into an "error MSB6006: "java.exe" exited with code 2." situation. I tried increasing the java max heap size passed my current value of 1G, but this did not get resolved.

I then tried the manual DLL reference method, however upon building the solution, I run into the following error :-

error: package com.telerik.android.common does not exist

Therefore, from the list of DLLs for the Android project, it seems like Telerik.Xamarin.Android.Common.dll is missing.

I then reference Telerik.Xamarin.Android.Common.dll and although I am now able to build the solution, I run into the following exception when trying to navigate to a page that contains the RadPdfViewer control :-

NativeResourceProvider.ToPlatformPixels (System.Double dip)
System.TypeInitializationException: Exception of type 'System.Exception' was thrown

 

Am I missing some additional references?

As a side note, is there a way to fix the "error MSB6006: "java.exe" exited with code 2." when using the NuGet package, as this would ideally be my preference.

4 Answers, 1 is accepted

Sort by
0
Paul Ridden
Top achievements
Rank 1
Veteran
answered on 05 Apr 2019, 03:30 PM

Hi,

After further investigation, I found that I need to reference the following DLLs :-

For PCL project :-
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Portable\Telerik.Documents.Core.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Portable\Telerik.Documents.Fixed.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Portable\Telerik.XamarinForms.PdfViewer.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Portable\Telerik.XamarinForms.SkiaSharp.dll

Not present in provided list :-
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Portable\Telerik.XamarinForms.Common.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Android\Telerik.XamarinForms.Primitives.dll

For Android project :-
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Portable\Telerik.Documents.Core.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Portable\Telerik.Documents.Fixed.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Portable\Telerik.Zip.dll

C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Android\Telerik.XamarinForms.PdfViewer.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Android\Telerik.Xamarin.Android.Primitives.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Android\Telerik.XamarinForms.Common.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Android\Telerik.XamarinForms.SkiaSharp.dll

Not present in provided list :-
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Android\Telerik.Xamarin.Android.Common.dll
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R1 2019\Binaries\Android\Telerik.XamarinForms.Primitives.dll

 

The location of these DLLs is important, as although the DLLs are named the same in both the Portable and Android folders, they are in fact different. The additional DLLs for both Android and PCL are required to prevent the build error and runtime errors as mentioned above.

0
Didi
Telerik team
answered on 08 Apr 2019, 10:18 AM
Hello Paul,

Thank you for the provided information.

I can assure you that the documentation about the PdfViewer -required references is updated and will be live soon. You can find your Telerik points updated as a small sign of gratitude for your involvement.

Regarding to the error "MSB6006: "java.exe" exited with code 2" . Could you please give us the following information:

- in which scenarios the error occurs
- stack trace of the exception
- sample project where the issue could be reproduced
- the pdf file

Please note that you should open a support ticket and attach the project there because in the forum only image attachments are allowed.

Thank you in advance.

Regards,
Didi
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
Stephen
Top achievements
Rank 1
answered on 11 Oct 2019, 03:37 PM

I don't think your docs are still up to date still as it doesn't mention anything about having to add the above DLLs manually.

Regards

 

Steve

0
Didi
Telerik team
answered on 14 Oct 2019, 10:38 AM

Hi Steve,

I can assure you that the Getting Started docs is updated regarding the feedback we have received about the missing dlls. Could you please elaborate more on the following "I don't think your docs are still up to date still as it doesn't mention anything about having to add the above DLLs manually."

The section 2 from PdfViewer Getting Started article: 2. Adding the required Telerik references. contains information how to add the required dlls  through the Telerik Nuget Server or manually. 

I look forward to your reply.

Regards,
Didi
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
PdfViewer
Asked by
Paul Ridden
Top achievements
Rank 1
Veteran
Answers by
Paul Ridden
Top achievements
Rank 1
Veteran
Didi
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or