Bug 13722 - 'Calendar Demo' android sample throws 'Java.Long.NoClassDefFoundError' with configuration "(17 (JellyBean), Samsung Galaxy S2 (2.3.3))".
Summary: 'Calendar Demo' android sample throws 'Java.Long.NoClassDefFoundError' with c...
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: Samples ()
Version: 4.8.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Peter Collins
URL:
Depends on:
Blocks:
 
Reported: 2013-08-02 14:59 UTC by Saurabh
Modified: 2013-08-02 15:21 UTC (History)
1 user (show)

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

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 INVALID

Description Saurabh 2013-08-02 14:59:46 UTC
'Calendar Demo' android sample throws 'Java.Long.NoClassDefFoundError' with configuration "(17 (JellyBean), Samsung Galaxy S2 (2.3.3))".

Step to reproduce:
1. Open Calendar Demo android sample
2. Set Minimun Android Version to 'Android 2.2, API-8' from Option-> Build-> Android Application
3. Set Target Framework to 'Android 4.2 (Jelly Bean)'
4. Debug the application on Samsung Galaxy S2 (2.3.3) device

Actual result:
Application throws 'Java.Long.NoClassDefFoundError' error.

Note : This is working fine if we run this application without making any change on Android 4.2.2 (Jelly Bean) Samsung S4 device.

Expected result:
Application should build and deploy successfully.

Screencast: http://www.screencast.com/t/aesEIqHrkpj
Error: https://gist.github.com/atin360/207c6a7620a9b80ccdb2
Android Device log: https://gist.github.com/atin360/47ada35416e78f99c51d

App info:
monodroid-samples-master-faf8d16186be3268e354fd4751648412800f80a7
Comment 1 Saurabh 2013-08-02 15:02:23 UTC
An update in above issue:

Environment info:
All Mac 
Mono 3.2.1()
XS 4.0.11(Build 6)
MFA 4.8.02018
Comment 2 Peter Collins 2013-08-02 15:06:12 UTC
This sample explicitly sets the minimum target framework to 4.0, which is
intentional as it calls into API 4.0. The NoClassDefFoundError you are hitting
is because the majority of this sample was written with android 4.0+ API, which
won't exist when targeting or attempting to deploy to anything < 4.0
Comment 3 PJ 2013-08-02 15:21:29 UTC
Remember from our conversation Saurabh - you should only change the Minimum Android version if there is not one set already. 

When the minimum is set, it's set for a reason.

That being said, now that we use TargetFramework by default, it would be helpful for 360logica if the minimum version was set explicitly for samples that can be tested on lower API levels. I've added a card for this here: https://trello.com/c/oW9lxjGl/89-set-android-minsdkversion-for-all-samples

This also would prevent a lot of confusion from customers who may install API 17 and then try to run a sample app on their ICS device. It's not really a great idea to assume that first time users will have a device at the exact API level that has been installed.

We avoid some of the pain now by only installing up to API 15, but we should perhaps consider adding some very descriptive error messages that point people at the AndroidManifest.xml and a document describing the difference between target, compile target, and minSDKversion.