xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] Application crash when image binded to non existent image file #6703

Open ish-1313 opened 5 years ago

ish-1313 commented 5 years ago

Description

when Image control receive non-existent file from binded property application crashes with "Android.Content.Res.Resources+NotFoundException: Resource ID #0xe"

in android device log Time Device Name Type PID Tag Message 06-28 17:41:41.758 Samsung SM-G935F Info 2205 zygote64 Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.xxx.xxx-94stF_iYmK8U6EIKqZ8sew==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxx-94stF_iYmK8U6EIKqZ8sew==/lib/arm64, /data/app/com.xxx.xxx-94stF_iYmK8U6EIKqZ8sew==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]] at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93) at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379) at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203) at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637) at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518) at void android.support.v7.app.AppCompatDelegateImpl.initWindowDecorActionBar() (AppCompatDelegateImpl.java:319) at android.support.v7.app.ActionBar android.support.v7.app.AppCompatDelegateImpl.getSupportActionBar() (AppCompatDelegateImpl.java:306) at void android.support.v7.app.AppCompatDelegateImpl.setSupportActionBar(android.support.v7.widget.Toolbar) (AppCompatDelegateImpl.java:343) at void android.support.v7.app.AppCompatActivity.setSupportActionBar(android.support.v7.widget.Toolbar) (AppCompatActivity.java:130) at void md5ec5e85986a8f3cf16c5407a66f571da4.MainActivity.n_onCreate(android.os.Bundle) (MainActivity.java:-2) at void md5ec5e85986a8f3cf16c5407a66f571da4.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:31) at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7183) at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1220) at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2910) at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3032) at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1696) at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:105) at void android.os.Looper.loop() (Looper.java:164) at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6944) at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2) at void com.android.internal.os.Zygote$MethodAndArgsCaller.run() (Zygote.java:327) at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1374)

Steps to Reproduce

  1. bind non existent image file to image control
  2. run

Expected Behavior

show nothing or crash with some meaningful message

Actual Behavior

crashes with non meaningful message

Basic Information

Xamarin 16.1.0.545 (d16-1@db7c858e8) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.1.0.418 (remotes/origin/d16-1@5b958bb10) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.2.112 (4db4af4) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 9.3.0.23 (HEAD/d0b48056f) Xamarin.Android Reference Assemblies and MSBuild support. Mono: mono/mono/2018-08@3a07bd426d3 Java.Interop: xamarin/java.interop/d16-1@5ddc3e3 LibZipSharp: grendello/LibZipSharp/d16-1@44de300 LibZip: nih-at/libzip/rel-1-5-1@b95cf3f ProGuard: xamarin/proguard/master@905836d SQLite: xamarin/sqlite/3.27.1@8212a2d Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-1@acabd26

Xamarin.iOS and Xamarin.Mac SDK 12.10.0.157 (6bd9475) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

samhouts commented 5 years ago

@ish-1313 Can you please attach a small project that demonstrates this issue? Thanks!

ish-1313 commented 5 years ago

@ish-1313 Can you please attach a small project that demonstrates this issue? Thanks!

attached.. i removed bin & obj from android tree. build it in debug (don't tried in release. the same is with latest xforms

xformstest.zip