MDM Install Application Error "iTunes Store ID of the Application could not be validated" in iOS 9.3.2

We are facing the following issue while sending an InstallApplication command to an iOS device. The app we are trying to install is NOT purchased through VPP. It is a free App Store application only. We get an error response saying "iTunes Store ID of the Application could not be validated".

Further performing some tests, we noticed the following:


1. We tried removing the key "ChangeManagementState" key, and the InstallApplication command works perfectly without any error! (Right now, we are looking into this option as a temporary workaround.)


2. This error is returned for any app that does not belong to the Apple ID's purchase history. Let us say, App A was never installed by the Apple ID "ID1". If I send InstallApplication command for this app, and try to install using ID1, I always get this error. However, if I manually install this app once from App Store (using ID1) and uninstall it. And now try to send the InstallApplication command, it works without any error.


3. Seems to occur in the latest iOS 9.3.2 version. We tried in an earlier version but there were no problems.


4. VPP App Assignment does not return this error.


Did any of you face such an issue?


InstallApplication command and response dicts:


<dict>
<key>CommandUUID</key>
<string>InstallApplication;Collection=302</string>
<key>Command</key>
<dict>
<key>RequestType</key>
<string>InstallApplication</string>
<key>iTunesStoreID</key>
<integer>392790924</integer>
<key>ManagementFlags</key>
<integer>0</integer>
<key>ChangeManagementState</key>
<string>Managed</string>
</dict>
</dict>


Here is the response returned:


<dict>
<key>ErrorCode</key>
<integer>12023</integer>
<key>ErrorDomain</key>
<string>MCMDMErrorDomain</string>
<key>LocalizedDescription</key>
<string>The iTunes Store ID of the application could not be validated.</string>
<key>USEnglishDescription</key>
<string>The iTunes Store ID of the application could not be validated.</string>
</dict>
</array>
<key>RejectionReason</key>
<string>CouldNotVerifyAppID</string>
<key>Status</key>
<string>Error</string>

Replies

We are facing the same issue.

We opened a Developer Support Requests and got an answer:


"This is a bug introduced in iOS 9.3.2. The issue is if ChangeManagementState is set to Managed, iOS treats the command as if PurchaseMethod was set to 1. This is expected to be fixed in a future iOS release, but I have no further details to share at this time."


You should open a Bug Report, so that it will be logged at Apple side and my be gets faster fixed.

I can confirm this issue happening with iOS 9.3.2 as well; the workaround mentioned here worked for us:


1. We tried removing the key "ChangeManagementState" key, and the InstallApplication command works perfectly without any error! (Right now, we are looking into this option as a temporary workaround.)


With this removed the Install App command was handled successfully.

We see the same thing. I posted about it here:

https://forums.developer.apple.com/thread/48130


But your post does a much better job describing the problem and your investigation into the cause 🙂


In case it's helpful to someone else, here is what we see in the device logs:


Jun 6 19:58:29 PLTestiPhone5 mdmd[239] <Notice>: (Note ) MC: Retrieving metadata from iTunes Store for iTunes Store ID 441208302


Jun 6 19:58:30 PLTestiPhone5 mdmd[239] <Notice>: (Error) MDM: Could not retrieve iTunes Store metadata with error: Error Domain=SSErrorDomain Code=141 "(null)" UserInfo={failureMessage=License not found, failureType=9610}


Jun 6 19:58:30 PLTestiPhone5 mdmd[239] <Notice>: (Error) MDM: Command Status: Error

Error: NSError:

Desc : The iTunes Store ID of the application could not be validated.

US Desc: The iTunes Store ID of the application could not be validated.

Domain : MCMDMErrorDomain

Code : 12023

Type : MCFatalError


No confirmation, at this time, that this will be fixed in 9.3.3...


Thanks!

We are getting a similar issue (new to iOS 9.3.2) with InstallApplication request type setting ChangeManagementState to Managed.


NOTE: For InstallApplication requests we send the application bundle ID in <key>Identifier</key>, NOT <key>iTunesStoreID</key>


After user accepts the manage request, the console log shows that mdmd is crashing with a nil iTunesStoreID

Jul 8 16:29:26 Mo6 mdmd[3384] <Notice>: (Note ) MC: Alert dismissed with response: Primary button selected
Jul 8 16:29:26 Mo6 mdmd[3384] <Notice>: (Note ) MDM: User accepted management of “Hipchat”
Jul 8 16:29:26 Mo6 mdmd[3384] <Notice>: (Note ) MDM: User consented to management of app Hipchat
Jul 8 16:29:26 Mo6 mdmd[3384] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** setObjectForKey: object cannot be nil (key: iTunesStoreID)' *** First throw call stack:
(0x183292db0 0x1828f7f80 0x183178494 0x1978d0918 0x182cdd4bc 0x182cdd47c 0x182ce94c0 0x182ce0f80 0x182ceb390 0x182ceb0b0
0x182ef5470 0x182ef5020)


This behavior does not occur in iOS 9.2.x.


Workaround:

If we set iTunesStoreID in the InstallApplication request and omit the Identifier payload, the ChangeManagementState does succeed. We'd rather not have to lookup an iTunesStoreID via the itunes REST API for every bundle ID.


Payload that crashes mdmd on iOS 9.3.2, works fine on iOS 9.2.x - note the 'Identifier' key.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-/ <plist version="1.0">
<dict>
<key>ChangeManagementState</key>
<string>Managed</string>
<key>Configuration</key>
<dict/>
<key>Identifier</key>
<string>com.hipchat.ios</string>
<key>ManagementFlags</key>
<integer>5</integer>
<key>pushTarget</key>
<dict>
<key>name</key>
<string>USER</string>
<key>ordinal</key>
<integer>1</integer>
</dict>
<key>RequestType</key>
<string>InstallApplication</string>
</dict>
</plist>


Workaround payload that works fine with mdmd on iOS 9.3.2 - replace the 'Identifier' key and string with this 'iTunesStoreID' key

<key>iTunesStoreID</key>
<integer>418168984</integer>


Filed as rdar://27302689


I will try the workaround mentioned above of omitting the ChangeManagementState key, but worry that it will wipe the user's documents.

Thanks for the problem explanation! Removing "Changemanagementstate" helped me fix this issue.

When you remove the changemanagementstate, are you able to manage the applications? and by manage the applications i mean are you able to delete them?