Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Observing "App needs to be updated" message when launching app on iOS 15

Tags:

We are trying to test application on iOS 15 and found that we are getting this message App needs to be updated.

Can anyone please let me know the reason behind this message? Existing users will have to delete the app and install again to get rid of this alert.

like image 292
Ankush Dhawan Avatar asked Jun 27 '21 08:06

Ankush Dhawan


People also ask

What does it mean when an app needs to be updated?

Updating your apps to the latest version gives you access to the latest features and improves app security and stability. Important: If Google determines that an app update fixes a critical security vulnerability, we may make certain app updates.

How do you tell if an app needs to be updated?

For that, open Google Play Store on your phone. Then, tap on the three-bar icon at the top-left side. Select My apps & games from it. You will see the available app updates listed under the Updates section.

How do I know if an app needs to be updated iOS?

Open the App Store. Tap your profile icon at the top of the screen. Scroll to see pending updates and release notes. Tap Update next to an app to update only that app, or tap Update All.


2 Answers

I went into the same issue with my enterprise apps, and fortunately I've managed to fix it.

There are actually two reasons that can cause this issue on iOS 15 if you're deploying your apps using an Enterprise account. The root key of the issue is a new signature format, that is required on iOS 15. App released through the App Store are automatically resigned, thus why they aren't affected by the issue.

Also, note that the main cause for this is building IPAs with older MacOS versions. If you update to latest Big Sur, you should be able to generate an IPA that is correctly signed. If you don't want to update, read the solutions below.


First reason

The first reason, documented by Apple here, is that your IPA must use the new signature format. If the IPA has been built with MacOS 10.14 or higher, it should be good. To ensure your IPA have the correct signature, use following steps:

  • Rename MyApp.ipa to MyApp.zip and unzip (you'll get a Payload folder which contains MyApp.app)
  • In Terminal, run codesign -dv /path/to/MyApp.app
  • Look in the output the value next to CodeDirectory. If you see v=20500 or v=20400, you're good. If you see a value below 20400, you need to resign your app using following command: codesign -s "Your Codesign Identity" -f --preserve-metadata /path/to/MyApp.app (ensure you do this using MacOS >= 10.14, and re-run codesign -dv /path/to/MyApp.app to ensure you now get v=20400 or v=20500)
  • Zip the Payload folder and rename it to MyApp.ipa

Try reinstalling this IPA, it should work. If it doesn't, read the second reason below.


Second reason

An other possible reason, not documented by Apple, a bit more tricky, is that you might need to re-sign your app including the DER entitlements. To check if you need to do this, do this:

  • In Terminal, run codesign -dvvvvv /path/to/MyApp.app
  • Look in the output under Page size, you should see something like this:
    -7=4ade7be00e0a7b6db853edc4843e7ece1eea646f6f13d1809f78fc50d8db461f //If this line doesn't exist or contains only 000..., you need to include DER entitlements     -6=0000000000000000000000000000000000000000000000000000000000000000     -5=1dfa58bd8ac3c4fb42142c1c4d28c436128b3a7460186a44526194fb690112bc     -4=0000000000000000000000000000000000000000000000000000000000000000     -3=ef08dbe5a7c355336e1fb571604b683ce1c54536cb59a6155a1d18387fd23f6e     -2=5b730fa46ffd405fd88da9606d82eda9af7f460f6049047afc176163326f5a7f 
  • As commented in above block, if -7 isn't existent or if it only contains 000..., then that's the reason why the IPA doesn't install properly. To fix this, follow next step
  • Run codesign -s "Your Codesign Identity" -f --preserve-metadata --generate-entitlement-der /path/to/MyApp.app to resign your app including DER entitlements. Re-run codesign -dvvvvv /path/to/MyApp.app to ensure the -7 value is now correct.
  • Zip the Payload folder and rename it to MyApp.ipa

You should be able to install the IPA now! 🎉

like image 115
AnthoPak Avatar answered Sep 18 '22 15:09

AnthoPak


I have fixed the issue with the following configuration: MacOS Big Sur(macOS 11.14) and Xcode 12.5.1.

  1. I rebuild the package with the configuration mentioned above.
  2. I uploaded the package to TestFlight.
  3. I tested on iOS 15 device. Everything works as expected. No popup.

As far as I understood the the reason of the failure is updated signature format. In iOS 15 the new format is mandatory while on iOS 14 it only gives a warning.

More information about the signature can be found here: https://developer.apple.com/documentation/xcode/using-the-latest-code-signature-format

like image 32
Dima Avatar answered Sep 19 '22 15:09

Dima