Can't build iOS module during to library conflict

I’ve got a major problem:

I recently started porting my android app to iOS using intels multi os engine. Basically I can work as I expected and there are no major problems developing the app…

…until now: When I want to implement a java module (I am using for my android app as well) to my iOS module, I can’t build the iOS module anymore. The module I am implementing uses a json.jar lib and contains some little code necessary for my app. The problem has to do something about the json.jar library implementation as I am getting the following error:

Pending exception java.lang.NoSuchMethodError: No virtual method iterator()Ljava/util/Iterator; in class Lorg/json/JSONArray; or its super classes (declaration of ‘org.json.JSONArray’ appears in /Users/censored/.moe/moe-sdk-1.3.6/sdk/moe-core.dex)

I really don’t know what’s the problem as this setup works well with my android module. I hope someone has experienced that problem as well and found a solution willing to share it here!

Thanks in advance.

Additional screenshots:

Note: The last image shows the module which I am accessing via code and is causing the error message above. (It uses it’s json module dependency)

If you have any other questions or information requirements, please tell me!

Hard- and Software info

  • latest version of android studio (2.3.3)
  • latest version of multi os engine plugin (1.3.2)
  • I am developing on a MacBook with latest OS X version (10.12.5)

Hi,

this is a known issue, it came up earlier in the forums:

MOE includes Android’s version of the JSON library, and in MOE 1.x the standard library and your app is loaded by the same ClassLoader, which causes this clash.

Could you please try out your app with MOE 2.0 alpha 1? We changed the ClassLoading logic in 2.0 quite a bit, and that might fix this issue. You can find the instructions for trying out the 2.0 alpha here:

Best Regards,
Gergely

1 Like

@kisg

Thanks a lot man. Very fast support, nice and detailed explained. And most of all: It worked!

I am myself also thought about an conflict with the android json lib… anyway: I like the work you guys are doing.

Keep it on!

Have a nice day!
Mikis Wöhrmann

Hi Gergely

Is there a solution for this problem with MOE 1.3?

Best Regards,
Roman

Try JarJar or any other repacking tools to repack the external JSON library into another package.

Thank you. It works now.