maui
maui copied to clipboard
App requesting NSBluetoothAlwaysUsageDescription
Description
When I submit my app to TestFlight I now get an email with the following:
ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “APPNAME.app” bundle should contain a NSBluetoothAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources.
In previous submissions this never occurred, and I even tried submitting a prior release (which never had this issue before) but it now also too receives the email.
I understand I could add a NSBluetoothAlwaysUsageDescription key to the info.plist however I'd rather know what is causing / has caused this to occur as we do not use this permission, or any Bluetooth permission in the app.
Xcode version is 15.1 beta3 (has not been updated or changed since it started happening)
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
8.0.3
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
8.0.3
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
May be any library you are using has some code calling these Api's. If those are open source you should check there code
This will be pretty hard to figure out if this is a us or you problem. I would highly doubt this is something that originates in .NET MAUI. As mentioned: do you have any third-party libraries that you are using?
If you want to be really sure that this is an issue with .NET MAUI, can you create a new blank .NET MAUI app and submit that and see if you get the same feedback? If you do, there is something wrong on our side, if you don't it is something that is specific to your project.
Hi @Beryl0. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
This will be pretty hard to figure out if this is a us or you problem. I would highly doubt this is something that originates in .NET MAUI. As mentioned: do you have any third-party libraries that you are using?
If you want to be really sure that this is an issue with .NET MAUI, can you create a new blank .NET MAUI app and submit that and see if you get the same feedback? If you do, there is something wrong on our side, if you don't it is something that is specific to your project.
Thanks, wasn't sure if there was a way to scan / locate the root cause but will try this.
Also, didn't realise this would remove s/needs-info, apologies.
This will be pretty hard to figure out if this is a us or you problem. I would highly doubt this is something that originates in .NET MAUI. As mentioned: do you have any third-party libraries that you are using?
If you want to be really sure that this is an issue with .NET MAUI, can you create a new blank .NET MAUI app and submit that and see if you get the same feedback? If you do, there is something wrong on our side, if you don't it is something that is specific to your project.
Unfortunately I've created a blank .NET MAUI project and submitted it and it is still giving the same issue.
Updated to Xcode 15.2 but still the same too.
Oh, good, so it's not just me. I'm trying to figure out what to say in the purpose string. When I launch the app, it doesn't ask about Bluetooth AFAICT, and while I've installed it on a phone I don't see the app listed in Privacy & Security >> Bluetooth. So, I'm just going to say "Bluetooth is not actually required to use this app", and hope that doesn't get it rejected.
I'm having the same issue. The Info.plist from the generated ipa file doesn't have any key related to NSBluetoothAlwaysUsageDescription but the permission windows keeps appearing. When I go to Settings and lookup my app, I see that the permission for Local Network appears
Also ran into this problem. Nothing is using Bluetooth
We just converted from Xamarin to .NET8 and are now also facing this issue. This might become a problem getting this approved in the Apple Store, so I think it's important that this gets fixed in .NET8
We just converted from Xamarin to .NET8 and are now also facing this issue. This might become a problem getting this approved in the Apple Store, so I think it's important that this gets fixed in .NET8
I did have success manually adding a key to the plist file to the effect of " we do not require this permission but it is referenced in dotnet maui " app was accepted
Until it's solved there is no other option, but in the past I sometimes had submissions that were refused due to wrong purpose strings while the strings had been in there for ages. So what I am trying to say is just because the submission was accepted now it doesn't mean it can't be rejected another time on this purpose string. And if that happens there is no way you can resolve it.
I have the same problem. Any news on plans to solve this ?
Saw a link on Stack Overflow. Hopefully it helps. Stack Overflow link
@jfversluis Beryl0 stated on januari 16 it's reproducable with a blank MAUI project. So this seems to be a MAUI problem then. Can anyone look into this ? The dummy NSBluetoothAlwaysUsageDescription might work as a quick fix but if some Apple reviewer sees this it will probably get rejected. Also I think Bluetooth stuff shouldn't be in the app when it's not necessary just out of security reasons.
@JeroenBer unfortunately when I create a blank MAUI app I don't see it, hence I'm asking for a reproduction from your side.
My blank MAUI project might not be yours as templates get updated over time, or we might be using different versions to build our apps, which is also info that is (partly) incorporated when I see your blank MAUI project template. Just trying to pinpoint more precisely where to look for a potential cause or this.
What versions of .NET are you building with and what .NET MAUI package reference versions are you using (for example <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.20" />
)?
@Beryl0 do you still have an empty solution to reproduce this for @jfversluis as stated above ?
@Beryl0 do you still have an empty solution to reproduce this for @jfversluis as stated above ?
I do not, hopefully someone else can try replicate.
This just happen to me today, yesterday uploaded a version into store and everything was fine, then clean some code (a couple unused variables) and decide upload again and bam !! got that warning, seriously, only delete an unused i = 0; and j = 0; and got the mail from Apple, using the MAUI template with only Android and iOS using .net8 and CommunityToolkit .
To me too. Simple Maui Blazor App. No additional packages included.
@jfversluis @PureWeen I got this exact same issue when I added the following in my project file:
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and $(cfg.Contains('Release'))">
<MtouchLink>None</MtouchLink>
<UseInterpreter>True</UseInterpreter>
</PropertyGroup>
My build size went from 52Mb to 38MB compared to a build just 1 hour earlier. In addition to the problem in this post, I also got an ITMS-90899. I had two emails from Apple. This project is well established, and no new packages or updates have been applied since the previous version.
Using .net8
I doubt my DevOps team changed anything within that hour, so maybe this problem has something to do with the "UseInterpreter" tag.
I have made some enquiries with other people as to why this might be happening. In the meantime it would be really helpful to add information about the .NET versions that you are using, maybe we can see a pattern there. Also please add any third-party libraries that are in your project. Maybe even just your csproj
file so we can see all the settings and libraries there or of course a reproduction sample hosted on a public repository.
Use dotnet --info
and let us know the .NET version that you are building your app with and of course any other information that might be relevant. Be aware that if your app is built through a pipeline, the .NET version used there might be different than on your local system. Please provide the .NET version information of the machine/pipeline that built the problematic .NET MAUI app
@graymer69 adding <MtouchLink>None</MtouchLink>
will disable the linker and add ALL Apple APIs in your app which is probably not what you want and probably the cause of why you specifically are seeing this.
.NET SDK:
Version: 8.0.300-preview.24203.14
Commit: b7e38f457d
Workload version: 8.0.300-manifests.39f68c05
MSBuild version: 17.10.0+4f6b1bb28
Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\
Installierte .NET-Workloads:
[maccatalyst]
Installationsquelle: VS 17.10.34902.84
Manifestversion: 17.2.8053/8.0.100
Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.2.8053\WorkloadManifest.json
Installationstyp: FileBased
[ios]
Installationsquelle: VS 17.10.34902.84
Manifestversion: 17.2.8053/8.0.100
Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8053\WorkloadManifest.json
Installationstyp: FileBased
[android]
Installationsquelle: VS 17.10.34902.84
Manifestversion: 34.0.95/8.0.100
Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.95\WorkloadManifest.json
Installationstyp: FileBased
[maui-windows]
Installationsquelle: VS 17.10.34902.84
Manifestversion: 8.0.21/8.0.100
Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.21\WorkloadManifest.json
Installationstyp: FileBased
Host:
Version: 8.0.2
Architecture: x64
Commit: 1381d5ebd2
.NET SDKs installed:
5.0.100 [C:\Program Files\dotnet\sdk]
5.0.412 [C:\Program Files\dotnet\sdk]
7.0.400 [C:\Program Files\dotnet\sdk]
8.0.300-preview.24203.14 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
And its started again on my project...
.NET SDK:
Version: 8.0.204
Commit: c338c7548c
Workload version: 8.0.200-manifests.1f2e3bea
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.204\
.NET workloads installed:
[android]
Installation Source: SDK 8.0.200, VS 17.9.34728.123
Manifest Version: 34.0.95/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.95\WorkloadManifest.json
Install Type: FileBased
[ios]
Installation Source: SDK 8.0.200, VS 17.9.34728.123
Manifest Version: 17.2.8053/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8053\WorkloadManifest.json
Install Type: FileBased
[maui-windows]
Installation Source: VS 17.9.34728.123
Manifest Version: 8.0.7/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.7\WorkloadManifest.json
Install Type: FileBased
[maccatalyst]
Installation Source: VS 17.9.34728.123
Manifest Version: 17.2.8053/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.2.8053\WorkloadManifest.json
Install Type: FileBased
Host:
Version: 8.0.4
Architecture: x64
Commit: 2d7eea2529
.NET SDKs installed:
8.0.204 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
And my csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;</TargetFrameworks>
<!--<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>-->
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>REMOVED</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Display name -->
<ApplicationTitle>REMOVED</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>REMOVED.REMOVED.REMOVED.REMOVED</ApplicationId>
<ApplicationIdGuid>REMOVED</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0.1</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<!-- Support Versions -->
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">26.0</SupportedOSPlatformVersion>
<Version>2</Version>
</PropertyGroup>
<!-- Android Specific -->
REMOVED
<!-- iOS Specific -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<BundleResource Include="GoogleService-Info.plist" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#1F4A87" BaseSize="256,128" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignProvision>REMOVED</CodesignProvision>
<CodesignEntitlements>Platforms\iOS\Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
<CodesignProvision>REMOVED</CodesignProvision>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net8.0-ios'">
<ProvisioningType>manual</ProvisioningType>
<CodesignProvision>REMOVED</CodesignProvision>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\info.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</MauiImage>
<MauiImage Update="Resources\Images\recycling.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</MauiImage>
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
<AndroidResource Remove="Resources\Images\maps\**" />
<AndroidResource Remove="Resources\Images\toolbar\**" />
<Compile Remove="Resources\Images\maps\**" />
<Compile Remove="Resources\Images\toolbar\**" />
<EmbeddedResource Remove="Resources\Images\maps\**" />
<EmbeddedResource Remove="Resources\Images\toolbar\**" />
<MauiCss Remove="Resources\Images\maps\**" />
<MauiCss Remove="Resources\Images\toolbar\**" />
<MauiImage Remove="Resources\Images\maps\**" />
<MauiImage Remove="Resources\Images\toolbar\**" />
<MauiXaml Remove="Resources\Images\maps\**" />
<MauiXaml Remove="Resources\Images\toolbar\**" />
<None Remove="Resources\Images\maps\**" />
<None Remove="Resources\Images\toolbar\**" />
<None Remove="Resources\Raw\REMOVED.html" />
</ItemGroup>
<ItemGroup>
<None Remove="appsettings.Development.json" />
<None Remove="appsettings.Production.json" />
<None Remove="Data\GritterRoute.json" />
<None Remove="Resources\Images\REMOVED.png" />
<None Remove="Resources\Images\footericons\" />
<None Remove="Resources\Images\toolbar\" />
<None Remove="Resources\Images\maps\" />
<None Remove="Resources\Images\REMOVED.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="appsettings.Production.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="appsettings.Development.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Data\GritterRoute.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Flurl.Http" Version="4.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.5" />
<PackageReference Include="Xamarin.Build.Download" Version="0.11.4" />
<PackageReference Include="CommunityToolkit.Maui" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.3" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.3" />
<PackageReference Include="Microsoft.Maui.Controls.Maps" Version="8.0.3" />
<PackageReference Include="NuGet.CommandLine" Version="6.9.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Plugin.Firebase" Version="2.0.7" />
<PackageReference Include="Plugin.Firebase.CloudMessaging" Version="2.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Images\REMOVED.png" />
<BundleResource Include="Resources\Raw\REMOVED.html" />
</ItemGroup>
</Project>
@Beryl0 what do you mean with "it started again"? Did anything change according to you? There are a lot of third-party libraries in there, why do you think this is something triggered by .NET MAUI and not something in those?
@Beryl0 what do you mean with "it started again"? Did anything change according to you? There are a lot of third-party libraries in there, why do you think this is something triggered by .NET MAUI and not something in those?
@jfversluis So I previously created this issue as it was happening to me, but randomly it stopped. (Had just been making code changes, nothing package related).
I did recently get a new laptop, and just done a new release of the app and it the issue came back - none of those packages changed, again, it was only minor code changes done.
Hopefully others can provide their .csproj so we can rule out packages.
Also, I recall I created a blank project a while back, 0 additional non MAUI packages, and still had the issue - so fairly confident it is .NET MAUI related. https://github.com/dotnet/maui/issues/19918#issuecomment-1894361868
My very first submission to the Apple Store (ever), and I got this email...
csproj:
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>;net8.0-ios</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Redacted</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Display name -->
<ApplicationTitle>Redacted</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>Redacted</ApplicationId>
<ApplicationIdGuid>Redacted</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net8.0-ios'">
<CodesignKey>Redacted</CodesignKey>
<CodesignProvision>Redacted</CodesignProvision>
<ProvisioningType>automatic</ProvisioningType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-ios|AnyCPU'">
<ApplicationId>Redacted</ApplicationId>
<ApplicationTitle>Redacted</ApplicationTitle>
<MtouchUseLlvm>False</MtouchUseLlvm>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#000000">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</MauiIcon>
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</MauiSplashScreen>
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.61" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.61" />
<PackageReference Include="Telerik.UI.for.Maui" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="Redacted" />
</ItemGroup>
<ItemGroup>
<Compile Update="Redacted-many">
<DependentUpon>%(Filename)</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<MauiXaml Update="Redacted - many">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionitbAppleHideInfoBar="True" /></VisualStudio></ProjectExtensions>
@Beryl0 sorry it has been a minute. I understand that you think this has something to do with .NET MAUI and it probably has, however, creating a new project and doing this doesn't show this for me or a whole lot of other people else we would be seeing this issue much more and with much more engagement. Not there are 0 people in this issue though 😄 but still it seems limited.
So somehow this is specific to a specific scenario. Did you uncover something in the meantime?
You mentioned getting a new laptop, is this on Windows? From earlier output I see the dotnet --info says Windows. You are connecting to a Mac build agent to create your builds? Are you using Hot Restart at all?
Maybe with more recent .NET for iOS updates and Xcode updates this was a bug and it went away?
@rolfbjarne does this mean anything to you at all?
Let's diagnose this!
Starting with Apple's message:
Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access.
The easiest to check for is the second part: do you have an entitlement that request access to the Bluetooth stack (in Entitlements.plist)? If so, add the entry in the Info.plist as the rest of the message says, since presumably you want to access the Bluetooth stack.
However, I believe none of you are actually using the Bluetooth stack (otherwise you wouldn't be here), and don't have any corresponding entitlement.
Apple doesn't explain how they determine that you have "code references one or more APIs that access sensitive user data", so the rest is kind of guess work, but in the past this has worked.
For Bluetooth, it typically means that your app links with the CoreBluetooth framework.
You can verify this (on a Mac) by:
- Extract the .ipa you uploaded to the App Store (it's just a zip file).
- Run the following:
$ otool -l ipaExtractionDir/Payload/MyApp.app/MyApp | grep CoreBluetooth
If that returns anything like this:
name /System/Library/Frameworks/CoreBluetooth.framework/CoreBluetooth
then you're app links with the CoreBluetooth framework.
(If your app does not link with CoreBluetooth, please file an issue at https://github.com/xamarin/xamarin-macios/issues, attach your .ipa and we'll have a look)
The next part is to figure out why the app links with CoreBluetooth.
There are three main ways for this to happen:
- The linker is disabled.
- You (either directly or indirectly through other code) use a type from the
CoreBluetooth
namespace. - You use a third-party native library that depends on CoreBluetooth.
The fix for 1. is simple: enable the linker by adding this to your csproj:
<MtouchLink>SdkOnly</MtouchLink>
If your app doesn't work properly with the linker, then more work is needed on your end, but that's out of scope for this comment.
The fix for 2. is to figure out which API you're using that uses the CoreBluetooth
namespace, and stop using that API. This is often done by inspecting the assemblies from the previously extracted .ipa file using a tool such as ILSpy.
Another way is to use the ILLink Analyzer, which is described here: https://github.com/dotnet/runtime/blob/main/src/tools/illink/src/analyzer/README.md
If you have trouble understanding the results, feel free to file an issue here or ask in our Discord channel (#apple) with your findings and we'll help you investigate.
The fix for 3. is probably going to be to accept the usage of the Bluetooth stack, unless you can convince the third-party vendor to change their libraries. In any case, if you want to confirm if it's really a third-party native library that brings in the dependency on the CoreBluetooth framework, my recommendation would be to get an MSBuild binlog and inspect it (search for "CoreBluetooth"). If you need help with understanding the binlog, feel free to ask in our our Discord channel (#apple).
Please let us know if this is still an issue and if the above information helps!
Hi @Beryl0. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.