Bug 27216 - RelativeLayout causing TargetInvocationException when launched on iOS device only
Summary: RelativeLayout causing TargetInvocationException when launched on iOS device ...
Status: VERIFIED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.4
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-02-19 10:16 UTC by John Miller [MSFT]
Modified: 2015-04-27 08:15 UTC (History)
5 users (show)

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


Attachments
Test Case (606.72 KB, application/zip)
2015-02-19 10:16 UTC, John Miller [MSFT]
Details
Another new Test Case (182.53 KB, application/zip)
2015-02-19 11:07 UTC, John Miller [MSFT]
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:
VERIFIED ANSWERED

Description John Miller [MSFT] 2015-02-19 10:16:22 UTC
Created attachment 9922 [details]
Test Case

**Overview:**

   When a XAML page has a RelativeLayout as the Content, an exception is thrown when running on iOS devices.

**Steps to Reproduce:**

   1. Run the attached sample on an iOS device (not simulator). 

**Actual Results:**

   Crash from a TargetInvocationException. 

**Expected Results:**

   No crash or exception.

**Build Date & Platform:**

   XI 8.6.1.20
   XF 1.3.4

**Additional Information:**

   Possible duplication of #23280. 
   The attached example does not explicity set any constraint expressions like #23280, so it's unclear if it's the same issue.
Comment 1 John Miller [MSFT] 2015-02-19 11:06:50 UTC
I don't know why yet, but the same code in a new solution/project works as expected. I am not sure what is wrong with this TestApp, but I can't reproduce when putting in a new solution. 

I also added in the constraints similar to #23280 and it still worked.
Comment 2 John Miller [MSFT] 2015-02-19 11:07:20 UTC
Created attachment 9924 [details]
Another new Test Case

New solution/project mentioned in comment #2
Comment 3 asimk 2015-02-19 13:07:31 UTC
I have check this issue with the help of sample app attached in bug description and not able to reproduce this issue. I observed that when I run application on device its deploy on device without any error.
I have check this issue with iOS 7.1 and iOS 8.1 both and using forms version 1.3.5.6333-pre1. 

Please let us know what additional step we need to follow to reproduce this issue. Also it would be great if you provide log details also.

iOS Device Log: https://gist.github.com/saurabh360/2e555d7a340fbe7f6e00

Environment Info:
=== Xamarin Studio ===

Version 5.7.2 (build 2)
Installation UUID: 2939b8b4-8977-42bd-82d6-100275ccd9cd
Runtime:
	Mono 3.12.0 ((detached/de2f33f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000076

=== Xamarin.Android ===

Version: 4.20.0.28 (Enterprise Edition)
Android SDK: /Users/360_macmini/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		1.6   (API level 4)
		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)
		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-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Apple Developer Tools ===

Xcode 6.2 (6758)
Build 6C107a

=== Xamarin.iOS ===

Version: 8.6.1.20 (Enterprise Edition)
Hash: 3b3ef43
Branch: 
Build date: 2015-01-24 09:42:21-0500

=== Xamarin.Mac ===

Version: 1.12.0.8 (Enterprise Edition)

=== Build Information ===

Release ID: 507020002
Git revision: d6231e6325f274cea59da478410f561312c5b401
Build date: 2015-02-17 19:04:38-05
Xamarin addins: b212fd66838b0d6e2435966e541e66ab9c988698

=== Operating System ===

Mac OS X 10.9.4
Darwin 360-MACMINIs-Mac-mini-2.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 4 John Miller [MSFT] 2015-02-20 15:09:45 UTC
@asimk,

Which test project did you use? Attachment #1 [details] "Test Case" should reproduce the issue. 

Attachment #2 [details] "Another new Test Case" does not reproduce the issue per comment #1.
Comment 5 asimk 2015-02-26 09:41:46 UTC
I have checked this issue with the help of sample app attached in bug description and able to reproduce it. I observed that application is getting crashed with a TargetInvocationException.

Exception detail : https://gist.github.com/AkhileshKumar01/7f925221e4a014e322e9

IDE Logs : https://gist.github.com/AkhileshKumar01/51f85045cc6256330a09

application output : https://gist.github.com/AkhileshKumar01/1720fd9ba223b7956b0b

Environment Info:
=== Xamarin Studio ===

Version 5.7.2 (build 8)
Installation UUID: ff0c16c6-3c75-46d8-ac56-56c3b56e2c76
Runtime:
 Mono 3.12.0 ((detached/b8f5055)
 GTK+ 2.24.23 (Raleigh theme)

 Package version: 312000077

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/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.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.2 (6770)
Build 6C121

=== Xamarin.iOS ===

Version: 8.6.2.25 (Business Edition)
Hash: 2c22013
Branch: 
Build date: 2015-02-25 23:24:34-0500

=== Xamarin.Mac ===

Version: 1.13.1.280 (Business Edition)

=== Build Information ===

Release ID: 507020008
Git revision: 64a4266f0a82f7558472383d8ae66a526b3b881d
Build date: 2015-02-25 11:22:12-05
Xamarin addins: 1cb443ca2dddd9933d748e035560f06cf9c246bd

=== Operating System ===

Mac OS X 10.10.2
Darwin Apples-iMac.local 14.1.0 Darwin Kernel Version 14.1.0
    Mon Dec 22 23:10:38 PST 2014
    root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Comment 6 Jason Smith [MSFT] 2015-03-02 10:49:28 UTC
Please ensure your build config has this set:

<MtouchEnableGenericValueTypeSharing>True</MtouchEnableGenericValueTypeSharing>

In your test it is set to false, this causes this issue (apparently).
Comment 7 John Miller [MSFT] 2015-03-02 10:52:17 UTC
You can set the property in Comment #6 via the Project Options -> iOS Build -> Advanced menu too. http://screencast.com/t/PCk2maWK1
Comment 8 asimk 2015-04-27 08:15:47 UTC
I have checked this issue again setting "MtouchEnableGenericValueTypeSharing" build config as "true" and observed that it is working fine on device.

Screencast: http://www.screencast.com/t/nusa0oWbC4c

Hence closing this issue.

Note: @John, I am not able to see "Enable generic value type sharing" option in Project Options -> iOS Build -> Advanced menu. As shown in screencast.
Screencast: http://www.screencast.com/t/Haf2Hw4lq5
But I am able to set it in "TestApp.iOS.csproj" file.

But As of now I am closing this issue. Please let me know if you have any suggestion for the same.

Thanks!

Environment Info:
=== Xamarin Studio ===

Version 5.9 (build 436)
Installation UUID: 91997f85-0008-4b4c-9f53-c7f991fcdae3
Runtime:
 Mono 4.0.0 ((detached/1aa57ef)
 GTK+ 2.24.23 (Raleigh theme)

 Package version: 400000146

=== Apple Developer Tools ===

Xcode 6.3 (7569)
Build 6D570

=== Xamarin.iOS ===

Version: 8.10.0.267 (Business Edition)
Hash: 6481535
Branch: master
Build date: 2015-04-27 04:38:13-0400

=== Xamarin.Android ===

Version: 5.1.0.113 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
 Supported Android versions:
  2.3    (API level 10)
  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.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

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

=== Xamarin.Mac ===

Version: 2.0.0.267 (Business Edition)

=== Build Information ===

Release ID: 509000436
Git revision: 7e8ba4cbccf7b188ce5e80a90fdc4acdedb5a83f
Build date: 2015-04-23 13:19:57-04
Xamarin addins: 21fd95f743742c5237e22023996c2800ce3f8db3

=== Operating System ===

Mac OS X 10.10.2
Darwin Apples-iMac.local 14.1.0 Darwin Kernel Version 14.1.0
    Mon Dec 22 23:10:38 PST 2014
    root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64