Bug 24130 - When copying resources (images, fonts) between platforms set the right platform build action
Summary: When copying resources (images, fonts) between platforms set the right platfo...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 3.7
Hardware: PC Windows
: Normal normal
Target Milestone: 15.4
Assignee: Juan Marcelo Tondato
URL:
Depends on:
Blocks:
 
Reported: 2014-10-29 10:20 UTC by Rogier van der Hee
Modified: 2017-09-29 12:29 UTC (History)
10 users (show)

Tags: ac
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 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 FIXED

Description Rogier van der Hee 2014-10-29 10:20:27 UTC
Just a minor enhancement idea:

when I now include an image from the "show all files" option in Visual Studio, it automatically sets the right default action (AndroidResource vs BundleResource).

However, when I copy an image from the Drawable resources from Android to an iOS project, the build action still is Android Resource instead of BundleResource.

It would be a nice (mono)touch to translate the build action to BundleResource automatically in that case, and vice versa of course.
Comment 1 Jatin 2014-11-03 04:48:51 UTC
I am not able to reproduce this issue at my end with the build XVS 3.7.256. As when I include an image (icon.png) from the Android project to the iOS project, then its Build Action appears as Bundle Resource in the iOS project.

Below is the screencast for the same:
http://www.screencast.com/t/od55IHPVUK

Please let me know if I missed any step in order to reproduce this issue. Also if you are still able to reproduce this issue at your end, then please provide us with the following information:
1. Screencast(video)
2. Any detailed steps

Build information:

VS 2012 + XVS 3.7.256

=== Xamarin Studio ===

Version 5.7 (build 381)
Installation UUID: 522f0c5e-80a3-4414-aec7-1f3b9c1768d1
Runtime:
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 4.18.1 (Business Edition)
Android SDK: C:\Users\Admin\AppData\Local\Android\android-sdk
	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)
		4.4.87 (API level 20)
Java SDK: C:\Program Files\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

=== Build Information ===

Release ID: 507000381
Git revision: 2fbcc9f359e02aa7baed074460c016d44a89115b
Build date: 2014-10-31 06:02:57-04
Xamarin addins: 58247d7ed77519cded7605ab890713bc3764a909

=== Operating System ===

Windows 6.1.7601.65536
Comment 2 Rogier van der Hee 2014-11-05 03:41:18 UTC
Hi Jatin,

you can't reproduce because you're not doing what I meant: *including* items works fine. *copying* items does not.

Steps to reproduce:
1. Open solution with Resources in an Android project and a iOS project
2. Select an Android Asset file with Build Action AndroidAsset or a Resource file with action AndroidResource.
3. Right-click->Copy or Ctrl-C.
4. Paste the item in the Resources folder of the iOS project.

The item build action is still then marked as an AndroidAsset or AndroidResource, while it would be nice to mark it as BundleResource.
Comment 3 Rajneesh Kumar 2015-01-19 12:07:45 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed the steps and instruction provided in bug description.

Steps I followed:

1. Create an android project in VS.
2. Add a iOS project also in this solution.
3. Copy 'Icon.png' from Android=>Resources=>Drawable folder.
4. Paste it in to iOS=>Resources Folder.
5. Now go to 'Icon.png' properties.
6. Observed that Build Action is set to "AndroidResource".

When I paste the Icon.png in to iOS=>Resources Folder and go to its properties, I observed that the Build Action is still set to "AndroidResource". 

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

Environment Info:

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0446016-02381
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0446016-02381
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0446016-02381
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0446016-02381
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0446016-02381
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0446016-02381
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0446016-02381
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06177-004-0446016-02381
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.3.50717.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.20703.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.2
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

Microsoft Azure Mobile Services Tools   1.2
Microsoft Azure Mobile Services Tools

NuGet Package Manager   2.8.50926.663
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools   1.2
Provides file classification services using PowerShell

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.30919.1
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.9.236.0 (d6a2cae)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.20.0.34 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.6.0.0 (eb24bdcf5cba2c12b673a07e0a8cce368b9563b3)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified
Comment 4 Prashant [MSFT] 2017-08-03 10:39:41 UTC
I observed this issue in latest preview of VS (VS2017, preview 7)


# Steps to reproduce:

1. Create an android project in VS.
2. Add a iOS project also in this solution.
3. Copy 'Icon.png' from Android=>Resources=>Drawable folder.
4. Paste it in to iOS=>Resources Folder.
5. Now go to 'Icon.png' properties.
6. Observed that Build Action is set to "AndroidResource".

When I paste the Icon.png in to iOS=>Resources Folder and go to its properties, I observed that the Build Action is still set to "AndroidResource".

# Version informarion 
Microsoft Visual Studio Enterprise 2017 Preview (15.3)
Version 15.3.0 Preview 7.0
VisualStudio.15.Preview/15.3.0-pre.7.0+26730.0
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Enterprise

Xamarin   4.7.0.827 (ddd8750)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.5.0.3 (3e66e8e)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.12.0.14 (bf350ba)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 5 xamarin-release-manager 2017-08-08 18:54:58 UTC
Fixed in version 4.8.0.125 (master)

Pull Request #7924 merged by: Jose Gallardo
Author: tondat
Commit: 888b5658fb6dceaf46878f838aa200a7f28e2d21 (xamarin/XamarinVS)