Enterprise app already installed?

We have a weird problem with installing enterprise apps here. When the InstallApplication plist is sent to the device to install an app, the device responds with a message saying the app is already installed when it's clearly not.


Request to device:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
  <key>CommandUUID</key>
  <string>InstallApplication;Collection=901</string>
  <key>Command</key>
  <dict>
  <key>RequestType</key>
  <string>InstallApplication</string>
  <key>ManifestURL</key>
  <string>https://annbarasi-2534.csez.zohocorpin.com:9383/MDM/apprepository/1/appupload/601/375/Manifest.plist</string>
  <key>ManagementFlags</key>
  <integer>0</integer>
  <key>ChangeManagementState</key>
  <string>Managed</string>
  </dict>
  </dict>
</plist>


Response from device:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
  <key>CommandUUID</key>
  <string>InstallApplication;Collection=901</string>
  <key>ErrorChain</key>
  <array>
  <dict>
  <key>ErrorCode</key>
  <integer>12025</integer>
  <key>ErrorDomain</key>
  <string>MCMDMErrorDomain</string>
  <key>LocalizedDescription</key>
  <string>The app “com.zoho.inhouse.zohochat” is already installed.</string>
  <key>USEnglishDescription</key>
  <string>The app “com.zoho.inhouse.zohochat” is already installed.</string>
  </dict>
  </array>
  <key>RejectionReason</key>
  <string>AppAlreadyInstalled</string>
  <key>Status</key>
  <string>Error</string>
  <key>UDID</key>
  <string>6b6874c6a8aa4dec928d43e0c1c25f30a11b7097</string>
  </dict>
</plist>


If we try to send a RemoveApplication plist just to be sure, the device returns a "Not Managed" status.


Request to device:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
  <key>CommandUUID</key>
  <string>RemoveApplication;Collection=901</string>
  <key>Command</key>
  <dict>
  <key>RequestType</key>
  <string>RemoveApplication</string>
  <key>Identifier</key>
  <string>com.zoho.inhouse.zohochat</string>
  </dict>
  </dict>
</plist>


Response from device:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
  <key>CommandUUID</key>
  <string>RemoveApplication;Collection=901</string>
  <key>ErrorChain</key>
  <array>
  <dict>
  <key>ErrorCode</key>
  <integer>12029</integer>
  <key>ErrorDomain</key>
  <string>MCMDMErrorDomain</string>
  <key>LocalizedDescription</key>
  <string>The app “com.zoho.inhouse.zohochat” is not managed.</string>
  <key>USEnglishDescription</key>
  <string>The app “com.zoho.inhouse.zohochat” is not managed.</string>
  </dict>
  </array>
  <key>Status</key>
  <string>Error</string>
  <key>UDID</key>
  <string>6b6874c6a8aa4dec928d43e0c1c25f30a11b7097</string>
  </dict>
</plist>


Note: This happens only in a few devices. The devices are all running iOS 9.0 and above.


Any ideas on how to fix this? We aren't able to install the app as a consequence on the said devices.

Replies

Experiencing similar behavior. Here are some cases we have seen


  • Device did not have an icon for the App on the springboard but the MDM config payload still had the app listed. Would get either 12025 or 12026 error response. Force sending an Uninstall command cleared the situation and then subsequent Install commands worked as expected.
  • Device had the App (previous version of app MDM deployed) and 12025 or 12026 is being returned when sending the install command to update the app to a new version. Manually delete app from device and errors still occur. Also with this manual delete the MDM payload no longer lists the app. Again forcing an MDM Uninstall got the MDM agent on the device back in sync and cleared up the issue.

We've had those cases too Garycp. In such cases, a RemoveApplication seems to solve the issue as you've mentioned. However, in this particular case above, it is not so. I fiddled with the issue and this is what I found.

  1. A previous version of the app in question was installed on the device.
  2. An updated version of the app was then installed over it using the InstallApplication command. However, the updated version was not signed properly (The distribution certificate used was different. The existing certificate got revoked.)

    This caused the app to not install. As in, the app icon appears in the app drawer, but is not usable.

  3. The app was then uninstalled manually and InstallApplication was tried again.

    Returned the response as in my original post.

  4. Tried RemoveApplication forcefully.

    Returned the response as in my original post.

We were able to solve the issue finally, if you can call wiping the entire device and restoring iOS as solving that is.

I'm guessing that the change in the provisioning profiles somehow affected the app package integrity in the MDM container. But the fact that a force RemoveApplication wasn't working is kind of worrying.

You can use Xcode to sniff profiles/provisioning on the device...next time, perhaps.

If the device was responding that the app was already installed, but not managed, you could take management of the app (iOS 9 feature) then uninstall it. If you run into that again, you may try that before having to wipe the device.


Also, as mentioned, if you're allowing the device to join computers you can use Xcode to watch the device logs and capture what is actually happening during the processing of the actions. Great troubleshooting tool.