Bug 6265 - btouch: Unable to add Resources such as Images to Native Obj-C binding Library's
Summary: btouch: Unable to add Resources such as Images to Native Obj-C binding Library's
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 3.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 3.2
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2012-07-24 18:57 UTC by Nathan Scavezze
Modified: 2012-07-26 10:15 UTC (History)
2 users (show)

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


Attachments
Scandit Binding Lib (2.80 MB, application/zip)
2012-07-24 18:58 UTC, Nathan Scavezze
Details
fixed up ScanditSDK Binding Project (2.77 MB, application/octet-stream)
2012-07-25 18:08 UTC, Jeffrey Stedfast
Details
update MSBuild targets for MonoTouch Binding Projects (8.79 KB, application/zip)
2012-07-25 18:14 UTC, Jeffrey Stedfast
Details


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 FIXED

Description Nathan Scavezze 2012-07-24 18:57:55 UTC
Can't Seem to find a way to add Resources such as Images and wav files to a Objective-C Lib that requires external Resources.

I have attached a Binding Project that contains a Example Lib.

For more info about the lib and to get a app key please visit.
http://www.scandit.com/support/getting-started-with-scandit-sdk-for-ios/

Feel Free to contact me if you have questions.

Things i tried.

I tried setting the images to compile as content.
also tried embedded resource.

no luck.
Spoke with jeff in the monotouch chat he requested i add a feature request.
Comment 1 Nathan Scavezze 2012-07-24 18:58:35 UTC
Created attachment 2253 [details]
Scandit Binding Lib
Comment 2 Jeffrey Stedfast 2012-07-25 18:08:13 UTC
Created attachment 2256 [details]
fixed up ScanditSDK Binding Project

I've implemented the feature to support adding native resources to MonoTouch Binding Projects (attached is a sample of how to do it)

Of course, there are updates to MonoDevelop and MonoTouch as well, in order for you to be able to build it... I'll attach the updated MSBuild targets (which normally come bundled with MonoTouch in a second).

Once I do that, you'll be able to build it, but MonoDevelop won't be able to add any other native resources until ~3.0.5 is released.
Comment 3 Jeffrey Stedfast 2012-07-25 18:14:32 UTC
Created attachment 2257 [details]
update MSBuild targets for MonoTouch Binding Projects

unzip these into /Library/Frameworks/Mono.framework/External/

(you'll probably need to sudo into root to unzip it into that directory, since it is normally owned by root)

Hopefully my changes will make it into the final MonoTouch 6.0, if not, just unzip these targets whenever you upgrade/downgrade MonoTouch.

I'll try to provide a link to a custom built MonoDevelop with the changes needed for this as well, as soon as the build bots finish.
Comment 4 Jeffrey Stedfast 2012-07-25 18:25:39 UTC
What you'll notice is that all of the native library resources are marked as "BundleResource"

the MSBuild targets now do some fancy schmancy magic to turn those into special embedded resources which have mangled names (to preserve directory tree layout) that are decoded by normal MonoTouch projects and extracted into the final app bundle in the proper directory layout.

Hope that helps
Comment 5 Nathan Scavezze 2012-07-25 18:52:28 UTC
the embedded resources work great much cleaner then dragging then to the main project.  unfortunately it didn't fixed my crash :( but ruled out a possible reason. Thanks
Comment 6 Jeffrey Stedfast 2012-07-26 10:15:22 UTC
here's the link to a MonoDevelop (not QA'd, although it's basically the same as the QA'd version of 3.0.4 which will be released in a bit) with my patches to add support for the BundleResource build action which is needed to create these projects.

http://files.xamarin.com/~jeff/MonoDevelop-c6465f7b2c649f8e256e6811157bc27bb46f6cc9.dmg