Hello, I'm working with DOCIO and when I build and save the file in IOS with this method it works perfectly:
//Save the stream as a file in the device and invoke it for viewing
await Xamarin.Forms.DependencyService.Get<ISave>().SaveAndView(documentName + ".docx", "application/msword", stream);
However when I try to save the document in android the app crashes and I get this error:
Java.IO.FileNotFoundException: /storage/emulated/0/Syncfusion/x.docx (No such file or directory)
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <09821b4f44794452b7d6c054ac9447f5>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.FinishCreateInstance (System.String constructorSignature, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0004f] in <09821b4f44794452b7d6c054ac9447f5>:0
at Java.IO.FileOutputStream..ctor (Java.IO.File file) [0x0007a] in <788a34f7a7b84486905dfde786529d42>:0
at SaveAndroid.SaveAndView (System.String fileName, System.String contentType, System.IO.MemoryStream stream) [0x00091] in /Users/helpdesk/Desktop/expandingList/expandingList.Android/SaveAndroid.cs:36
at expandingList.MainPage.Handle_Clicked (System.Object sender, System.EventArgs e) [0x02657] in /Users/helpdesk/Desktop/expandingList/expandingList/MainPage.xaml.cs:551
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <58604b4522f748968296166e317b04b4>:0
at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <788a34f7a7b84486905dfde786529d42>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <788a34f7a7b84486905dfde786529d42>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <788a34f7a7b84486905dfde786529d42>:0
at at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.62(intptr,intptr)
at java.io.FileNotFoundException: /storage/emulated/0/Syncfusion/x.docx (No such file or directory)
at at java.io.FileOutputStream.open0(Native Method)
at at java.io.FileOutputStream.open(FileOutputStream.java:287)
at at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
at at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at at md58432a647068b097f9637064b8985a5e0.ButtonRenderer.n_onClick(Native Method)
at at md58432a647068b097f9637064b8985a5e0.ButtonRenderer.onClick(ButtonRenderer.java:76)
at at android.view.View.performClick(View.java:6294)
at at android.view.View$PerformClick.run(View.java:24770)
at at android.os.Handler.handleCallback(Handler.java:790)
at at android.os.Handler.dispatchMessage(Handler.java:99)
at at android.os.Looper.loop(Looper.java:164)
at at android.app.ActivityThread.main(ActivityThread.java:6494)
at at java.lang.reflect.Method.invoke(Native Method)
at at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Any help on this would be greatly appreciated.
Thanks
Mason