Bug 29329 - Android publishing fails with Argument is out of range exception
Summary: Android publishing fails with Argument is out of range exception
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in ()
Version: 5.9
Hardware: PC Mac OS
: High normal
Target Milestone: 5.9.1 (C5SR1)
Assignee: Greg Munn
Depends on:
Reported: 2015-04-22 23:18 UTC by Prashant Cholachagudda
Modified: 2015-05-07 14:34 UTC (History)
3 users (show)

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

Logs (166.35 KB, application/octet-stream)
2015-04-22 23:18 UTC, Prashant Cholachagudda

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 Prashant Cholachagudda 2015-04-22 23:18:35 UTC
Created attachment 10877 [details]

Publishing an Android application from new Publishing workflow[1] fails with error "Failed to create App archive. Argument is out of range" on Xamarin Studio version 5.9 (build 427)

1. http://developer.xamarin.com/releases/studio/xamarin.studio_5.9/xamarin.studio_5.9/#Publishing_Workflow
Comment 1 Greg Munn 2015-04-23 11:04:59 UTC
Can you attach the test project please.
Comment 2 Greg Munn 2015-04-27 09:55:37 UTC
Hey, any update on this. I'd like to get some idea of how to repro this if possible. If a test project is not possible, just the androidmanifest.xml and .csproj file should be sufficient.
Comment 3 Greg Munn 2015-04-28 10:40:59 UTC
Well, I think I might have fixed it. It would appear that if the user has a icon with a resource id of 'drawable/something.png' and that image is not located in one of the drawable folders, then this crash occurs when archiving.
Comment 4 Greg Munn 2015-04-28 11:05:11 UTC
1. Create an Android App
2. Copy icon.png from one of the drawable folders to any other folder that does not start with 'drawable' (Resources for instance).
3. Change the resource id of the file to 'drawable/test.png'
4. Edit the project properties and set the application icon to '@drawable/test'
5. Select release configuration
6. Archive for Publishing'

Archive should be created.
Comment 5 Shruti 2015-04-29 03:39:08 UTC
@Greg, I am trying to reproduce this issue XS 5.9 (build 427) before verifying but resource id is not getting changed due to that I am not able to proceed further. Please go through below steps which I followed :
1. Create an Android App
2. Copy icon.png from drawable-hdpi  folder to Resources folder.
3. In drawable-hdpi > select the properties of icon.png to change the resource Id

I have also tried to change the resource Id of copied icon file which resides in 'Resources' folder but did not get success. Although, I am not sure that which file resource id should be changed.

But I am not able to change the resource Id because after typing text in 'Resource Id' field when we click outside of field, text get disappears. Due to that I am not able to proceed further.  

Please let me know how I can proceed further to reproduce this. After reproducing, I would able to verify this issue.
Comment 6 Greg Munn 2015-04-29 10:04:58 UTC
Create the project in 5.8 perhaps, and then use 5.9 to publish. Also, I believe the fix for the resource id's not being saved may have been merged into 5.9.1 today, so you could try with a later build.
Comment 7 Shruti 2015-04-30 02:50:09 UTC
@Greg, I have tried again to reproduce this issue but still not able to reproduce it. To reproduce this issue I followed the following steps :
 I have created a project in XS 5.8 and set Resource id as 'drawable/test.png' to (Resources >> drawable-hdpi >> icon.png) file. Select release configuration and then perform action of 'Archive for Publishing'.  Archive is getting created successfully.

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

Build Info : XS 5.9 (build 427) 

Please let me know How I can able to reproduce this issue.
Comment 8 Greg Munn 2015-04-30 10:32:04 UTC
Sorry, my mistake. The folder that the icon is in has have less than 8 characters, so Resources actually works. 

Create a folder inside Resources called 'test', move the icon to that folder, that should give you the error.
Comment 9 Shruti 2015-05-01 02:26:22 UTC
Thanks @Greg for providing steps in more detail. Now I am able to reproduce this issue with XS 5.9 (build 427).  Here is the screencast for same : http://www.screencast.com/t/WJTefT4Ap

Also able to reproduce the same issue with feature build which is attached to the card. Here is the screencast for same : http://www.screencast.com/t/WvjBsOmJxbh

Please provide the latest build where this issue has been fixed.
Comment 10 Shruti 2015-05-04 04:54:21 UTC
I have checked this issue on windows system with XS and observed that app is not getting build (getting build error) on following steps of Comment (7) and (8) . 

Screencast : http://www.screencast.com/t/Ws5W3yuja
Build Output Log: https://gist.github.com/saurabh360/2b779dced5d8ce7ba972
IDE Log : https://gist.github.com/saurabh360/18b512d34a10df49aae3

Note : If we build Android app without any resources changes. It is getting build successfully.

Environment Info :
=== Xamarin Studio ===

Version 5.9 (build 437)
Installation UUID: 0ab3f31c-da0f-40d3-be27-a8ade9c61903
 Microsoft .NET 4.0.30319.18408
 GTK+ 2.24.22 (MS-Windows theme)
 GTK# 2.12.26

=== Xamarin.Android ===

Version: 5.1.0 (Business Edition)
Android SDK: C:\android-sdk
 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: C:\Program Files\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)

=== Xamarin Android Player ===

Location: C:\Program Files\Xamarin Android Player\DeviceManager.exe

=== Build Information ===

Release ID: 509000437
Git revision: 07857a8069e02e83a044dbe3f2ffff8372850ae9
Build date: 2015-05-01 13:32:04-04
Xamarin addins: ed84f3da58f7ab082b7d3eac7054a0f145335cb7

=== Operating System ===

Windows 6.1.7601.65536
Comment 11 Shruti 2015-05-04 06:02:49 UTC
Update on Mac Testing: I have checked this issue with C5 and Master builds. 

This issue is fixed with Master XS 6.0 (build 495). Screencast : http://www.screencast.com/t/d8877tWfiH

Environment Info : 
=== Xamarin Studio ===

Version 6.0 (build 495)
Installation UUID: 67eaf3b4-f8a7-4ab4-a9df-3197350ca5dc
	Mono 4.0.1 ((detached/373d684)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000009

=== Apple Developer Tools ===

Xcode 6.3 (7569)
Build 6D570

=== Xamarin.iOS ===

Version: (Enterprise Edition)
Hash: 4891f88
Branch: master
Build date: 2015-04-30 12:54:57-0400

=== Xamarin.Android ===

Version: (Enterprise Edition)
Android SDK: /Users/ixamarin78/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.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Xamarin Android Player ===

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

=== Xamarin.Mac ===

Version: (Enterprise Edition)

=== Build Information ===

Release ID: 600000495
Git revision: 798e2107a5a4534ba79dde831544ac9727f240ab
Build date: 2015-04-29 20:57:17-04
Xamarin addins: 54a7fe3452408260cabc82aa7bba0cfbd9f423a7
Build lane: monodevelop-lion-master

=== Operating System ===

Mac OS X 10.10.3
Darwin XamnewiMac.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 12 Shruti 2015-05-04 10:57:00 UTC
I am not able to verify this issue on Windows system due to bug https://bugzilla.xamarin.com/show_bug.cgi?id=29706
Comment 13 xamarin-release-manager 2015-05-06 19:36:21 UTC
Fixed in version (monodevelop-5.9-branch)
Comment 14 Abhishek 2015-05-07 14:34:46 UTC
I have checked this issue with C5SR1 build
XamarinStudio- Now this issue is working fine. 

Here is the screencast for the same: http://www.screencast.com/t/2tYU8dQM1pb0

Hence Closing this issue.