Bug 39858 - Simulator no longer has access to AppGroup folder (NSFileManager.DefaultManager.GetContainerUrl returns null);
Summary: Simulator no longer has access to AppGroup folder (NSFileManager.DefaultManag...
Status: RESOLVED DUPLICATE of bug 59379
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: XI 9.8 (tvOS / C7)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Xcode9.1
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2016-03-23 05:47 UTC by Joseph Hanna
Modified: 2017-10-11 17:19 UTC (History)
13 users (show)

See Also:
Tags:
Is this bug a regression?: Yes
Last known good build: Latest build (iOS 11) works with Xcode 8.3, but not Xcode 9. Obj-c in Xcode 9 works


Attachments

Description Joseph Hanna 2016-03-23 05:47:20 UTC
Description of Problem:
The Simulator can no longer access the AppGroup folder - after 3 hours of messing with provisioning profiles (thinking I stuffed something up), I concluded it wasn't me!

NSFileManager.DefaultManager.GetContainerUrl returns null. This used to work.  It seems like the entitlements are not included in the build for the simulator but I can't be sure. The Debug | Simulator profile has the Entitlements.plist configured.  The physical device works fine - it's only the simulator.

Steps to reproduce the problem:
1. Configure AppGroup "group.xxxx.xxxx" on developer.apple.com, generate provisioning profile and install
2. Set XS Build Configuration to Debug | iPad X
3. Run the app that calls NSFileManager.DefaultManager.GetContainerUrl("group.xxxx.xxxx")


Actual Results:
When run on the simulator, result is null.  
When run on the device, the result is a valid folder path.

Expected Results:
A valid folder path on the simulator.  This used to work fine.

How often does this happen? 
Every time I try to run the app on the simulator.

This happens in both XS 5 and XS 6 and on three different machines.

Additional Information:
=== Xamarin Studio ===

Version 6.0 (build 4801)
Installation UUID: d1083ad0-dee3-4099-a529-37f782026501
Runtime:
	Mono 4.4.0 (mono-4.4.0-branch/f8474c4) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 404000040

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.3 (10183.3)
Build 7D175

=== Xamarin.Mac ===

Version: 2.8.0.58 (Business Edition)

=== Xamarin.iOS ===

Version: 9.8.0.58 (Business Edition)
Hash: fa3b68c
Branch: master
Build date: 2016-03-09 11:44:54-0500

=== Xamarin.Android ===

Version: 6.1.0.16 (Business Edition)
Android SDK: Not found

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 600004801
Git revision: f73f730c738baf8701a5892b7af64fd468d1dc0c
Build date: 2016-03-14 14:28:06-04
Xamarin addins: 3af7be6c701eb0137645a03e38b82f23b65738c3
Build lane: monodevelop-lion-cycle7

=== Operating System ===

Mac OS X 10.11.4
Darwin Josephs-Office-iMac.local 15.4.0 Darwin Kernel Version 15.4.0
    Fri Feb 26 22:08:05 PST 2016
    root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
Comment 1 Rolf Bjarne Kvinge [MSFT] 2016-03-28 10:15:45 UTC
@Jeff, this sounds like an MSBuild issue, can you have a look?
Comment 2 Jeffrey Stedfast 2016-03-28 17:50:34 UTC
Ah, thanks Rolf - I missed the fact that the entitlements weren't being included so it looked like a mis-file to me.
Comment 3 Jeffrey Stedfast 2016-04-06 15:21:38 UTC
this was fixed last week, guess I forgot to close it
Comment 4 Joseph Hanna 2016-04-06 20:11:25 UTC
Thanks for fixing it so quickly. When will it be released on the alpha channel?
Comment 5 Jeffrey Stedfast 2016-04-06 20:37:39 UTC
Yes, I'm just not sure when the next alpha release will go out.
Comment 6 Joseph Hanna 2016-04-27 01:28:40 UTC
Hi @jeff, just noticed that the Alpha channel has been promoted to beta, but it does not include the entitlement fixes (this bug, https://bugzilla.xamarin.com/show_bug.cgi?id=40318 and https://bugzilla.xamarin.com/show_bug.cgi?id=40572).

These are critical!
Comment 7 Jeffrey Stedfast 2016-04-27 21:20:14 UTC
They should be fixed in the RC that went out today
Comment 8 Joseph Hanna 2016-05-01 01:38:44 UTC
Thanks Jeff.  We are almost there.  A new bug along the same lines has appeared.  I have created a separate ticket for it: https://bugzilla.xamarin.com/show_bug.cgi?id=40769
Comment 9 James Neno 2016-10-26 15:21:33 UTC
I am seeing this issue using the latest release version of Xamarin Studio (6.1.1, Build 15).

Is the fix still pending?

Thanks!

For reference:

Steps to reproduce the problem:
1. Configure AppGroup "group.xxxx.xxxx" on developer.apple.com, generate provisioning profile and install
2. Set XS Build Configuration to Debug | iPad X
3. Run the app that calls NSFileManager.DefaultManager.GetContainerUrl("group.xxxx.xxxx")
Comment 10 Joseph Hanna 2017-09-25 11:08:52 UTC
I would like to re-open this bug as it has reappeared in VS 7.1.5, Xamarin.iOS 11.0.0.0, Xcode 9 and both iOS 10.3.1 and iOS 11 simulators.  When I revert back to Xcode 8.3.3 SDK and keep the same Xamarin stack, it works.
Comment 11 Andy 2017-09-25 14:52:05 UTC
Yes I am seeing this issue with Xcode 9.
Comment 12 Sebastien Pouliot 2017-09-26 12:43:23 UTC
@Jeff the fix for https://bugzilla.xamarin.com/show_bug.cgi?id=59379 was merged into `xcdeo9` so it's part of XI 11.0. If this issue still exists then something else is incorrect.
Comment 13 Jeffrey Stedfast 2017-09-26 16:45:24 UTC
Joseph, Andy: could you attach build logs? Please do a Build/Clean first so that it does a complete (fresh) build. Thanks.
Comment 14 Jeffrey Stedfast 2017-09-26 16:46:41 UTC
Oh, and please go into your Visual Studio for Mac Preferences and enable "Diagnostic" level MSBuild logs in the "Projects/Build" section. Thanks!
Comment 15 Dennis Welu 2017-09-29 15:03:24 UTC
Also just discovered this issue with all the latest stuff installed. Interestingly, my iPhone7 10.3.1 simulator, which maintained its state through the install of new XCode and additional simulators and has my app installed on it already, still returns a good value for GetContainerUrl. It's just any new simulator that I try that has the problem...
Comment 16 Nikolai Doronin 2017-10-02 15:58:55 UTC
It still occurs with Xamarin.iOS 11.0.0.0 and Xcode9.
Comment 17 Sarah Tolsma 2017-10-03 21:01:03 UTC
Seeing the same issue for our app. Install details:

Visual Studio Community 2017 for Mac
Version 7.1.5 (build 2)
Installation UUID: 80d335b8-8e5b-4533-8c23-9ecbf4429676
Runtime:
	Mono 5.2.0.224 (d15-3/14f2c81) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000224

NuGet
Version: 4.3.0.2418

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	1.1.1
	1.0.4
SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
SDK Version: 1.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler
Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Apple Developer Tools
Xcode 9.1 (13526)
Build 9B37

Xamarin.iOS
Version: 11.0.0.0 (Visual Studio Community)
Hash: 152b654a
Branch: xcode9
Build date: 2017-09-15 02:25:56-0400

Xamarin.Android
Version: 7.4.5.1 (Visual Studio Community)
Android SDK: /Users/Sarah/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		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)
		5.1    (API level 22)
		6.0    (API level 23)
		7.0    (API level 24)
		7.1    (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 26.0.1

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Xamarin Inspector
Version: 1.3.1
Hash: cbc48dd
Branch: 1.3-release
Build date: Thu, 21 Sep 2017 19:52:53 GMT
Client compatibility: 1

Xamarin.Mac
Version: 3.6.3.3 (Visual Studio Community)

Build Information
Release ID: 701050002
Git revision: 7afedcaef8e7542e70e3cf8f9bdb26938b8c0876
Build date: 2017-09-15 08:39:58-04
Xamarin addins: 3262aadf811a18c12eac6742532d052b0139a808
Build lane: monodevelop-lion-d15-3-xcode9

Operating System
Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Comment 18 Rolf Bjarne Kvinge [MSFT] 2017-10-05 15:45:08 UTC
This looks like a dup of bug #59379 (which we'll try to fix for the same-day release corresponding with Xcode 9.1)

*** This bug has been marked as a duplicate of bug 59379 ***
Comment 19 Jonathan ANTOINE 2017-10-11 17:19:09 UTC
Hello,

Is there a workaround to be able to test our app on a simulator :) ?

Regards

Note You need to log in before you can comment on or make changes to this bug.