Robovm iOS app launching and signing issues
Written by Kees van Dieren
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
Clean cached build output
Robovm Gradle plugin uses incremental build. Sometimes the build output becomes invalid (probably when updating signing information).
Run the following command in the Robovm sub-project:
gradlew clean
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. Some commands to help reset everything.
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.
launchIOSDevice: LibIMobileDeviceException: LOCKDOWN_E_INVALID_CONF
It fails with the following stacktrace:
...
Caused by: org.gradle.api.GradleException: Failed to launch IOS Device
...
Caused by: org.robovm.libimobiledevice.LibIMobileDeviceException: LOCKDOWN_E_INVALID_CONF
at org.robovm.libimobiledevice.LockdowndClient.checkResult(LockdowndClient.java:133)
This could be caused by your device not yet trusting your computer.
Open iTunes app on computer. iTunes will ask: “Do you want to allow this computer to access information on {device name}?”
- Choose
Continue
. - On your device tab ‘Trust’ to trust the computer.
launchIOSDevice: ApplicationVerificationFailed
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.
Steps:
- shutdown Xcode
- execute
rm ~/Library/MobileDevice/Provisioning\ Profiles/*
- download all required provisioning profiles using
fastlane sigh download_all
orXcode
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.
Custom entitlements (Application Services) incorrectly configured
in robovm.xml
, custom Entitlements (Application Services) files can be configured (property iosEntitlementsPList
, often filename Entitlement.plist.xml
is used). Services configured in Entitlement.plist.xml
must be enabled in Application Services
Apple Member Center. When there is a mismatch between Application Services and Entitlements, ApplicationVerificationFailed
will be thrown.
Disable Gradle deamon
Robovm plugin doesn’t work well with the Gradle Deamon. Sometimes files are locked by old daemon processes.
- Disable daemon in gradle.properties
- Stop existing processes using
./gradlew -stop
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
Kees van Dieren, CEO
We've years of experience helping startups and scale-ups to work more efficient by creating apps that are fit their needs.
Let’s talk. We look forward to exploring the opportunity to help your company too.
Go ahead and send us a message. We look forward to exploring the opportunity to help you too.