6
我最近在项目中将MvvmCross从3.5.1更新到了4.1.4,并发布了应用更新。NotSupportedException无法激活JNI Handle - MvvmCross
之后,我从Xamarin Insights看到,有很多用户体验;
Could not activate JNI Handle 0xffb35af8 (key_handle 0xe888654) of Java type 'md53997af0c1a24144057e197743f9f827a/HomeView' as managed type 'package.name.HomeView'
几乎所有活动都有其各自的活动名称。所有这些活动都是Mvx活动。
我Setup.cs -
public class Setup : MvxAndroidSetup
{
public Setup(Context applicationContext)
: base(applicationContext)
{
}
protected override IMvxApplication CreateApp()
{
return new MVVM.App();
}
protected override IMvxTrace CreateDebugTrace()
{
return new MvxDebugTrace();
}
protected override MvvmCross.Droid.Views.IMvxAndroidViewPresenter CreateViewPresenter()
{
var presenter = new MyViewPresenter();
Mvx.RegisterSingleton<IMvxViewPresenter>(presenter);
return presenter;
}
protected override void FillTargetFactories(MvvmCross.Binding.Bindings.Target.Construction.IMvxTargetBindingFactoryRegistry registry)
{
registry.RegisterCustomBindingFactory<View>(
"ShowMe",
v => new ViewScalingCustomBinding(v));
registry.RegisterCustomBindingFactory<View>(
"ScaleMe",
v => new ViewSizingCustomBinding(v));
registry.RegisterCustomBindingFactory<View>(
"CustomFont",
v => new FontCustomBinding(v));
registry.RegisterCustomBindingFactory<View>(
"OtherCustomFont",
v => new FontDincCustomBinding(v));
registry.RegisterCustomBindingFactory<View>(
"ImageResize",
v => new ImageResizeCustomBinding(v));
base.FillTargetFactories(registry);
}
protected override IMvxPluginConfiguration GetPluginConfiguration(Type plugin)
{
if (plugin == typeof(MvvmCross.Plugins.DownloadCache.Droid.Plugin))
{
return new MvvmCross.Plugins.DownloadCache.Droid.MvxDownloadCacheConfiguration()
{
CacheName = "Pictures.MvvmCross",
CacheFolderPath = "../Library/Caches/Pictures.MvvmCross/",
MaxFiles = 500,
MaxFileAge = TimeSpan.FromDays(1),
MaxInMemoryBytes = 4000000, // 4 MB
MaxInMemoryFiles = 1,
MaxConcurrentDownloads = 10,
DisposeOnRemoveFromCache = false
};
}
return null;
}
}
什么可能会造成这个问题?
你可以展示其中的一个Activites吗?也许你的Setup.cs?不止4件事情发生了变化,所以也许活动头文件有问题。 – Cyriac
除了命名空间和命名空间相关的东西,我没有改变Setup.cs中的任何东西,但我可以将它添加到问题中。除了标签和屏幕方向外,活动标题还没有任何特定内容。 –
它只出现在一些用户,你自己没有这个问题? – Cyriac