MobileUI LogoMobileUI
/

Fix RoboVM Resource Handling


There are cases, where resources from the folder app-common/src/main/resources don't find their way into the iOS application. This is a known bug with RoboVM's IDEA plugin. If you are working with resources such as translation files or Micronaut configurations, you need to apply the following work-around.

1. Add a Gradle task to the file app-ios/build.gradle

Add the following Gradle task to your app-ios module build file. It copies the resources from app-common to the build folder of the app-ios module.

app-ios/build.gradle
task copyCommonResources(type: Copy) {
    from "$rootDir/app-common/src/main/resources"
    into "$buildDir/classes/java/main"
}

Note: Since MobileUI 0.5.1, the MobileUI plugin generates this task when creating a new project.

2. Configure your RoboVM run configuration to run this task

  • Please open your RoboVM run configuration from the run menu

robovm resources gradle0

  • In the Before launch section add an entry to Run Gradle task

robovm resources gradle1

  • Select the project app-ios and enter the task name copyCommonResources

robovm resources gradle2

  • Use the arrows keys to make the Gradle task the first task to be executed before launching.

robovm resources gradle3

  • Apply these settings and cross your fingers. It should work now!