Repository navigation
Description
Version of JNA: 5.5
OS: MacOS Catalina
CPU/VM: 64bit
Apple decided to increase their requirements for the MacOS AppStore. Now their validation process complains if you have 32bit libs. I tried to compile JNA on my MacOS Catalina but failed to compile so far :-/ Can you please help me with this? I would need a 64bit only version that i can sign along with the App (-Dnounpack & -Djna.boot.library.path works well enough for this). But the currently packed libjnidispatch.jnilib is not 'pure 64 bit' it seems. This is what Apple says about this:
1 package(s) were not uploaded because they had problems:
/var/folders/xg/kf0ywq0n047_6n6_tz6v2_r80000gn/T/67E702C2-6C79-4B16-966E-E8A06A19D9A2/1135308344.itmsp - Error Messages:
ERROR ITMS-90240: "Unsupported Architectures. Your executable contained the following disallowed architectures: '[i386 (in com.plaiiin.jenkinsstatus.pkg/Payload/Plaiiin Jenkins Status.app/Contents/app/natives/libjnidispatch.jnilib)]'.
New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018."
2019-12-28 07:11:32.592 altool[46752:921224] *** Error: Errors uploading '/Users/martinschwaller/Code/Plaiiin/Products/JenkinsStatus/productbuild-Plaiiin-Jenkins-Status.pkg': (
"Error Domain=ITunesTransporterErrorDomain Code=-18000 "ERROR ITMS-90240: "Unsupported Architectures. Your executable contained the following disallowed architectures: '[i386 (in com.plaiiin.jenkinsstatus.pkg/Payload/Plaiiin Jenkins Status.app/Contents/app/natives/libjnidispatch.jnilib)]'. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018."" UserInfo={NSLocalizedRecoverySuggestion=ERROR ITMS-90240: "Unsupported Architectures. Your executable contained the following disallowed architectures: '[i386 (in com.plaiiin.jenkinsstatus.pkg/Payload/Plaiiin Jenkins Status.app/Contents/app/natives/libjnidispatch.jnilib)]'. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018.", NSLocalizedDescription=ERROR ITMS-90240: "Unsupported Architectures. Your executable contained the following disallowed architectures: '[i386 (in com.plaiiin.jenkinsstatus.pkg/Payload/Plaiiin Jenkins Status.app/Contents/app/natives/libjnidispatch.jnilib)]'. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018.", NSLocalizedFailureReason=ERROR ITMS-90240: "Unsupported Architectures. Your executable contained the following disallowed architectures: '[i386 (in com.plaiiin.jenkinsstatus.pkg/Payload/Plaiiin Jenkins Status.app/Contents/app/natives/libjnidispatch.jnilib)]'. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018."}"
)
Activity
matthiasblaesing commentedon Dec 28, 2019
This is still not a QnA forum - I won't answer how-to questions here (use the referenced google group for this). I was able to keep MacOS working, but I have no mac and given the closed nature of the eco system I'm not interested in joining it. If you want to step up to improve the build, it would be great.
@dbwiddis you have some experience with macOS, if I remember correctly you said that at this time one can assume, that all Mac products are 64bit only. Is this correct? If so, dropping mac OS 32 might be an option. Or the binary build and integration for mac os could be modified to not use fat binaries, but distinct libraries.
matthiasblaesing commentedon Dec 28, 2019
One more thing: The error message is either misleading or plain wrong. The binary produced by the build contains the native code required for 32 and 64 bit:
So is it a requirement to support 64 bit (that JNA does) or is it a requirement not to support i386? The latter would be problematic.
Schwaller commentedon Dec 28, 2019
Well on my personal machine i can run JNA even with automatic unpacking but if I bundle it to an App I can't get it validated/signed if it contains i386 code. If the i386 code is hidden in a JAR it complains i cannot start an usigned lib.
So i guess u could build two separate jnilibs/dylibs (32bit and 64bit)?
Actually i think it would also be ok to drop 32bit support for mac as it is no longer needed.
Schwaller commentedon Dec 28, 2019
Btw changing jnilibs to dylibs had no effect on the validation app:
xcrun altool --validate-app -f productbuild.pkg --username [email protected] --password xyz
Some more input an apples intentions (WWDC Video): https://developer.apple.com/videos/play/wwdc2019/701/
Schwaller commentedon Dec 28, 2019
Workaround: Remove 32 bit part of jnilib with the following command (renamed from jnilib to dylib):
lipo -thin x86_64 -output libjnidispatch64.dylib libjnidispatch.dylib
Confirmed that this solves the validation app issue - might still help others to remove it by default :-)
dbwiddis commentedon Dec 28, 2019
Yes, I build/develop on macOS but I've actually never managed to successfully build JNA here... but haven't tried that hard either. The 64-bit question is a more complicated one:
I think it's fair to drop 32-bit support if we have to, but reading this thread it seems like it's not a requirement as there's a command-line workaround.
Schwaller commentedon Dec 28, 2019
Yes this seems to work fine - i wasn't aware of this option at first - sorry for that.
Anyway if Apple moves forward with only allowing signed libs the unpack option becomes unusable in the future and leaves many dev's with annoying extra build step. Maybe we could find a better solution for this? If I come across something I'll update you :)
matthiasblaesing commentedon Dec 28, 2019
Out-of-band @Schwaller asked how to approach this. This is the translated part of the email, that might be relevant for others:
After further thinking some addition:
To make this compatible, I suggest to create two new platforms:
darwin-x86darwin-x86-64These each will get single architecture binaries.
darwinwill be retained with universal binaries. A system property will be introduced to switch between the old style architecture and the new-style architecture. The property would be switch by default to the old style for JNA 5 and from JNA 6 onwards switched by default to the new style.rschmunk commentedon Feb 12, 2020
As of the start of February, this also affects whether a Java+JNA app will be notarized by Apple and not just whether you can submit it the app store. @Schwaller's suggestion of stripping the 32-bit code out of the jnilib worked for me in getting an app to successfully notarize.
rednoah commentedon Nov 9, 2020
I've encountered this issue as well, and I ended up using
dittoto extract the platform-specific binary from the multi-arch binary for MAS distribution:tresf commentedon Nov 19, 2023
This issue was resolved in #1316.