简体   繁体   English

Xamarin.Forms Android部署

[英]Xamarin.Forms Android Deploy

I am using Xamarin Forms and everything works fine in the emulator, but when I try to deploy to LivePLay I get errors like this. 我正在使用Xamarin Forms,并且在模拟器中一切正常,但是当我尝试将其部署到LivePLay时,会出现这样的错误。

Error       Failed to load assembly from stream: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path "/data/user/0/com.xamarin.live/files/.nuget/packages/system.security.principal.windows/4.4.0/ref/netstandard2.0/System.Security.Principal.Windows.dll".
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0017d] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
at System.IO.File.OpenRead (System.String path) [0x00000] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
at <StartupCode$Continuous-Core-Droid>.$LocalFileSystem+Upsight-IFileSystem-OpenReadAsync@49-1.Invoke () [0x00011] in <5b4cad9611b47c3aa745038396ad4c5b>:0 
at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
at System.Threading.Tasks.Task.Execute () [0x00010] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 

For these .dlls 对于这些.dll

System.Security.Principal.Windows.dll
System.Security.AccessControl.dll
SQLitePCLRaw.provider.e_sqlite3.dll
SQLitePCLRaw.lib.e_sqlite3.dll
Microsoft.Win32.Registry.dll

So far I've tried pairing two devices and gotten the same results. 到目前为止,我已经尝试将两个设备配对,并获得相同的结果。 App crashes on load if I try creating an apk and installing. 如果我尝试创建apk并安装,则应用程序在加载时崩溃。 Any idea what's going on and how to fix it? 知道发生了什么以及如何解决吗?

The problem is, that live player isn't actually a "real" android (or iOS) environment. 问题是,实时播放器实际上不是一个“真实”的android(或iOS)环境。 Similar to the Xamarin Previewer, that thing only works as long as you are doing "basic" stuff. 与Xamarin Previewer相似,只有在您执行“基本”操作时,该功能才起作用。

Once you start including Resources, use locally stored sql databases, write custom renderers, use dependency services and build views which rely on actual data, you are most likely to get dozens of exceptions. 一旦开始包含资源,使用本地存储的sql数据库,编写自定义渲染器,使用依赖项服务并构建依赖于实际数据的视图,您很可能会遇到数十种异常。

The thing is: You can spend a lot of time and effort into making your code compatible with the live player environment or you just use an emulator or a real device for debugging. 关键是:您可以花费大量时间和精力使代码与实时播放器环境兼容,或者仅使用仿真器或真实设备进行调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM