MVVMCross在SetContentView()上发生Android 10.0(Q)MainActivity异常崩溃 [英] MVVMCross Android 10.0 (Q) MainActivity exception crash on SetContentView()

查看:77
本文介绍了MVVMCross在SetContentView()上发生Android 10.0(Q)MainActivity异常崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在帮助的大型项目之一使用MvvmCross v5.2.1. 当我们以Android 10.0(API级别29)(Q)框架为目标时,一旦MainActivityOnCreate()生命周期功能运行,就会在SetContentView(Resource.Layout.activity_main)行上发生异常崩溃.

One of the massive projects I am helping with, uses MvvmCross v5.2.1. When we target the framework Android 10.0 (API Level 29) (Q), as soon as the OnCreate() lifecycle function of the MainActivity runs, an exception crash happens on the line SetContentView(Resource.Layout.activity_main).

部分异常读取

java.lang.NoSuchFieldException: No field mConstructorArgs in class Landroid/view/LayoutInflater; (declaration of 'android.view.LayoutInflater' appears in /system/framework/framework.jar!classes3.dex)
    at java.lang.Class.getDeclaredField(Native Method)
    at mvvmcross.binding.droid.views.MvxLayoutInflater_PrivateFactoryWrapper2.n_onCreateView(Native Method)
    at mvvmcross.binding.droid.views.MvxLayoutInflater_PrivateFactoryWrapper2.onCreateView(MvxLayoutInflater_PrivateFactoryWrapper2.java:32)
    at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:239)
    at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1069)

有关此 pastebin 的详细日志.

这似乎与 MvvmCross回购上的Github问题相同: 此拉取请求的链接.

It seems identical to this Github issue on the MvvmCross repo: and I followed the links to this pull request.

这是否意味着在v6.4.1之前使用#MVVMCross的任何人是否必须针对Android 10.0框架进行升级? 有什么解决办法吗?

Does that mean any one using #MVVMCross before v6.4.1, must upgrade if they want to target the framework Android 10.0? Is there any work around?

推荐答案

我在Twitter上向MVVMCross框架的创建者和维护者提出了这个问题,正如您在

I asked the question to the creators and maintainers of the MVVMCross framework on Twitter, as you can see in this thread. I got the following response:

您需要6.4.1.可能没有已知的解决方法,除非复制所有 修复该布局膨胀问题的必要代码.

You need 6.4.1. No known workarounds maybe except for copying all the necessary code to fix that layout inflater issue.

这意味着针对Android 10.0及更高版本框架的唯一解决方案是更新到软件包版本6.4.1或更高版本.这是一个非常困难的过程,因为除其他外,它还需要将解决方案更新为.NET Core 2.0 Framework.

This means that the only solution to target the framework Android 10.0 and above is to update to package version 6.4.1 or up. It is a very difficult process, since among other things, it also requires updating the Solution to .NET Core 2.0 Framework.

那是什么意思?截至2019年,Android Play商店仅接受针对框架8.1的APK文件.因此,在1.5年内,当您还需要更新nuget软件包时,他们会将要求更改为Android 10.0.

What does that mean? As of 2019, the Android Play Store only accepts APK files that are targeting framework 8.1. So within 1.5 years, they will change the requirement to Android 10.0, by when you will need to update your nuget package as well.

这篇关于MVVMCross在SetContentView()上发生Android 10.0(Q)MainActivity异常崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆