从Google Play商店下载后,Android应用立即崩溃

时间:2019-09-04 14:32:02

标签: visual-studio xamarin xamarin.android freshmvvm

我创建了一个Android应用程序,当我在Android手机上的Visual Studio 2019中对其进行调试时,该应用程序运行良好。 但是,当我将其发布到Google Store并下载并在同一部手机上运行时,它立即崩溃了。

堆栈跟踪为:

android.runtime.JavaProxyThrowable: at FreshTinyIoC.FreshTinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) <0x7e57beb580 + 0x006f0> in <035575fde1c44c4eaa00de78a4f3093f>:0
at FreshTinyIoC.FreshTinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) <0x7e57be9354 + 0x00053> in <035575fde1c44c4eaa00de78a4f3093f>:0
at FreshTinyIoC.FreshTinyIoCContainer.ResolveInternal (FreshTinyIoC.FreshTinyIoCContainer+TypeRegistration registration, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) <0x7e57beade0 + 0x006ff> in <035575fde1c44c4eaa00de78a4f3093f>:0
at FreshTinyIoC.FreshTinyIoCContainer.Resolve (System.Type resolveType) <0x7e57be85d4 + 0x00083> in <035575fde1c44c4eaa00de78a4f3093f>:0
at FreshTinyIoC.FreshTinyIoCContainer.Resolve[ResolveType] () <0x7e57be8668 + 0x0003b> in <035575fde1c44c4eaa00de78a4f3093f>:0
at FreshMvvm.FreshTinyIOCBuiltIn.Resolve[ResolveType] () <0x7e57b810c0 + 0x00047> in <d2b205c381d14059b4260d7482e68c02>:0
at FreshMvvm.FreshPageModelResolver.ResolvePageModel[T] (System.Object initData) <0x7e57b80c90 + 0x00057> in <d2b205c381d14059b4260d7482e68c02>:0
at FreshMvvm.FreshPageModelResolver.ResolvePageModel[T] () <0x7e57b80c54 + 0x00033> in <d2b205c381d14059b4260d7482e68c02>:0
at GoTexas.App.InitNavigation () <0x7e57b426f4 + 0x00037> in <dd7679dd949e46e680e37995753481d2>:0
at GoTexas.App..ctor () <0x7e57b42600 + 0x0009f> in <dd7679dd949e46e680e37995753481d2>:0
at GoTexas.Droid.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) <0x7e54f0b75c + 0x0010f> in <a02812a7c00f4c1c87e549cce19fa824>:0
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) <0x7e598ad064 + 0x0007b> in <899f47c5cea3409e92f041348b58600b>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.7(intptr,intptr,intptr)
  at md5b9bd3a38d4378f5ce9f0aa132dfd154f.MainActivity.n_onCreate (Native Method)
  at md5b9bd3a38d4378f5ce9f0aa132dfd154f.MainActivity.onCreate (30)
  at android.app.Activity.performCreate (Activity.java:7327)
  at android.app.Activity.performCreate (Activity.java:7318)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1271)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3094)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3257)
  at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:78)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:68)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1948)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7050)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:964)

因此它与FreshTinyIoC有关。我只是不明白为什么在手机上以调试模式运行VS 2019时,这种方法行得通。

任何想法都将不胜感激。

1 个答案:

答案 0 :(得分:2)

问题很简单,实际上您已经设置了链接到SDK和用户程序集的链接,这意味着它将链接所有内容,您的模型和所有其他类,所有没有引用的内容都将被收集并删除,以便更好地了解您可以检查我的博客中有关于如何使用链接的完整部分:

https://heartbeat.fritz.ai/reducing-the-app-size-in-xamarin-deep-dive-7ddc9cb12688

到目前为止,我建议您暂时检查Link SDK Assemblies,然后再链接所有内容,因为这需要一些时间

Goodluck,如有查询,请随时回来