Bug 34736 - iOS Library projects do not use the same minimum SDK target for actool
Summary: iOS Library projects do not use the same minimum SDK target for actool
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: XI 9.0 (iOS9)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-10-09 16:40 UTC by John Miller [MSFT]
Modified: 2016-07-07 14:42 UTC (History)
5 users (show)

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 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 John Miller [MSFT] 2015-10-09 16:40:24 UTC

   When compiling an iOS app project that references an iOS Library project, the --minimum-deployment-target option sent to actool does not match what is specified in the iOS App project. 

Note* There is not obvious way to configure the iOS Library project's minimum SDK target like there is in an iOS App project template, so it's assumed it should be using that one.

**Steps to Reproduce:**

   1. Create an iOS App project. 
   2. Reference an iOS Library project. 
   3. Build for device. 

**Actual Results:**

   Observe the build output. Attached is an example build output. 

   Note* The output for the library project shows something like this: 

> Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution started with arguments: --errors --warnings --notices --output-format xml1 --compress-pngs --minimum-deployment-target 9.0 --platform iphonesimulator --compile /Users/{removed for brevity}/ProjectName.iOS.Resources/obj/iPhoneSimulator/Debug/actool/bundle /Users/{removed for brevity}/ProjectName.iOS.Resources/Resources/Images.xcassets

While the iOS App project has this output:

> Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution started with arguments: --errors --warnings --notices --output-format xml1 --output-partial-info-plist /Users/{removed for brevity}/ProjectName.iOS.App/obj/iPhoneSimulator/Debug/actool/partial-info.plist --app-icon AppIcons --compress-pngs --target-device iphone --target-device ipad --minimum-deployment-target 8.3 --platform iphonesimulator --compile /Users/{removed for brevity}/ProjectName.iOS.App/obj/iPhoneSimulator/Debug/actool/bundle /Users/{removed for brevity}/ProjectName.iOS.App/Resources/Images.xcassets

The minimum-deployment-target for the App is set to 8.3, while the Library is using the latest on the machine (9.0). 
This causes an issue when trying to run the app on a < iOS 9 device because the library caused something to require iOS 9. 

**Expected Results:**

   The library should use the same minimum-deployment-target as the app project. 

**Build Date & Platform:**

  === Xamarin Studio ===

Version 5.9.7 (build 22)
Installation UUID: 0aa376c3-3c5e-4cc4-a0e5-2d29593fb455
Mono 4.0.4 ((detached/d481017)
GTK+ 2.24.23 (Raleigh theme)

Package version: 400040004

=== Xamarin.Android ===

Not Installed

=== Xamarin Android Player ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.0.1 (8228)
Build 7A1001

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 1d27ac2
Branch: master
Build date: 2015-09-25 18:08:44-0400

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 509070022
Git revision: 6bd1f169df44ca96addf8a035316c535a4fa46fa
Build date: 2015-09-30 12:30:15-04
Xamarin addins: 1c3e5c0859bdfec0ecd481a57ad6c03bc22f5536

=== Operating System ===

Mac OS X 10.10.5
Darwin pwnage 14.5.0 Darwin Kernel Version 14.5.0
Wed Jul 29 02:26:53 PDT 2015
root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 2 Jeffrey Stedfast 2015-10-09 16:44:57 UTC
The problem is that each project is independent, Library projects cannot inherit the MinimumOSVersion from the App project that references them.

Not sure what to do about this other than introducing an Info.plist to Library projects.
Comment 3 gdunko 2015-10-12 08:51:51 UTC
Another option could be to introduce some of these settings at the solution level.  Not ideal but it would provide a way to control these cross-project settings.
Comment 4 Jeffrey Stedfast 2015-10-13 16:58:34 UTC
I don't think that's possible because I don't think msbuild can get at the solution properties
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-10-14 04:15:39 UTC
I'm not sure if this even makes sense, but would it be possible to package the assets with the library (as a resource of some kind), and then run actool from the executable project instead?
Comment 6 Jeffrey Stedfast 2015-10-22 14:21:43 UTC
@rolf: that might be one way to do it, but a lot of logic would need to change in the current build system to make that happen.

I'd rather go with a simpler solution that requires as few changes as possible.
Comment 7 Jeffrey Stedfast 2015-11-18 14:22:13 UTC
Fixed in git master
Comment 8 GouriKumari 2016-07-06 22:21:42 UTC
Verified with current stable cycle7 build and I couldn't reproduce the issue. 

Log: https://gist.github.com/GouriKumari/34290582c6e444b631264f3a6fe4718c

App referring an iOS library project did launch successfully on iOS device.
Comment 9 GouriKumari 2016-07-07 14:42:38 UTC
Marking bug as verified fixed,