There are a couple issues here:
In MOE there are 2 types of resources:
- resources in the application.jar - this are created from the jar file dependendencies, and optionally from the source paths (as you wrote above). These resources are only accessible to Java
- resources in the iOS app (that were copied there using the Xcode build). These are accessible from Java code and from native code. These are not automatically added from src/main/resources, one has to add them manually to the Xcode project, so the resource copy build phase copies them to the built app.
Our intention was that
Class.getResourceAsStream() should access the iOS app resources as well, so we added the iOS app folder to the classpath, and it works fine if the system class loader (
ClassLoader.getSystemClassLoader()) or a child of it (like e.g. the
Thread.currentThread().getContextClassLoader()) is used. However, in MOE all classes are loaded from a single image on the boot class path. So when you are trying to load an iOS resource with
X.class.getResourceAsStream(), it won’t work in MOE 1.2.
We will be working on resolving these issues for MOE 1.3.
I created a GitHub issue for tracking.