Xamarin.Forms demo with a working Android project?

455 views
Skip to first unread message

jfri...@admcrs.com

unread,
Mar 2, 2017, 9:40:49 PM3/2/17
to PDFTron PDFNet SDK
Can we please get an updated and working Xamarin.Forms demo project? The Android project specifically has all kinds of problems. The current demo version is on Xamarin.Forms 2.0.0.6482 and as of March 2nd, 2017, the current stable version of Xamarin.Forms is 2.3.3.193 (18 versions ahead). 

Building as is gets you the following error:

The "ResolveLibraryProjectImports" task failed unexpectedly.

After updating Xamarin.Forms and rebuilding, the above error goes away, but now I get these errors:

No resource identifier found for attribute 'fab_colorNormal' in package 'FormsDemo.Droid'
No resource identifier found for attribute 'fab_colorPressed' in package 'FormsDemo.Droid'

These errors seem to be linked to the FloatingActionButton.dll included with the PDFNetXamarin SDK download. Apparently PDFTron for Xamarin.Android depends on this other third party project (which is another question in and of itself). So after adding a reference to the FloaingActionButton library, the above errors go away, but now I get this error:

Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Xamarin.Android.Support.Fragment, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?

A
t this point I'm starting to head into unfamiliar territory. The error implies that Xamarin.Android.Support.Fragment does not exist in the project and it needs to. So after adding the Xamarin.Android.Support.Fragment NuGet, the above error goes away, but now I get this error:

java.lang.IllegalArgumentException: already added :  Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat; FormsDemo.Droid

Along with a lot of warnings about duplicates:

Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Android.Support.V4.App.FragmentManager+IOnBackStackChangedListenerImplementor, Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Android.Support.V4.App.FragmentManager+IOnBackStackChangedListenerImplementor, Xamarin.Android.Support.Fragment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. FormsDemo.Droid

I'm not totally sure how to proceed from here. All I would like is a working demo project or something else that I can use as a reference to get my project working. There is no Xamarin specific documentation and the Xamarin.Android API seems to be significantly different than the Xamarin.iOS API. I didn't come across any showstoppers when I was working with the iOS project, but as you can see, I am having quite a few issues with the Android project. If I could get some help with this, that would be great!

Ryan

unread,
Mar 6, 2017, 12:36:18 PM3/6/17
to PDFTron PDFNet SDK
Thanks for letting us know. We are updating the sample project will update you with a new project early this week.

jfri...@admcrs.com

unread,
Mar 7, 2017, 4:28:40 PM3/7/17
to PDFTron PDFNet SDK
Thanks, Ryan! I'll keep an eye out for it.

jfri...@admcrs.com

unread,
Apr 17, 2017, 8:14:17 PM4/17/17
to PDFTron PDFNet SDK
Hey Ryan, has the sample project been updated yet? I have been monitoring the download page and it still seems to be the same.

Ryan

unread,
Apr 20, 2017, 1:16:00 PM4/20/17
to PDFTron PDFNet SDK
Yes, everything has been updated, including the mobile download page today. Thank you for your patience.

Ryan

unread,
Jan 22, 2018, 7:48:37 PM1/22/18
to PDFTron PDFNet SDK
For anyone still hitting this error when merging PDFNet into their project, please kindly check if `FloatingActionButton.dll` is added as a dependency in your application.

This DLL can be found in lib/android folder.
Reply all
Reply to author
Forward
0 new messages