Bug 22061 - Assets within Class Libraries are wrong embbeded in the Application referencing the class library
Summary: Assets within Class Libraries are wrong embbeded in the Application referenci...
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.16.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2014-08-13 08:39 UTC by Christian.Wall
Modified: 2014-09-23 05:45 UTC (History)
5 users (show)

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

Scratch.Bxc22061.zip (15.63 KB, application/zip)
2014-08-22 11:14 UTC, Jonathan Pryor

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:

Description Christian.Wall 2014-08-13 08:39:30 UTC
We've created a Class Library including some Activities. There are also some Assets (AndroidAsset) included in the class library which are used by the activities. We structured the Assets in Sub Folders (e.g assets\Documents, assets\Images).

Now when we reference the class library in an App there is an issue with the Folder structure. When I look in the obj\debug Directory of the App I can see that the assets were extracted from the class library, but the Folder sturcture get lost.

Comment 1 Arpit Jha 2014-08-22 09:05:40 UTC
I have checked this issue and able to reproduce it.

I have reproduced it with follwoing steps :
1. Create an empty solution.
2.Add a Mobile Apps/Class library project.
3.Add a Assets folder.In asset folder add two directories Image and document.
3.Add file in Image and Document.
4.Add a  Mobile Apps/ Blank Apps PCL project.
5.Give reference of class library to PCL project.
6.Build the Solution.
7.Go to PCL Project right click open file ,then obj/debug

I observed that Folder structure was lost.

Screencast: http://screencast.com/t/6MXNSdPMdDYx

Environment Info:
Comment 2 Jonathan Pryor 2014-08-22 11:14:41 UTC
Created attachment 7771 [details]

Comment 3 Jonathan Pryor 2014-08-22 11:15:43 UTC
This is a build system bug, and not related to or requiring PCL projects. Android Library projects also trigger this behavior.
Comment 4 Jonathan Pryor 2014-08-22 11:18:25 UTC
Repro steps:

1. Download Attachment #7771 [details]
2. Unzip:

    unzip Scratch.Bxc22061.zip

3. Build:

    cd Scratch.Bxc22061/Scratch.Bxc22061
    xbuild /t:SignAndroidPackage

4. Check obj/Debug/assets:

    $ find obj/Debug/assets -type f

Expected output: it should be:

Comment 5 Atsushi Eno 2014-08-29 02:58:36 UTC
Fixed. Thanks for the report.

[master b1186d7]
Comment 6 Christian.Wall 2014-08-29 10:55:54 UTC
Great. One more thing about the issue...
Today I checked what happens if I link a File and set it to be an Asset (Visual Studio File Link). The Folder Structure got also lost/corrupted.

Can you confirm that behavior? And did or can you fix it too?

Thanks and regards
Comment 7 Saurabh 2014-09-23 05:45:06 UTC
I have checked this Issue and observed that

For Comment#4: 
I have followed all steps and observed that after build the project using command line I am getting assests under obj/Debug/Android after running command 'find obj/Debug/Android/assets -type f' I am getting following output: https://gist.github.com/saurabh360/6f57cd69bc9b7ed44953 Please let me know is it correct behaviour?

For Comment#6 
I have followed steps mentioned in this comment and observed that folder structure does not get lost/corrupted. This is the screencast for the same: http://www.screencast.com/t/rCrbTTCn 

Build info:
X.S 5.5 (Build 203)
VS 2013
XVS 3.7.126
X.Android 4.18.0-32