0

We have recently migrated an application from Xamarin to MAUI. The application works fine in development environments, but in CI builds are producing Ad-Hoc .ipa files that can not be installed on correctly registered devices. Attempting to install the ipa on devices registered in the portal results in the error message "This app cannot be installed because its integrity could not be verified."

We have confirmed that:

  • The same certificates and provisioning profiles on the same build machine are still being used by the release branch (Xamarin vFinal) to build Ad-Hoc ipa files which successfully install. Certificates are not expired. Provisioning profile is not expired. Devices are registered in the profile on the apple developer portal and downloaded to the machine via XCode.
  • The app identifier, assembly name, and all relevant Info.plist values appear to be the same (although the old app previously only supported iPhone where the new app also supports iPad, if that is relevant).
  • The OS version is compatible.
  • Previous versions of the app have been completely removed from the device.
  • Extracting (unzipping) the Xamarin and MAUI ipa files shows they have identical embedded.mobileprovision files.
  • When uploaded to diawi, the output of the MAUI build identifies itself as an Ad-Hoc build of the same app, using the same provisioning profile and the same device list.

diawi screenshot showing an Ad-Hoc build with 43 provisioned devices and a valid future expiration date

Looking around the internet, a lot of people imply that there's a large number of possible causes for this error message but I don't see a particularly definitive list. The only ones that seem to come up frequently are provisioning profile/certificate mismatch or devices not being registered in the developer portal, all of which we've verified in multiple ways.

Can anyone provide a comprehensive list of any additional potential causes that we can look into in order to find the cause/solution for our problem?

IMPORTANT: "Just use TestFlight" is not an answer to this question and will be down-voted as such. Just trying to get ahead of this since that seems to be a common railroad to other questions related to this error. We already use TestFlight but have a CI/CD process that allows Ad-Hoc testing which we wish to continue to support.

We don't see any documentation that suggests we shouldn't be able to do this anymore and it's unclear what the cause/difference is, besides migrating to MAUI (one difference to this is that the CI build now uses dotnet publish instead of msbuild from the now-discontinued VS for Mac).

Edit (per questions in the comments):

These are the only configuration-specific MSBuild properties in the csproj, but I should note that these were from earlier trial-and-error trying to copy some values from the old Xamarin csproj and didn't fix anything. The command line arguments mentioned below now override these values with ones that seems to produce the right results in the build log text (identifying the correct cert and provisioning profile), though we still se the install error.

MSBuild properties:

  <PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Ad-Hoc'">
    <CodesignKey>Iphone Distribution</CodesignKey>
    <CodesignProvision>Automatic:AdHoc</CodesignProvision>
    <ArchiveOnBuild>true</ArchiveOnBuild>
  </PropertyGroup>

Current command line overrides (based on values generated by connecting to the build agent mac from VS and selecting values in the project properties drop-downs based on this documentation):

dotnet publish -c Ad-Hoc -f net8.0-ios -p:ProvisioningType="manual" -p:CodesignProvision="" -p:CodesignKey="Apple Distribution" -p:ArchiveOnBuild=true -p:Version=%build.number% -p:FileVersion=%build.number% -p:RunInTeamCity=true -p:OutputPath=AdHoc %teamcity.build.checkoutDir%/src/<SolutionDir>/<SolutionFile>.sln
11
  • 1
    Not sure how your CI work. But I just generated a default MAUI ipa(ad-hoc) following the steps in Publish an iOS app using the command line and installed successfully on the iOS device. You may try the command dotnet publish -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 . Commented Aug 8, 2024 at 3:09
  • 1
    Can you add your build config from .csproj? Usually a property group something like <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-ios|AnyCPU'"> Side note. . . I spent DAYS solving exactly this problem, only in azure, and confirmed provisioning cirtificates in multiple ways too. The ONLY thing that showed the provisioning mismatch was looking at binlogs with Structured Log Viewer. Have you confirmed the profiles used that way yet? Commented Aug 8, 2024 at 10:34
  • @tonyedwardspz I usually do use binlogs though I haven't yet as this CI build is rather different than our typical build templates and it's not currently generating or artifacting one, though I think that's a simple enough change and a good idea, though the build output text does specifically say which cert/profile it's using and they look correct, though it's still an improvement worth making so we will. I'll see about updating the question with some configuration-specific properties. Commented Aug 9, 2024 at 15:09
  • @LiqunShen-MSFT we are indeed using dotnet publish and are producing an arm64 ipa successfully, although this is an Ad-Hoc build, not the Release build; the ipa simply doesn't allow installation on registered devices. Commented Aug 9, 2024 at 15:10
  • 1
    @TheXenocide Yeah. . . the output text always said it was using the right one for me too! Good luck tracking this down. Commented Aug 10, 2024 at 10:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.