[Mono-bugs] [Bug 641895] New: Java callable classes in libraries cannot be resolved at runtime

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Sep 25 08:37:21 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=641895

https://bugzilla.novell.com/show_bug.cgi?id=641895#c0


           Summary: Java callable classes in libraries cannot be resolved
                    at runtime
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Tools
        AssignedTo: mkestner at novell.com
        ReportedBy: chris at foundation42.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3

I'm trying to build a set of components that I intend to use in a number of
applications.  The cleanest way to do this is to put them in a MonoDroid class
library.

While this works fine for pure .Net types, there seems to be an issue placing
Java callable types in the DLL.

This is just a guess, but perhaps during the build, you need to recurse into
dependent library projects and generate thunks/wrappers for those as well? 
Maybe they are getting generated but somehow need to be merged into the main
app.

I'm not entirely clear on the whole proxy generation process yet, so it is
possible I may just have done something wrong.

Reproducible: Always

Steps to Reproduce:
1. Create a new solution with the MonoDroid application project template
2. Add a new MonoDroid class library to the solution
3. Add a MonoDroid view to the class library
4. Set your Activity to use the view from the class library
Actual Results:  
You get a runtime exception..

Java.Lang.NoClassDefFoundError: Exception of type
'Java.Lang.NoClassDefFoundError' was thrown.
  at Android.Runtime.JNIEnv.FindClass (System.String classname) [0x00000] in
<filename unknown>:0 
  at Android.Runtime.JNIEnv.FindClass (System.Type type) [0x00000] in <filename
unknown>:0 
  at Android.Views.View..ctor (Android.Content.Context context, IAttributeSet
attrs) [0x00000] in <filename unknown>:0 
  at ThunkBugLib.ThunkBugView..ctor (Android.Content.Context context,
IAttributeSet attrs) [0x00000] in <filename unknown>:0 
  at ThunkBug.Activity1.OnCreate (Android.OS.Bundle bundle) [0x00000] in
<filename unknown>:0 
  at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr
native__this, IntPtr native_savedInstanceState) [0x00000] in <filename
unknown>:0 
Shutting down VM


Expected Results:  
It should be possible to create Java callable objects in a DLL and have them
consumed from outside the DLL.

This isn't limited to just views.  I tried it with other types that derive from
Java.Lang.Object and have the same issue.

I know it's probably a pain to implement, but it'd be appreciated as I think
this is a fairly common case for any kind of serious project.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list