Cant generate proper bindings moe 1.9.0, application.jar is not generated

Hello.
I use GoogleMobileAds in my apps. I updated moe to 1.9.0 from 1.8.2 and now my generated google-ads bindings are not compatible. I tried to generate new bindings (downloaded the latest GoogleMobileAds version 10.1.0 but also I tried other versions too(like 9..), the same problem).
My build.gradle:
classpath ‘com.android.tools.build:gradle:7.0.2’
classpath group: ‘org.multi-os-engine’, name: ‘moe-gradle’, version: ‘1.9.0’
I use XCode 14.2.
When I generate new bindings in IDEA with google-ads.nbc, I got the following errors:

Configuration on demand is an incubating feature.

> Configure project :
Using already downloaded SDK: /Users/noretakl/.moe/moe-sdk-1.9.0

> Task :ios-moe:moeNatJGen
2023-03-26 16:06:59:875 +0200 [main] DEBUG org.moe.natjgen.Main - NatJGen started
2023-03-26 16:07:00:278 +0200 [main] DEBUG org.moe.natjgen.Indexer - Clang options: [-arch, arm64, -x, objective-c, -fmessage-length=133, -std=c99, -fobjc-arc, -fpascal-strings, -ferror-limit=9999999, -DNS_BLOCK_ASSERTIONS=1, -DOBJC_OLD_DISPATCH_PROTOTYPES=0, -isysroot, /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk, -miphoneos-version-min=9.0, -I/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework/Headers, -I/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework/Headers, -I/var/folders/fq/q_n40mrd431gp0r_8h8mcdr00000gn/T/NatJGen9572651341131426545, -iquote/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework/Headers, -iquote/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework/Headers, -F/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework, -F/Users/noretakl/Developer/Nore/ios-moe/src/framework, -fparse-all-comments]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:371:81: error: function does not return string type
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:372:52: error: function does not return NSString
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:387:53: error: function does not return NSString
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:389:83: error: function does not return string type
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:395:114: error: function does not return string type
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:396:97: error: function does not return string type
2023-03-26 16:07:01:586 +0200 [main] DEBUG org.moe.natjgen.Indexer - Indexing translation unit
2023-03-26 16:07:07:790 +0200 [main] DEBUG org.moe.natjgen.Indexer - Clang options: [-arch, armv7, -x, objective-c, -fmessage-length=133, -std=c99, -fobjc-arc, -fpascal-strings, -ferror-limit=9999999, -DNS_BLOCK_ASSERTIONS=1, -DOBJC_OLD_DISPATCH_PROTOTYPES=0, -isysroot, /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk, -miphoneos-version-min=9.0, -I/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework/Headers, -I/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework/Headers, -I/var/folders/fq/q_n40mrd431gp0r_8h8mcdr00000gn/T/NatJGen9572651341131426545, -iquote/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework/Headers, -iquote/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework/Headers, -F/Users/noretakl/Developer/Nore/ios-moe/src/framework/GoogleMobileAds.framework, -F/Users/noretakl/Developer/Nore/ios-moe/src/framework, -fparse-all-comments]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:371:81: error: function does not return string type
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:372:52: error: function does not return NSString
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:387:53: error: function does not return NSString
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:389:83: error: function does not return string type
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:395:114: error: function does not return string type
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:396:97: error: function does not return string type
2023-03-26 16:07:08:662 +0200 [main] DEBUG org.moe.natjgen.Indexer - Indexing translation unit
2023-03-26 16:07:12:047 +0200 [main] DEBUG org.moe.natjgen.CStructManager - c:@S@__darwin_arm_neon_state64: Failed to merge secondary field types
2023-03-26 16:07:12:048 +0200 [main] DEBUG org.moe.natjgen.CStructManager - c:@S@__arm_legacy_debug_state: Failed to merge secondary field types
2023-03-26 16:07:12:048 +0200 [main] DEBUG org.moe.natjgen.CStructManager - c:@S@__darwin_arm_neon_state: Failed to merge secondary field types
2023-03-26 16:07:12:053 +0200 [main] DEBUG org.moe.natjgen.Indexer - Generating classes
2023-03-26 16:07:12:536 +0200 [main] INFO org.moe.natjgen.UnitEditContext - Getting compilation unit from /Users/noretakl/Developer/Nore/ios-moe/src/org/moe/binding/googlemobileads/GADServerSideVerificationOptions.java
…. (I skipped some similiar messages)
2023-03-26 16:07:15:483 +0200 [main] DEBUG org.moe.natjgen.Main - NatJGen ended in 15.60797317s

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 17s
1 actionable task: 1 executed

My ios-moe build.gradle (I took it somewhere a lot of years ago and it worked):

// Exclude all files from Gradle's test runner
test { exclude '**' }

task copyNatives doLast {
    file("xcode/native/ios/").mkdirs();
    def LD_FLAGS = "LIBGDX_NATIVES = "
    configurations.natives.files.each { jar->
        def outputDir = null
        if (jar.name.endsWith("natives-ios.jar")) outputDir = file("xcode/native/ios")
        if (outputDir != null) {
            FileCollection fileCollection = zipTree(jar)
            for (File libFile : fileCollection) {
                if (libFile.getAbsolutePath().endsWith(".a") && !libFile.getAbsolutePath().contains("/tvos/")) {
                    copy {
                        from libFile.getAbsolutePath()
                        into outputDir
                    }
                    LD_FLAGS += " -force_load \${SRCROOT}/native/ios/" + libFile.getName()
                }
            }
        }
    }
    def outFlags = file("xcode/ios-moe/custom.xcconfig");
    outFlags.write LD_FLAGS

    def proguard = file("proguard.append.cfg")
    if (!proguard.exists()) {
        proguard = new File("proguard.append.cfg")
        proguard << "\n-keep class com.badlogic.** { *; }\n"
        proguard << "-keep enum com.badlogic.** { *; }\n"
    }
}

sourceSets.main.java.srcDirs = [ "src/" ]

// Setup Multi-OS Engine
moe {
    xcode {
        project 'xcode/ios-moe.xcodeproj'
        mainTarget 'ios-moe'
        testTarget 'ios-moe-Test'
    }

    remoteBuild {
        resources = [ file("../android/assets") ]
    }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
moeMainReleaseIphoneosXcodeBuild.dependsOn copyNatives
moeMainDebugIphoneosXcodeBuild.dependsOn copyNatives
moeMainReleaseIphonesimulatorXcodeBuild.dependsOn copyNatives
moeMainDebugIphonesimulatorXcodeBuild.dependsOn copyNatives

// Setup Eclipse
eclipse {
    // Set Multi-OS Engine nature
    project {
        name = appName + "-ios-moe"
        natures 'org.multi-os-engine.project'
    }
}

Despite the errors during the bindings generation bindings files are generated. But if I try to run moe-Launch (or other moe tasks) I get this:
ios-moe/src/org/moe/binding/googlemobileads/GADNativeAdView.java:5: error: cannot find symbol
import apple.corefoundation.struct.CGRect;
^
symbol: class CGRect
location: package apple.corefoundation.struct

and the same problem for CGSize.

I found these classes in another package: apple.coregraphics.struct and I replaced the package. Now it is compiled but I can’t run app in XCode because there is no application.jar! Application.jar is not generated anymore and I do not have any errors/warning logs about it. I can run gradle build and it works, but application.jar is not created…

I spent months to fix this problem, but I failed (
Could you please give me a hand?

Kind regards
Looking forward to your answer

Hi Noretakl,

I also updated my MOE project from 1.8.2 to 1.9.0. I used CocoaPods to add some libs to my project , also used the google bind here.
Builded successfully with Xcode 14.2 , but I don’t have the same problem as you.

I hope you have found a way to solve this problem, if you haven’t I hope I can help you.

Have a nice day.

Hi @npc19942000 ,

the issue was further discussed on the discord server and solved there!
In short, if you regenerate bindings with MOE 1.9.0, you will probably also run into the package discrapancy.

This was fixed in version 1.10.0-SNAPSHOT.

I don’t remember what was up with the application.jar, but it was also fixed.

Hi @Berstanio,

Glad to know this! Anyway I just joined discord days ago, and I’m currently testing MOE SNAPSHOT versions 1.9.1 and 1.10.0 on my iOS projects.

And these projects seem to work well and stably, very appreciate and thank you for your efforts.