Bug 28565 - ClassNotFoundException when instantiating LayerDrawable
Summary: ClassNotFoundException when instantiating LayerDrawable
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.20.0
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: 6.0 (C6)
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-03-30 16:32 UTC by Nate Cook
Modified: 2015-05-18 18:11 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project demonstrating the exception (1.67 MB, application/zip)
2015-03-30 16:32 UTC, Nate Cook
Details
screenshot of the exception (152.95 KB, image/png)
2015-03-30 16:32 UTC, Nate Cook
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Nate Cook 2015-03-30 16:32:00 UTC
Created attachment 10568 [details]
Sample project demonstrating the exception

We're getting an exception when we instantiate LayerDrawable. It appears the exception is handled in some fashion because app execution continues after the exception. However it is disruptive when debugging with the catch all System.Exception breakpoint set. Attached is a sample project along with a screenshot. If you run the project with the System.Exception breakpoint set you should see the exception right away. The code in question is as follows:

            Drawable[] drawables = new Drawable[]
                {
                    this.Resources.GetDrawable(Resource.Drawable.earth),
                    this.Resources.GetDrawable(Resource.Drawable.jupiter),
                };            

            // exception happens here:
            LayerDrawable layerDrawable = new LayerDrawable(drawables);

=============================================================
Xamarin Studio
Version 5.8.1 (build 8)
Installation UUID: 7ce5ffa9-646f-4545-9e71-8a00bb46f696
Runtime:
	Mono 3.12.1 ((detached/b63df7d)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010002

Apple Developer Tools
Xcode 6.2 (6776)
Build 6C131e

Xamarin.iOS
Version: 8.8.1.9 (Business Edition)
Hash: 7e1f69e
Branch: 
Build date: 2015-03-12 15:35:49-0400

Xamarin.Android
Version: 4.20.1.0 (Business Edition)
Android SDK: /Users/ncook/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

Xamarin Android Player
Version: Unknown version
Location: /Applications/Xamarin Android Player.app

Xamarin.Mac
Not Installed

Build Information
Release ID: 508010008
Git revision: f8e52bf493869b6a320a95400553dc9ea8b7ef22
Build date: 2015-03-13 16:16:49-04
Xamarin addins: 84d611cc17567a68daad719327e90af06d2ae327

Operating System
Mac OS X 10.10.2
Darwin NateCook-Insightly-MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0
    Thu Feb 26 19:26:47 PST 2015
    root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64
Comment 1 Nate Cook 2015-03-30 16:32:40 UTC
Created attachment 10569 [details]
screenshot of the exception
Comment 2 Nate Cook 2015-03-30 16:33:24 UTC
I forgot to post the details of the exception. Here it is:

Didn't find class "android.graphics.drawables.Drawable" on path: DexPathList[[zip file "/data/app/NavigationDrawer.NavigationDrawer-2.apk"],nativeLibraryDirectories=[/data/app-lib/NavigationDrawer.NavigationDrawer-2, /system/lib]]
Comment 3 Jonathan Pryor 2015-03-30 17:26:39 UTC
> It appears the exception is handled in some fashion because app
> execution continues after the exception. 

That is correct: it's a handled exception.
Comment 4 Nate Cook 2015-03-30 17:29:12 UTC
It's a duplicate of https://bugzilla.xamarin.com/show_bug.cgi?id=9615 then?
Comment 5 Jonathan Pryor 2015-03-30 17:42:13 UTC
> It's a duplicate of Bug #9615?

Not exactly. Bug #9615 would allow *you* to tell the IDE to ignore the exceptions internally generated by Xamarin.Android.

Alternatively, we could (with a fair amount of work) remove the need for those exceptions in the first place. (Which is something I'd like to do, but the timeframe is unknown.)
Comment 6 Nate Cook 2015-03-30 18:40:14 UTC
Allowing us to tell the IDE to ignore sounds good.
Comment 7 Jonathan Pryor 2015-04-22 18:02:50 UTC
The exception should be fixed by monodroid/e69b76e2.