https://bugzilla.novell.com/show_bug.cgi?id=654522
https://bugzilla.novell.com/show_bug.cgi?id=654522#c0 Summary: Application Initialization Fails When ContentProvider Referenced in AndroidManifest.xml Classification: Mono Product: MonoDroid Version: unspecified Platform: All OS/Version: Windows 7 Status: NEW Severity: Major Priority: P5 - None Component: Runtime AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- Created an attachment (id=400979) --> (http://bugzilla.novell.com/attachment.cgi?id=400979) Sample application that demonstrates bug User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 When a ContentProvider is implemented in an application, initialization fails when the application is run in an emulator (F5 or Ctrl-F5). This is the case whether the //application/provider tag in the AndroidManifest.xml was generated via the ContentProviderAttribute or if it was added manually. Reproducible: Always Steps to Reproduce: 1. Create a new MonoDroid Application 2. Add a new class that inherits ContentProvider to the project 3. Implement the abstract methods for the new class 4. Decorate the class with a ContentProviderAttribute 5. Hit F5 or Ctrl-F5 to run the application in an emulator 3. Notice that it fails with an error with a force close prompt A sample application is attached that demonstrates the problem (Note that this is a stripped-down version. In the actual application, the content provider is fully implemented as ported from a working Eclipse project) Actual Results: The application fails to initialize in the emulator. The Android Device Logging window provides the following data: D/AndroidRuntime( 284): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< D/AndroidRuntime( 284): CheckJNI is ON D/AndroidRuntime( 284): --- registering native functions --- I/ActivityManager( 60): Starting activity: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.example.contentprovidersandbox/.Activity1 } D/AndroidRuntime( 284): Shutting down VM D/jdwp ( 284): adbd disconnected I/AndroidRuntime( 284): NOTE: attach of thread 'Binder Thread #3' failed I/ActivityManager( 60): Start proc com.example.contentprovidersandbox for activity com.example.contentprovidersandbox/.Activity1: pid=291 uid=10034 gids={3003} I/ARMAssembler( 60): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x2dd400:0x2dd50c] in 5584769 ns I/ActivityThread( 291): Publishing provider com.example.contentprovidersandbox.providers: com.example.contentprovidersandbox.Class1 W/dalvikvm( 291): No implementation found for native Lmono/android/Runtime;.register (Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;)V W/dalvikvm( 291): Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lcom/example/contentprovidersandbox/Class1;.<clinit> W/dalvikvm( 291): Class init failed in newInstance call (Lcom/example/contentprovidersandbox/Class1;) D/AndroidRuntime( 291): Shutting down VM W/dalvikvm( 291): threadid=1: thread exiting with uncaught exception (group=0x4001d800) E/AndroidRuntime( 291): FATAL EXCEPTION: main E/AndroidRuntime( 291): java.lang.ExceptionInInitializerError E/AndroidRuntime( 291): at java.lang.Class.newInstanceImpl(Native Method) E/AndroidRuntime( 291): at java.lang.Class.newInstance(Class.java:1429) E/AndroidRuntime( 291): at android.app.ActivityThread.installProvider(ActivityThread.java:4494) E/AndroidRuntime( 291): at android.app.ActivityThread.installContentProviders(ActivityThread.java:4281) E/AndroidRuntime( 291): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4237) E/AndroidRuntime( 291): at android.app.ActivityThread.access$3000(ActivityThread.java:125) E/AndroidRuntime( 291): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071) E/AndroidRuntime( 291): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 291): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 291): at android.app.ActivityThread.main(ActivityThread.java:4627) E/AndroidRuntime( 291): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 291): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 291): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) E/AndroidRuntime( 291): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) E/AndroidRuntime( 291): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 291): Caused by: java.lang.UnsatisfiedLinkError: register E/AndroidRuntime( 291): at mono.android.Runtime.register(Native Method) E/AndroidRuntime( 291): at com.example.contentprovidersandbox.Class1.<clinit>(Class1.java:17) E/AndroidRuntime( 291): ... 15 more W/ActivityManager( 60): Force finishing activity com.example.contentprovidersandbox/.Activity1 I/ARMAssembler( 60): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x35d500:0x35d5bc] in 556086 ns W/ActivityManager( 60): Activity pause timeout for HistoryRecord{44f6f0c0 com.example.contentprovidersandbox/.Activity1} W/ActivityManager( 60): Activity destroy timeout for HistoryRecord{44f6f0c0 com.example.contentprovidersandbox/.Activity1} I/Process ( 291): Sending signal. PID: 291 SIG: 9 I/ActivityManager( 60): Process com.example.contentprovidersandbox (pid 291) has died. W/InputManagerService( 60): Window already focused, ignoring focus gain of: com.android.internal.view.iinputmethodclient$stub$pr...@44ee8dc8 Expected Results: The application should initialize normally. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
