用户在Play商店更新后,Xamarin.Android应用程序崩溃

时间:2017-09-28 20:52:00

标签: c# android xamarin xamarin.android crash

this question类似

我找到的解决方法是卸载并重新安装该应用。 但是,可能很难说服游戏商店的用户这样做,因为他们可能在下载之前没有读取更新更改日志。 (例如自动更新)。

我将原因缩小到:

09-28 21:41:26.011: I/MonoDroid(6923): UNHANDLED EXCEPTION:
09-28 21:41:26.047: I/MonoDroid(6923): Java.Lang.RuntimeException: Binary XML file line #1: Error inflating class android.widget.ImageButton ---> Java.Lang.Exception: Exception of type 'Java.Lang.Exception' was thrown. ---> Java.Lang.RuntimeException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f010127 a=-1}
09-28 21:41:26.047: I/MonoDroid(6923):    --- End of inner exception stack trace ---
09-28 21:41:26.047: I/MonoDroid(6923):    --- End of inner exception stack trace ---
09-28 21:41:26.047: I/MonoDroid(6923):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9ab6e5aa0dab475cab5597fa4269890c>:0 
09-28 21:41:26.047: I/MonoDroid(6923):   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <5e50b69e5a0e439f924bf0f2e8fcd52c>:0 
09-28 21:41:26.047: I/MonoDroid(6923):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <5e50b69e5a0e439f924bf0f2e8fcd52c>:0 
09-28 21:41:26.047: I/MonoDroid(6923):   at Android.App.Activity.SetContentView (System.Int32 layoutResID) [0x00022] in <f051fcdec18c4806998a5576ba788eec>:0 
09-28 21:41:26.047: I/MonoDroid(6923):   at mypackagename.MainActivity+<OnCreate>d__33.MoveNext () [0x0004d] in <467e37befb3d49c788d8cebf5dfb11a2>:0 
09-28 21:41:26.047: I/MonoDroid(6923): --- End of stack trace from previous location where exception was thrown ---
09-28 21:41:26.047: I/MonoDroid(6923):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9ab6e5aa0dab475cab5597fa4269890c>:0 
09-28 21:41:26.047: I/MonoDroid(6923):   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <9ab6e5aa0dab475cab5597fa4269890c>:0 
09-28 21:41:26.047: I/MonoDroid(6923):   at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <f051fcdec18c4806998a5576ba788eec>:0 
09-28 21:41:26.047: I/MonoDroid(6923):   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <f051fcdec18c4806998a5576ba788eec>:0 
09-28 21:41:26.047: I/MonoDroid(6923):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <f051fcdec18c4806998a5576ba788eec>:0 
09-28 21:41:26.047: I/MonoDroid(6923):   at (wrapper dynamic-method) System.Object:471f272e-f7ed-4fdc-805d-59ce5a399fd4 (intptr,intptr)
09-28 21:41:26.047: I/MonoDroid(6923):   --- End of managed Java.Lang.RuntimeException stack trace ---
09-28 21:41:26.047: I/MonoDroid(6923): android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.ImageButton

Old apk是在VS Community 2015.3上使用Xamarin.VisualStudio_4.5.0.486构建的 新的apk是在VS Community 2017上使用Xamarin.VisualStudio_4.6.3.4构建的 这两个apk都针对Nougat 7.0,最小ICS 4.0.3

我的axml布局文件没有任何变化。这也很明显,因为重新安装后,ImageButton会毫无问题地膨胀。

如何解决此问题?

0 个答案:

没有答案