question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Publishing maui rc2 app to App Store not working -- The app references non-public symbols in MyContactNetwork.MobileMaui: _proc_pidinfo

See original GitHub issue

Description

I’m running into an App Store rejection issue with .NET 6.0 RC 2 + MAUI + iOS + WebView.Maui:

ITMS-90338: Non-public API usage - The app references non-public symbols in MyContactNetwork.MobileMaui: _proc_pidinfo. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/

I believe that the offending package is System.Diagnostics.Process, which I’m guessing is referenced (and so ILLink won’t remove, no matter what) because of this line:

https://github.com/dotnet/runtime/blob/1c7100b0c21a2af147362c7b5c61408611743ded/src/libraries/Common/src/Interop/OSX/Interop.libproc.GetProcessInfoById.cs#L93

which is called by

https://github.com/dotnet/runtime/blob/main/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.OSX.cs

I tried adding the System.Diagnostics.Process.dll to the trimmer exceptions but it didn’t work - I believe something in your code is referencing it.

ILinker build output:

ILLink: Processing embedded substitution descriptor ILLink.Substitutions.xml from System.Diagnostics.Process, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Assembly System.Diagnostics.Process, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a : skipped (SDK)
         ILLink: Reduced '11' instructions in conditional branches for [System.Diagnostics.Process, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] method System.SR.GetResourceString(String)
         ILLink: Reduced '4' instructions in conditional branches for [System.Diagnostics.Process, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] method System.SR.Format(String,Object)
         ILLink: Reduced '236' instructions in conditional branches for [System.Diagnostics.Process, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] method System.Diagnostics.Process.StartCore(ProcessStartInfo)
ILLink: Reduced '5' instructions in conditional branches for [System.Diagnostics.Process, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] method System.SR.Format(String,Object,Object)
 ILLink: Reduced '1' instructions in conditional branches for [System.Diagnostics.Process, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] method System.Diagnostics.ProcessWaitState.Holder.Finalize()

Repro: Build the base MAUI Blazor template in Release+iOS+ARM64 and publish to App Store TestFlight, using the following in csproj:

<RuntimeIdentifier Condition="$(TargetFramework.Contains('-ios')) AND '$(Configuration)' == 'Release'">ios-arm64</RuntimeIdentifier>

Configuration .NET 6 rc2 MAUI Single Project Blazor + MAUI.WebView iOS ARM64 Build

Regression? Similar issue: https://github.com/dotnet/runtime/issues/57931

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
josephatkuviocommented, Nov 5, 2021

I can confirm this issue on a dotnet new MAUI Blazor and MAUI template, in release/ios-arm64. After release linking, System.Diagnostics.Process.dll is still part of the app bundle, and proc_pidinfo is not linked out, even when the linker is explicitly told to link this DLL. So there’s gotta be a direct reference somewhere within MAUI or its libraries, I just haven’t found it yet.

dotnet new maui:

admin@DXT037 Maui.New % grep -r pidinfo .
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/Maui.New matches
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.llvm.o matches
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s.opt.bc matches
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s.bc matches
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.o matches
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:	.no_dead_strip wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_threadinfo__int
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_threadinfo__int:
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl _proc_pidinfo
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:	.no_dead_strip wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_ulong__int
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_ulong__int:
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl _proc_pidinfo
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:	.no_dead_strip wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_taskallinfo__int
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_taskallinfo__int:
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl _proc_pidinfo
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_threadinfo__int
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_ulong__int
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_taskallinfo__int

dotnet new maui-blazor:

admin@DXT037 mauiblazor.new % grep -r pidinfo .
Binary file ./obj/Release/net6.0-ios/iossimulator-x64/linked/System.Private.CoreLib.dll matches
Binary file ./obj/Release/net6.0-ios/iossimulator-x64/linked/System.Diagnostics.Process.dll matches
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/MauiBlazor.New matches
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.llvm.o matches
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s.opt.bc matches
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s.bc matches
Binary file ./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.o matches
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:	.no_dead_strip wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_threadinfo__int
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_threadinfo__int:
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl _proc_pidinfo
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:	.no_dead_strip wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_ulong__int
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_ulong__int:
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl _proc_pidinfo
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:	.no_dead_strip wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_taskallinfo__int
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:wrapper_managed_to_native_Interop_libproc_proc_pidinfo_int_int_ulong_Interop_libproc_proc_taskallinfo__int:
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl _proc_pidinfo
./obj/Release/net6.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Diagnostics.Process.dll.s:bl wrapper_managed_to_native_Interop_libproc_pr
1reaction
eerhardtcommented, Nov 10, 2021

Looks to be the same issue as https://github.com/dotnet/runtime/issues/61265. I will have a fix up for both shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Store Connect Operation Error
Here are the errors I'm getting: App Store Connect Operation Error Your app contains non-public API usage. Please review the errors, correct them,...
Read more >
Troubleshoot known issues - .NET MAUI
This article describes some of the known issues with .NET Multi-platform App UI (.NET MAUI), and how you can solve or work around...
Read more >
MAUI App Cannot Be Uploaded to Apple App Store ...
I get all the way through the process on Xcode, and it fails at the end with the error message "Invalid App Store...
Read more >
Microsoft doesn't care about publishing MAUI macOS apps ...
Microsoft doesn't care about publishing MAUI macOS apps to Apple Mac store. I built an open source MAUI Blazor app and I made...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found