Bug 19683 - mkbundle creates package that loads slowly
Summary: mkbundle creates package that loads slowly
Status: RESOLVED ANSWERED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Other ()
Version: Master
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 2.0.x
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2014-05-12 11:30 UTC by Allie Miller
Modified: 2015-02-20 18:00 UTC (History)
7 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 ANSWERED

Description Allie Miller 2014-05-12 11:30:40 UTC
*Reported on behalf of a user*

The Issue
When deploying a Release Xamarin.Mac package on a workstation that does not have the Mono runtime already installed, there is a delay in the amount of time it takes the package to load. 

Test Case
Attached to this report

Steps to Reproduce Issue
1. Set build configuration to "Release"
2. Enable "Include the mono runtime in the application bundle".
3. Build the "ImageFromFile.app".
*If you have the mono.framework already installed on workstation*:
4. Rename "\<SystemVolume>\Library\framework\mono.framework\Version

to 

"\<SystemVolume>\Library\framework\mono.framework\_Version
 
5. Start the application of "ImageFromFile.app"

Results
The application takes longer to start, but eventually does without error.

Versioning Information
=== Xamarin Studio ===

Version 4.2.5 (build 0)
Installation UUID: f6a3c61f-a7e2-4740-ba09-86314760e340
Runtime:
	Mono 3.4.0 ((no/c3fc3ba)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000204

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 7.2.2.2 (Business Edition)
Hash: db4427f
Branch: 
Build date: 2014-04-22 12:49:14-0400

=== Xamarin.Android ===

Version: 4.12.3 (Business Edition)
Android SDK: /Users/xxxx/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		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)
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)

=== Xamarin.Mac ===
Xamarin.Mac: 1.8.0.8

=== Build Information ===
Release ID: 402050000
Git revision: 95ac543f224a70960a9ab71e24ce341eb87de06f
Build date: 2014-05-02 13:05:15-04
Xamarin addins: b81285ac0156281956135adb96685f98922893a1

=== Operating System ===
Mac OS X 10.9.2
Comment 2 Zoltan Varga 2014-05-14 15:56:40 UTC
I get this on the console:

Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: gdiplus.dll
  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
  at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
at System.Drawing.Image.FromFile (string,bool) <0x00053>
at System.Drawing.Image.FromFile (string) <0x00013>
at imageFromFile.MainWindowController.AwakeFromNib () <0x00023>
at (wrapper native-to-managed) object.[imageFromFile.MainWindowController.Void AwakeFromNib()] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector) <0x000f0>

We might not be mkbundle-ing gdiplus.
Comment 3 Sadik Ali 2014-10-29 06:27:54 UTC
I have checked this issue but I am unable to reproduce this issue.

When I run the attached sample without updating the "Versions" directory of "mono.framework" application is running without any error (mono.framework is already installed on my machine) but when I change the "Versions" directory to "_Versions" I am getting following error.

"Error: Framework 'Mono / .NET 4.5' not installed. (imageFromFile)"

I have also checked the application out

Steps I followed:

1. Download the attached sample application.
2. Set build configuration to "Release"
3. Enable "Include the mono runtime in the application bundle".
4. Build the "ImageFromFile.app".
5. Rename "\{System-Volume}\Library\framework\mono.framework\Versions
to 
"\{System-Volume}\Library\framework\mono.framework\_Versions

6. Start the application of "ImageFromFile.app"

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

Please let me know if I am missing anything?

Environment Info:

=== Xamarin Studio ===

Version 5.5.3 (build 6)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.0 (Business Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.0   (API level 11)
		3.1   (API level 12)
		3.2   (API level 13)
		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)
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.iOS ===

Version: 8.4.0.15 (Business Edition)
Hash: 08968c4
Branch: 
Build date: 2014-10-20 21:48:06-0400

=== Build Information ===

Release ID: 505030006
Git revision: fbe3e9453daf6a3bb9a9709ed22bec35f7c9056b
Build date: 2014-10-23 13:08:38-04
Xamarin addins: e44add2b39de4dd57c0742bb2e620dfad84c64c6

=== Operating System ===

Mac OS X 10.10.0
Darwin Jatin66s-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 4 Chris Hamons 2015-02-20 18:00:25 UTC
Hey everyone,

Apologies in the long delay in responding to this bug.

We have a work around for the bug here:

http://forums.xamarin.com/discussion/comment/54558/#Comment_54558

And newer versions of Mono should have this solution mostly fixed. The issue was that there is a cache fontconfig uses store font information. Due to permissions issues, that cache wasn't being saved and thus every launch is painful. This problem seems to be extra bad when you have a large number of fonts (Asian language packs in particular).

The first when we are creating that cache will still be slow, but there is little we can do about that.