We sometimes have troubles running our apps on a real device or creating the production ipa. Often related to issues with provisioning profiles and signing. Robovm error messages are very generic, which makes it hard to find the root cause. On this document, we provide some suggestions to resolve these kind of errors.
Learn the basics of distribution, signing and provisioning
Apps signing and provisioning is fairly complicated. Understanding the basics is important to be productive. Some articles to learn about the basics:
- Apple App Distribution documentation
- Blog article: Demystifying iOS provisioning part 1
- Blog article: Demystifying iOS provisioning part 2
Use fastlane sigh to fix broken provisioning profiles
fastlane sigh can create, renew, download and repair provisioning profiles (with one command). It supports App Store, Ad Hoc, Development and Enterprise profiles and supports nice features, like auto-adding all test devices.
It is able to repair all broken / expired profiles and install them on the Mac work station. Commands to solve it:
Repair all production profiles:
fastlane sigh repair
Repair all development profiles:
fastlane sigh repair --development
Download all provisioning profiles to the local machine:
fastlane sigh download_all
Create a simple Xcode project that uses your bundle id
Robovm warnings are often very generic; Xcode provides much more specific error messages.
Simple strategy is to create a simple test app in Xcode, change its bundle id to the one used by Robovm. Try to run it on the device, and resolve any errors. Make sure that Xcode has the same provisioning profiles and signing identities selected as configured in the Robovm project.
Exception shown in gradle console:
Caused by: org.robovm.libimobiledevice.LibIMobileDeviceException: ApplicationVerificationFailed Sometimes this is caused by old Provisioning profiles saved on the developer machine. Removing old profiles sometimes does help.
- shutdown Xcode
rm ~/Library/MobileDevice/Provisioning\ Profiles/*
- download all required provisioning profiles using
fastlane sigh download_allor
Verify that your device trusts your app
On the iOS device, Open Settings, navigate to General > Device Management, then select your Developer account and trust the apps listed there.
Wildcard development profile and custom entitlements
Wildcard development Provisioning Profiles cannot be used with custom entitlements (also called Application Services in Apple Member Center).
Citing Apple developer:
“Because an App ID specifies a unique configuration of entitlements, Wildcard App IDs are for use with code signing all apps that do not enable app-specific capabilities. Those capabilities are pictured as follows:”
So always create a custom Development Provisioning Profile when custom entitlements (application services) are used by an app.
Disable Gradle deamon
Robovm plugin doesn’t work well with the Gradle Deamon. Sometimes files are locked by old deamon proceses.
- Disable deamon in gradle.properties
- Stop existing processes using
Clear Robovm cache
Robovm caches lots of its stuff in ~/.robovm. Clear this cache using command:
rm -rf ~/.robovm/
Check Keychain Access for expired certificates
Check if any
iPhone Developer or
iPhone Distribution certificates have been expired. Remove expired certificates.
iOS 11 no longer supports 32-bit apps
iOS 11 requires 64-bit mode. Robovm by default uses 32-bit, which is no longer supported by iOS 11. Gradle launch command for 64-bit mode:
./gradlew -Probovm.arch=arm64 launchIOSDevice