我在恢复monodroid mvvmcross应用程序时遇到了一些麻烦:每当应用程序进入后台并停止它无法恢复时。 这是logcat,但有例外:
I/ActivityManager( 389): Start proc com.tasteitandroidclient for activity com.t
asteitandroidclient/tasteitandroidclient.MyProfilePage: pid=30611 uid=10066 gids
={50066, 3003, 1006, 1015, 1028}
D/Zygote ( 129): Process 30596 exited cleanly (1)
D/dalvikvm( 129): GC_EXPLICIT freed 41K, 1% free 8825K/8896K, paused 2ms+2ms, t
otal 23ms
D/dalvikvm( 129): GC_EXPLICIT freed <1K, 1% free 8825K/8896K, paused 1ms+3ms, t
otal 18ms
D/dalvikvm( 129): GC_EXPLICIT freed <1K, 1% free 8825K/8896K, paused 2ms+2ms, t
otal 18ms
I/ActivityThread(30611): Pub com.tasteitandroidclient.mono.MonoRuntimeProvider._
_mono_init__: mono.MonoRuntimeProvider
D/dalvikvm(30611): Trying to load lib /data/app-lib/com.tasteitandroidclient-2/l
ibmonodroid.so 0x424a0288
D/dalvikvm(30611): Added shared lib /data/app-lib/com.tasteitandroidclient-2/lib
monodroid.so 0x424a0288
W/libc (30611): WARNING: generic atexit() called from legacy shared library
W/monodroid-gc(30611): GREF GC Threshold: 46800
I/mvx (30611): 0.02 Setup: PlatformServices start
I/mono-stdout(30611): mvx:Diagnostic: 0.02 Setup: PlatformServices start
I/mvx (30611): 0.16 Setup: MvvmCross settings start
I/mono-stdout(30611): mvx:Diagnostic: 0.16 Setup: MvvmCross settings start
I/mvx (30611): 0.16 Setup: Singleton Cache start
I/mono-stdout(30611): mvx:Diagnostic: 0.16 Setup: Singleton Cache start
I/mvx (30611): 0.17 Setup: Bootstrap actions
I/mono-stdout(30611): mvx:Diagnostic: 0.17 Setup: Bootstrap actions
I/mvx (30611): 0.25 Setup: StringToTypeParser start
I/mono-stdout(30611): mvx:Diagnostic: 0.25 Setup: StringToTypeParser start
I/mvx (30611): 0.26 Setup: ViewModelFramework start
I/mono-stdout(30611): mvx:Diagnostic: 0.26 Setup: ViewModelFramework start
I/mvx (30611): 0.26 Setup: PluginManagerFramework start
I/mono-stdout(30611): mvx:Diagnostic: 0.26 Setup: PluginManagerFramework start
I/mvx (30611): 0.27 Ensuring Plugin is loaded for Cirrious.MvvmCross.Plugi
ns.DownloadCache.PluginLoader
I/mono-stdout(30611): mvx:Diagnostic: 0.27 Ensuring Plugin is loaded for Cirrio
us.MvvmCross.Plugins.DownloadCache.PluginLoader
I/mvx (30611): 0.28 Loading plugin assembly: Cirrious.MvvmCross.Plugins.Do
wnloadCache.Droid.dll
I/mono-stdout(30611): mvx:Diagnostic: 0.28 Loading plugin assembly: Cirrious.Mv
vmCross.Plugins.DownloadCache.Droid.dll
I/mvx (30611): 0.29 Ensuring Plugin is loaded for Cirrious.MvvmCross.Plugi
ns.File.PluginLoader
I/mono-stdout(30611): mvx:Diagnostic: 0.29 Ensuring Plugin is loaded for Cirrio
us.MvvmCross.Plugins.File.PluginLoader
I/mvx (30611): 0.29 Loading plugin assembly: Cirrious.MvvmCross.Plugins.Fi
le.Droid.dll
I/mono-stdout(30611): mvx:Diagnostic: 0.29 Loading plugin assembly: Cirrious.Mv
vmCross.Plugins.File.Droid.dll
I/mvx (30611): 0.30 Ensuring Plugin is loaded for Cirrious.MvvmCross.Plugi
ns.PictureChooser.PluginLoader
I/mono-stdout(30611): mvx:Diagnostic: 0.30 Ensuring Plugin is loaded for Cirrio
us.MvvmCross.Plugins.PictureChooser.PluginLoader
I/mvx (30611): 0.30 Loading plugin assembly: Cirrious.MvvmCross.Plugins.Pi
ctureChooser.Droid.dll
I/mono-stdout(30611): mvx:Diagnostic: 0.30 Loading plugin assembly: Cirrious.Mv
vmCross.Plugins.PictureChooser.Droid.dll
I/mvx (30611): 0.30 Setup: App start
I/mono-stdout(30611): mvx:Diagnostic: 0.30 Setup: App start
I/mvx (30611): 0.43 Setup: ViewModelTypeFinder start
I/mono-stdout(30611): mvx:Diagnostic: 0.43 Setup: ViewModelTypeFinder start
I/mvx (30611): 0.45 Setup: ViewsContainer start
I/mono-stdout(30611): mvx:Diagnostic: 0.45 Setup: ViewsContainer start
I/mvx (30611): 0.45 Setup: ViewDispatcher start
I/mono-stdout(30611): mvx:Diagnostic: 0.45 Setup: ViewDispatcher start
I/mvx (30611): 0.46 Setup: Views start
I/mono-stdout(30611): mvx:Diagnostic: 0.46 Setup: Views start
I/mvx (30611): 0.51 Setup: CommandCollectionBuilder start
I/mono-stdout(30611): mvx:Diagnostic: 0.51 Setup: CommandCollectionBuilder star
t
I/mvx (30611): 0.51 Setup: NavigationSerializer start
I/mono-stdout(30611): mvx:Diagnostic: 0.51 Setup: NavigationSerializer start
I/mvx (30611): 0.53 Setup: InpcInterception start
I/mono-stdout(30611): mvx:Diagnostic: 0.53 Setup: InpcInterception start
I/mvx (30611): 0.53 Setup: LastChance start
I/mono-stdout(30611): mvx:Diagnostic: 0.53 Setup: LastChance start
I/MvxBind (30611): 0.56 Missing stylable field MvxControl
I/mono-stdout(30611): MvxBind:Error: 0.56 Missing stylable field MvxControl
I/MvxBind (30611): 0.56 Missing stylable field MvxControl_MvxTemplate
I/mono-stdout(30611): MvxBind:Error: 0.56 Missing stylable field MvxControl_Mvx
Template
I/mvx (30611): 1.32 Setup: Secondary end
I/mono-stdout(30611): mvx:Diagnostic: 1.32 Setup: Secondary end
I/mvx (30611): 1.36 Attempting to load new ViewModel from Intent with Extr
as
I/mono-stdout(30611): mvx:Diagnostic: 1.36 Attempting to load new ViewModel fro
m Intent with Extras
I/mvx (30611): 1.85 Problem initialising viewModel of type UserPageViewMod
el - problem TargetInvocationException: Exception has been thrown by the target
of an invocation.
I/mvx (30611): at System.Reflection.MonoMethod.Invoke (System.Object
obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] p
arameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unkn
own>:0
I/mvx (30611): at System.Reflection.MethodBase.Invoke (System.Object obj,
System.Object[] parameters) [0x00000] in <filename unknown>:0
I/mvx (30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelExtensions.Cal
lBundleMethod (IMvxViewModel viewModel, System.Reflection.MethodInfo methodInfo,
IMvxBundle bundle) [0x00000] in <filename unknown>:0
I/mvx (30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelExtensions.Cal
lBundleMethods (IMvxViewModel viewModel, System.String methodName, IMvxBundle bu
ndle) [0x00000] in <filename unknown>:0
I/mvx (30611): at Cirrious.MvvmCross.ViewModels.MvxDefaultViewModelLocator
.CallCustomInitMethods (IMvxViewModel viewModel, IMvxBundle parameterValues) [0x
00000] in <filename unknown>:0
I/mvx (30611): at Cirrious.MvvmCross.ViewModels.MvxDefaultViewModelLocator
.TryLoad (System.Type viewModelType, IMvxBundle parameterValues, IMvxBundle save
dState, IMvxViewModel& viewModel) [0x00000] in <filename unknown>:0
I/mvx (30611): InnerException was NullReferenceException: Object reference n
ot set to an instance of an object
I/mvx (30611): at TasteITAndroidClient.UserPageViewModel.InitFromBund
le (IMvxBundle parameters) [0x00000] in <filename unknown>:0
I/mvx (30611): at Cirrious.MvvmCross.ViewModels.MvxViewModel.Init (IMvxBun
dle parameters) [0x00000] in <filename unknown>:0
I/mvx (30611): at (wrapper managed-to-native) System.Reflection.MonoMethod
:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
I/mvx (30611): at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parame
ters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:
0
I/mono-stdout(30611): mvx:Warning: 1.85 Problem initialising viewModel of type
UserPageViewModel - problem TargetInvocationException: Exception has been thrown
by the target of an invocation.
I/mono-stdout(30611): at System.Reflection.MonoMethod.Invoke (System.Object
obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] p
arameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unkn
own>:0
I/mono-stdout(30611): at System.Reflection.MethodBase.Invoke (System.Object ob
j, System.Object[] parameters) [0x00000] in <filename unknown>:0
I/mono-stdout(30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelExtensions.
CallBundleMethod (IMvxViewModel viewModel, System.Reflection.MethodInfo methodIn
fo, IMvxBundle bundle) [0x00000] in <filename unknown>:0
I/mono-stdout(30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelExtensions.
CallBundleMethods (IMvxViewModel viewModel, System.String methodName, IMvxBundle
bundle) [0x00000] in <filename unknown>:0
I/mono-stdout(30611): at Cirrious.MvvmCross.ViewModels.MvxDefaultViewModelLoca
tor.CallCustomInitMethods (IMvxViewModel viewModel, IMvxBundle parameterValues)
[0x00000] in <filename unknown>:0
I/mono-stdout(30611): at Cirrious.MvvmCross.ViewModels.MvxDefaultViewModelLoca
tor.TryLoad (System.Type viewModelType, IMvxBundle parameterValues, IMvxBundle s
avedState, IMvxViewModel& viewModel) [0x00000] in <filename unknown>:0
I/mono-stdout(30611): InnerException was NullReferenceException: Object referenc
e not set to an instance of an object
I/mono-stdout(30611): at TasteITAndroidClient.UserPageViewModel.InitFromBund
le (IMvxBundle parameters) [0x00000] in <filename unknown>:0
I/mono-stdout(30611): at Cirrious.MvvmCross.ViewModels.MvxViewModel.Init (IMvx
Bundle parameters) [0x00000] in <filename unknown>:0
I/mono-stdout(30611): at (wrapper managed-to-native) System.Reflection.MonoMet
hod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exceptio
n&)
I/mono-stdout(30611): at System.Reflection.MonoMethod.Invoke (System.Object ob
j, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] par
ameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknow
n>:0
I/MonoDroid(30611): UNHANDLED EXCEPTION: Cirrious.CrossCore.Exceptions.MvxExcept
ion: Failed to construct and initialize ViewModel for type TasteITAndroidClient.
UserPageViewModel from locator MvxDefaultViewModelLocator - check MvxTrace for m
ore information
I/MonoDroid(30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadView
Model (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest,Cirrious.MvvmCross.View
Models.IMvxBundle,Cirrious.MvvmCross.ViewModels.IMvxViewModelLocator) <0x00104>
I/MonoDroid(30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadView
Model (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest,Cirrious.MvvmCross.View
Models.IMvxBundle) <0x0008b>
I/MonoDroid(30611): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewsContainer.V
iewModelFromRequest (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest,Cirrious.
MvvmCross.ViewModels.IMvxBundle) <0x0003b>
I/MonoDroid(30611): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewsContainer.C
reateViewModelFromIntent (Android.Content.Intent,Cirrious.MvvmCross.ViewModels.I
MvxBundle) <0x000cf>
I/MonoDroid(30611): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewsContainer.L
oad (Android.Content.Intent,Cirrious.MvvmCross.ViewModels.IMvxBundle,System.Type
) <0x001eb>
I/MonoDroid(30611): at Cirrious.MvvmCross.Droid.Views.MvxActivityViewExtensions.
LoadViewModel (Cirrious.MvvmCross.Droid.Views.IMvxAndroidView,Cirrious.MvvmCross
.ViewModels.IMvxBundle) <0x00163>
I/MonoDroid(30611): at Cirrious.MvvmCross.Droid.Views.MvxActivityViewExtensions/
<>c__DisplayClass3.<OnViewCreate>b__1 () <0x0002b>
I/MonoDroid(30611): at Cirrious.MvvmCross.Views.MvxViewExtensionMethods.OnViewCr
eate (Cirrious.MvvmCross.Views.IMvxView,System.Func`1<Cirrious.MvvmCross.ViewMod
els.IMvxViewModel>) <0x00073>
I/MonoDroid(30611): at Cirrious.MvvmCross.Droid.Views.MvxActivityViewExtensions.
OnViewCreate (Cirrious.MvvmCross.Droid.Views.IMvxAndroidView,Android.OS.Bundle)
<0x001a7>
I/MonoDroid(30611): at Cirrious.MvvmCross.Droid.Views.MvxActivityAdapter.EventSo
urceOnCreateCalled (object,Cirrious.CrossCore.Core.MvxValueEventArgs`1<Android.O
S.Bundle>) <0x0002b>
I/MonoDroid(30611): at (wrapper delegate-invoke) System.EventHandler`1<Cirrious.
CrossCore.Core.MvxValueEventArgs`1<Android.OS.Bundle>>.invoke_void__this___objec
t_TEventArgs (object,Cirrious.CrossCore.Core.MvxValueEventArgs`1<Android.OS.Bund
le>) <0x000ab>
I/MonoDroid(30611): at Cirrious.CrossCore.Core.MvxDelegateExtensionMethods.Raise
<Android.OS.Bundle> (System.EventHandler`1<Cirrious.CrossCore.Core.MvxValueEvent
Args`1<Android.OS.Bundle>>,object,Android.OS.Bundle) <0x00063>
I/MonoDroid(30611): at Cirrious.CrossCore.Droid.Views.MvxEventSourceActivity.OnC
reate (Android.OS.Bundle) <0x00047>
I/MonoDroid(30611): at TasteITAndroidClient.BaseActivity`1<TasteITAndroidClient.
UserPageViewModel>.OnCreate (Android.OS.Bundle) <0x0001b>
I/MonoDroid(30611): at TasteITAndroidClient.RecomendationFloatingMenuDisplayActi
vity`1<TasteITAndroidClient.UserPageViewModel>.OnCreate (Android.OS.Bundle) <0x0
001b>
I/MonoDroid(30611): at TasteITAndroidClient.MyProfilePage.OnCreate (Android.OS.B
undle) <0x0001b>
I/MonoDroid(30611): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intp
tr,intptr,intptr) <0x0005b>
I/MonoDroid(30611): at (wrapper dynamic-method) object.b0555ae5-9a73-4bdf-a346-3
59d6ab94c3d (intptr,intptr,intptr) <0x00043>
D/dalvikvm(30611): GC_CONCURRENT freed 200K, 3% free 9016K/9248K, paused 3ms+2ms
, total 17ms
E/mono (30611):
E/mono (30611): Unhandled Exception:
E/mono (30611): Cirrious.CrossCore.Exceptions.MvxException: Failed to constru
ct and initialize ViewModel for type TasteITAndroidClient.UserPageViewModel from
locator MvxDefaultViewModelLocator - check MvxTrace for more information
E/mono (30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadVie
wModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request, IMvxBundle sa
vedState, IMvxViewModelLocator viewModelLocator) [0x00000] in <filename unknown>
:0
E/mono (30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadVie
wModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request, IMvxBundle sa
vedState) [0x00000] in <filename unknown>:0
E/mono (30611): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewsContainer.
ViewModelFromRequest (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest viewMode
lRequest, IMvxBundle savedState) [0x00000] in <filename unknown>:0
E/mono (30611): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewsContainer.
CreateViewModelFromIntent (Android.Content.Intent intent, IMvxBundle savedState)
[0x00000] in <filename u
E/mono-rt (30611): [ERROR] FATAL UNHANDLED EXCEPTION: Cirrious.CrossCore.Excepti
ons.MvxException: Failed to construct and initialize ViewModel for type TasteITA
ndroidClient.UserPageViewModel from locator MvxDefaultViewModelLocator - check M
vxTrace for more information
E/mono-rt (30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadVie
wModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request, IMvxBundle sa
vedState, IMvxViewModelLocator viewModelLocator) [0x00000] in <filename unknown>
:0
E/mono-rt (30611): at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadVie
wModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request, IMvxBundle sa
vedState) [0x00000] in <filename unknown>:0
E/mono-rt (30611): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewsContainer.
ViewModelFromRequest (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest viewMode
lRequest, IMvxBundle savedState) [0x00000] in <filename unknown>:0
E/mono-rt (30611): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewsContainer.
CreateViewModelFromIntent (Android.Content.Intent intent, IMvxBundle savedState)
[0x00000] i
I/ActivityManager( 389): Process com.tasteitandroidclient (pid 30611) has died.
我很难理解问题是什么......它发生在每一项活动上。
任何想法?
答案 0 :(得分:0)
跟踪在创建UserPageViewModel时显示未处理的异常
它进一步显示“InnerException是NullReferenceException:Object referenc e未设置为对象的实例 I / mono-stdout(30611):at TasteITAndroidClient.UserPageViewModel.InitFromBundle(IMvxBundle parameters)[0x00000]“
如果向UserPageViewModel构造函数和Init方法添加更多跟踪,那么这可能有助于解决问题所在。