I’m building an app on Blazor MAUI.
Android works fine (Debug and release).
I pushed the code on my local mac device for debugging. Same Visual Studio version.
When working on iOS, I face an issue where the "debug" mode to my iPAD seems to return a "Failed to Codesign" error.
Here’s the errors:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7089/tools/msbuild/iOS/Xamarin.Shared.targets(3,3): Error: /usr/bin/codesign exited with code 1:
/Users/userName/Documents/GitHub/doc/AppName/bin/Debug/net7.0-ios/ios-arm64/AppName.app: code object is not signed at all
In subcomponent: /Users/userName/Documents/GitHub/doc/AppName/bin/Debug/net7.0-ios/ios-arm64/AppName.app/Microsoft.CSharp.dll (AppName)
Below another error which seems to be linked to the Failed to codesign
Failed To codesign
/Users/userName/Documents/GitHub/doc/AppName/bin/Debug/net7.0-ios/ios-arm64/AppName.app: code object is not signed at all
In subcomponent: /Users/userName/Documents/GitHub/doc/AppName/bin/Debug/net7.0-ios/ios-arm64/AppName.app/Microsoft.CSharp.dll (AppName)
The app seems to build on MacOS (have a crash due to incompatibility of packages, but that’s not what I’m afraid of).
It just doesn’t want to build on my local iOS Device.
When I try to build using the iossimulator it has the same error.
Here’s my property group for ios:
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CodesignProvision>Codesign Provision</CodesignProvision>
<CodesignKey>CodeSign Key (FAKEKEY32)</CodesignKey>
<CreatePackage>false</CreatePackage>
</PropertyGroup>
I tried :
- Removing the false
- Adding some extra arguments under the
-${ProjectDir} hasn’t changed anything
-Most of the others ${} options basically crash the whole thing with a new error message- Adding the
/Users/userName/Documents/GitHub/doc/AppName/bin/Debug/net7.0-ios/ios-arm64/AppName.app/
change the problem to System.Web.dll (which is under AppName.app as well) - Adding the actual
/Users/userName/Documents/GitHub/doc/AppName/bin/Debug/net7.0-ios/ios-arm64/AppName.app/Microsoft.CSharp.dll
returns an errSecInternalComponent due tounable to build chain to self-signed root for signer xxxx
- I tried to create a new set of credentials to sign & changed from general App Development to IOS development
- Adding the
I saw this subject but it doesn’t seem to solve the problem
2
Answers
So I found a solution for my problem.
Deleting everything and made sure that all reference to any resource was mentioned once (even with the tag).
I had, for example, some resources mentioned twice in the .csproj file : Once on the
ResourcesImages*
and once as a standalone likeResourcesImagesMyImage.png
(That was a rest of something I was playing with when starting the app).Now it's working fine.
Found the solution looking at : https://github.com/dotnet/maui/issues/15144
I don’t know if you already fixed this issue. In my case the problem were two folders. First of all the Properties folder which contained CultureRecources in my case and a folder which contained .png Pictures and dome additional .dll files. After I removed them everything was working fine. Currently I search for a way to use at least everything in the properties folder. When I find a solution I will add it to this post.