Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 10729 [details]
If an iOS app project is referencing an iOS library project, and the library project has any Image sets, the Image sets in the in the library project will get copied to the app bundle but the Image sets in the App project will not be.
## Steps to reproduce.
1. Open the attached test project.
2. Deploy the TestLibraryIMageAssets App project to a device or simulator.
Expected result: I should see two images, the beach image from the library project and the image of Einstein from the App project.
Actual result: Only the beach image from the library project is shown.
This issue was discovered after fixing the issue in bug https://bugzilla.xamarin.com/show_bug.cgi?id=28955 .
## My environment
=== Xamarin Studio ===
Version 5.8.3 (build 1)
Installation UUID: 2dc9022f-f9a8-424f-8284-bf224cbbfde0
Mono 3.12.1 ((detached/0849ec7)
GTK+ 2.24.23 (Raleigh theme)
Package version: 312010003
=== Apple Developer Tools ===
Xcode 6.3 (7569)
=== Xamarin.iOS ===
Version: 188.8.131.52 (Business Edition)
Build date: 2015-04-09 04:22:08-0400
=== Xamarin.Android ===
Version: 184.108.40.206 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
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.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
=== Xamarin Android Player ===
Version: Unknown version
Location: /Applications/Xamarin Android Player.app
=== Xamarin.Mac ===
Version: 220.127.116.11 (Business Edition)
=== Build Information ===
Release ID: 508030001
Git revision: 6e8e725e0d689351901c2c70453bfa4ea25e293b
Build date: 2015-04-06 20:31:47-04
Xamarin addins: 051cd5f8c1b5dbfc87eaef80a74aec03f34c60a8
=== Operating System ===
Mac OS X 10.10.3
Darwin Jons-iMac.local 14.3.0 Darwin Kernel Version 14.3.0
Mon Mar 23 11:59:05 PDT 2015
Delete the LittleBeach.imageset from the library project., clean and rebuild. You will see that now you the image from the app project is shown but not (obviously) the image from the library project.
Created attachment 10730 [details]
Diagnostic Build Output
There's no way to "fix" this. One of them will always overwrite the other. The code in git master will have the main project overwrite the library assets (there was a bug report about xib files a few weeks back that I've already fixed).
*** This bug has been marked as a duplicate of bug 8409 ***
This is the commit to Xamarin.iOS:
Author: Jeffrey Stedfast <firstname.lastname@example.org>
Date: Wed Mar 11 14:37:05 2015 -0400
[msbuild] unpacked resources from assemblies should not overwrite project resources
Fixes bug #8409 (re-reported after migrating to Unified)
There's no way to merge image assets from 2 different projects. It's just not doable. I suggest you don't name your image assets such that they conflict with one another.
I thought this might be the case, but naming does not seem to be the issue. In the test project, the *.imageset folders did have different names and the image files in the image set were differently named. I tried changing the name of the Images.xcassets folder in one of the projects, but the results were the same. The point about naming seems to more relevant to resources that are _not_ an image set. Image sets seem to get compiled to an Asset.car file in the app bundle. This name seems to remain the same regardless of what you name the Images.xcasset folder or the Image Set subfolders.
I mention this mainly for the benefit of others so they don't get the impression that this issue can be avoided by naming their image sets differently.
So the bottom line seems to be that you can only use image sets in the app project or in a referenced iOS library project, not both. If you have them in both, then the Image sets from the library project will be in the final app bundle rather than the image sets in the app project.
Images (or other resources) with build action BundleResource do not have this issue. As long as they are named differently resources from both the library project and the app project will end up in the final app bundle.
Oh, right, Apple's insistence that the output be called Assets.car. Gah.
I'd add code to name them the same as their original asset name, but I doubt it would work (i.e. Images.xcassets -> Images.car).
I guess this means you just can't do it :-\
Does it work with Xcode apps?
*** Bug 40127 has been marked as a duplicate of this bug. ***
So, I could not get this to work with an XCode app following this guide fro using resources in an iOS Library project:
So we will have to go with this being an unsupported scenario at this point.