google / j2objc

A Java to iOS Objective-C translation tool and runtime.
http://j2objc.org
Apache License 2.0
5.99k stars 968 forks source link

JSON.xcframework contains wrong module.modulemap #2111

Closed sarsonj closed 1 year ago

sarsonj commented 1 year ago

Hi,

I made a build of j2objc - the current master branch. It looks like there is an issue in Makefile when creating JSON.xcframework. The framework contains .modulemap from JRE framework:

module JRE {
  umbrella header "JRE.h"

  export *
  module * { export * }
}

instead of

module JSON {
  umbrella header "JSON.h"

  export *
  module * { export * }
}

The problem is in framework.mk file, the path to modulemap $(BUILD_DIR)/module.modulemap for JRE and JSON is the same, so that it is used for JSON.xcframework as well.

adil-hussain-84 commented 1 year ago

The implication of all the subset frameworks (including JSON.xcframework) having a module name of JRE is that Xcode throws an error when two or more of them are linked to the same target.

The exact error that Xcode produces is as follows:

Multiple commands produce 'path/to/Build/Products/Debug-iphonesimulator/include/module.modulemap'

@tomball @litstrong: Could I ask one of you to review Pull Request #2182 when you get a moment please 🙏