I have an iOS and Android mobile application developed with Xamarin.Forms. I am looking for a document editor that I can integrate into this application.
I came across GroupDocs.Editor while searching for an editor.
When I look at the Platform Independence field of GroupDocs.Editor, I see Xamarin.Android and Xamarin.iOS options in the Development Environments options. I also see that there is .NET Standard 2.0+ support as Supported Frameworks. The Xamarin.Forms project is .NET Standard 2.0 so I expect it to be Xamarin.Forms compatible as well.
However, when I include the GroupDocs.Editor nuget in my Xamarin.Forms project, I get the following errors.
Can not resolve reference: System.Formats.Asn1, referenced by System.Security.Cryptography.Pkcs. Please add a NuGet package or assembly reference for System.Formats.Asn1, or remove the reference to System.Security.Cryptography.Pkcs.
Severity Code Description Project Project Rank File Line Suppression State Tool
Can not resolve reference: Aspose.Cells, referenced by GroupDocs.Editor. Please add a NuGet package or assembly reference for Aspose.Cells, or remove the reference to GroupDocs.Editor.
After adding all the relevant packages to fix the errors that appeared in this way, I encountered an error like the one below.
Mono.Linker.MarkException: Error processing method: âSystem.Void /::(Aspose.Email.MailMessage)â in assembly: âGroupDocs.Editor.dllâ â> Mono.Cecil.ResolutionException: Failed to resolve System.Void Aspose.Email.Storage.Mbox.MboxStorageWriter::WriteMessage(Aspose.Email.MailMessage)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
â End of inner exception stack trace â
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17
Can I use GroupDocs.Editor in my Xamarin.Forms project?
Please take a look at this example project - GroupDocs.Editor.XamarinSample.zip (403.8 KB).
To run Xamarin project for GroupDocs.Editor for .Net you need to:
Thank you @Atir_Tahir. I tried that works. But I have 2 question.
My first question: I thought I would open files in the editable mode with GroupDocs.Editor. For example like your MVC project. The file is opened with GroupDocs.Editor in the MVC project, files can edit and view by the end user in the your MVC sample. I have expected Xamarin is the same. But as I understand from the example your send, the file is converted to html and displayed in view mode in the xamarin. So it is not editor it is viewer?
My second question: The project is working, but when I open it first, it stays on a white screen. When i open it it second time, it shows ui. This happens every time I run the sample project.
Sorry, I expressed wrong my second problem. There is a white screen issue in the Xamarin project, not the MVC project. I run your send sample in the emulator.
Application react like:
1.When I run from the visual studio, it stuck in the white screen.
2.If I run the project from the visual studio and when I close it from the emulator, there is occured an error.
3.If I run the project from the emulator, it runs with no error.
I recorded screen. If you watch you can understand clearly. (I couldnât upload it to here because of the video size. I uploaded it the drive. Could you download it from following drive link)
Thank you, I am aware of second problem can be fix. It is no problem for now. But editor is important for us. We are looking for editor. I look forward to hearing from you about whether GroupDocs supports this.
Thanks.
GroupDocs.Editor is a document editor API, for document viewing purpose we have a GroupDocs.Viewer. The sample project weâve send you is intended to show that GroupDocs.Editor works in Xamarin, itâs compile-able and runnable . But itâs not a fully functional solution which allows to edit files âfrom the boxâ - itâs just a minimum viable sample.
As you know, GroupDocs.Editor is a UI-less and works with HTML, like Google Docs - it converts a document from original format to HTML/CSS and then you edit its content in your WYSIWYG-editor in the browser. Take a look at this documentation article. And here how it works (and what can be achieved) with our UI.
We donât see problem with GroupDocs.Editor for .Net. According to the provided video, issue was with connection to debugger (see this screenshot.jpg (172.7 KB)). Also we donât see any GroupDocs.Editor related issue in the stacktrace.
Thanks. I tried with your sample last week. Iâm currently trying to test it in my own project. (Because your sample is only for Xamarin.Forms/Android, I want to try it on Xamarin.Forms/iOS as well.) For this reason, I installed all the additional libraries in the versions as your said. I opened Internet permission and added âAdditional supported encodingsâ. But I keep getting error like below. Could you help me please? image.png (12.5 KB)
Sorry. I can solve with Android Options. I donât know which one worked, but I changed Linking none, checked Use Fast Deployment, Use indremental Android packaging system, Use the concurrent garbage collector. When I changed these, error fixed.