Bug 4480 - ViewPagerIndicator build errors (ICS), crash on Circles->Default
Summary: ViewPagerIndicator build errors (ICS), crash on Circles->Default
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.1.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-04-17 14:34 UTC by PJ
Modified: 2012-04-24 11:52 UTC (History)
2 users (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 FIXED

Description PJ 2012-04-17 14:34:28 UTC
I have test failures on all configuration except Froyo | Release | Device:

The application does not build successfully, as it gives 2 errors.

Steps to reproduce:

1.Build 'ViewPagerIndicator'


Actual result: The application does not Build successfully, i.e. 2 errors are appearing.

Expected result: The application should Build successfully.

Errors:
/Users/nichal/Desktop/MD 2.9.5 + M4A 4.1.1/xamarin-monodroid-samples-5818001/ViewPagerIndicator/ViewPagerIndicator/ViewPagerIndicator.cs(47,47): Error CS1678: Parameter 2' is declared as typeAndroid.Widget.ItemEventArgs' but should be `Android.Widget.AdapterView.ItemClickEventArgs' (CS1678) (ViewPagerIndicator)
/Users/nichal/Desktop/MD 2.9.5 + M4A 4.1.1/xamarin-monodroid-samples-5818001/ViewPagerIndicator/ViewPagerIndicator/ViewPagerIndicator.cs(47,47): Error CS1661: Cannot convert anonymous method' to delegate typeSystem.EventHandler<Android.Widget.AdapterView.ItemClickEventArgs>' since there is a parameter mismatch (CS1661) (ViewPagerIndicator)

Environment:
MonoDevelop 2.9.5
Mono 2.10.9
Mono for Android 4.1.1
Mac 10.7.3 (Lion)
Comment 1 PJ 2012-04-17 14:37:24 UTC
7 errors total when Build Target is set to Ice Cream Sandwich:

https://gist.github.com/2408063
Comment 2 PJ 2012-04-23 16:26:30 UTC
This is now the issue on Froyo and Gingerbread. On Ice Cream Sandwich the build errors persist:

Steps to reproduce:
1. Open 'ViewPagerIndicator'.
2. Build the application.
3. Run the application.
4. Verify application launch successfully.
5. Click 'Circles->Default'.
6. 'System.ArgumentException has been thrown.

Actual result:
After clicking on 'Circles->Default' following error displayed 'System.ArgumentException has been thrown'

Expected result:
Application should run successfully after clicking 'Circles->Default'.

Stack trace:
System.ArgumentException: Unable to determine JNI class for 'Android.Support.V4.View.ViewPager'.
Parameter name: TResult
at Java.Interop.JavaObjectExtensions._JavaCast<Android.Support.V4.View.ViewPager> (Android.Runtime.IJavaObject) <0x00310>
at Java.Interop.JavaObjectExtensions.JavaCast<Android.Support.V4.View.ViewPager> (Android.Runtime.IJavaObject) <0x00063>
at Android.Runtime.Extensions.JavaCast<Android.Support.V4.View.ViewPager> (Android.Runtime.IJavaObject) <0x00063>
at Android.App.Activity.FindViewById<Android.Support.V4.View.ViewPager> (int) <0x0007b>
at ViewPagerIndicator.SampleCirclesDefault.OnCreate (Android.OS.Bundle) [0x00023] in /Users/nischal/Desktop/xamarin-monodroid-samples-edddaaf/ViewPagerIndicator/ViewPagerIndicator/Circles/SampleCirclesDefault.cs:28
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-mac-master/b43e81da/source/monodroid/src/Mono.Android/platforms/android-10/src/generated/Android.App.Activity.cs:1472
at (wrapper dynamic-method) object.c9d74d39-5911-42e8-aebc-09f01ee47fdf (intptr,intptr,intptr) <IL 0x00012, 0x00033>

Environment:

mono-android-4.1.1.188999709
MonoDevelop-MonoDevelop-13c2b8900bc489291f789c8a41b44b04020a4a65
Mac 10.7.3
Device: LG P500
Target framework: 2.2 Froyo
Comment 3 Jonathan Pryor 2012-04-24 10:06:46 UTC
The listener-related breakage is fixed:

https://github.com/xamarin/monodroid-samples/commit/c0fd2204cd4cb1ff3db6af110097172f47dfa7f3

Color related breakage is fixed:

https://github.com/xamarin/monodroid-samples/commit/0477005bd8ff597e60c20ed16b69d10ba0cf32b7

The "JNI class" error is fixed in 240492ec.

You'll also need the Support fix in b43e81da.

ViewPagerIndicator launches for me, though I haven't explored the entire app...
Comment 4 PJ 2012-04-24 10:38:47 UTC
Circles->Default is no longer an issue (I personally verified) at least on an HTC Flyer.


The build issues when target framework is set to Ice Cream Sandwich remain:

Errors:

/Users/pjbeaman/GitHubRepositories/monodroid-samples/ViewPagerIndicator/ViewPagerIndicator/ViewPagerIndicator.csproj (Build) ->
/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/Microsoft.CSharp.Targets (CoreCompile target) ->

	TestFragment.cs(16,30): error CS0104: `Fragment' is an ambiguous reference between `Android.App.Fragment' and `Android.Support.V4.App.Fragment'
	TestFragmentAdapter.cs(21,45): error CS0104: `FragmentManager' is an ambiguous reference between `Android.App.FragmentManager' and `Android.Support.V4.App.FragmentManager'
	TestFragmentAdapter.cs(26,33): error CS0104: `Fragment' is an ambiguous reference between `Android.App.Fragment' and `Android.Support.V4.App.Fragment'
	TestFragmentAdapter.cs(26,42): error CS0508: `ViewPagerIndicator.TestFragmentAdapter.GetItem(int)': return type must be `Android.Support.V4.App.Fragment' to match overridden member `Android.Support.V4.App.FragmentPagerAdapter.GetItem(int)'
	TestTitleFragmentAdapter.cs(18,50): error CS0104: `FragmentManager' is an ambiguous reference between `Android.App.FragmentManager' and `Android.Support.V4.App.FragmentManager'
	Tabs/SampleTabsDefault.cs(37,52): error CS0104: `FragmentManager' is an ambiguous reference between `Android.App.FragmentManager' and `Android.Support.V4.App.FragmentManager'
	Tabs/SampleTabsStyled.cs(37,52): error CS0104: `FragmentManager' is an ambiguous reference between `Android.App.FragmentManager' and `Android.Support.V4.App.FragmentManager'

	 3 Warning(s)
	 7 Error(s)

I can re-file this as a separate issue if you'd like, but re-opening for now.
Comment 5 Jonathan Pryor 2012-04-24 11:52:44 UTC
The ICS build is fixed in:

http://github.com/xamarin/monodroid-samples/commit/b38a7292fa679250647ce67f7713296529b549a0