Comments (13)
Thanks @bryan1anderson and @mungler!
Looks like it is because Apple changes how they organize the folder structure (see here). This can also be fixed by using command documented in the above to generate the XCFramework (I verified it can generate the same folder structure shown here, e.g.: without symlink on the Headers).
from j2objc.
Closing in favour of #2101 - sorry, failed to notice this has been logged already. This will prevent us upgrading to Sonoma when its released later this month until its resolved.
from j2objc.
You included a couple steps I hadn't tried yet. Thanks for this. Also have run into the same problem..
from j2objc.
Hi mungler@, may I ask where you see the references to the Resources folder?
from j2objc.
Re: "Resources", i'll try to find out, sorry, I just noticed in passing when I spent most of yesterday googling on the subject. Will update here if/when I find anything concrete.
Here's the thing that makes me think the package is malformed somehow - even reading the signing info results in an error. Compare:
rory@Zaphod ~> touch foo
rory@Zaphod ~> codesign -dv foo
foo: code object is not signed at all
rory@Zaphod ~ [1]> codesign --timestamp -s "Apple Development: Rory Sinclair (99******HA)" foo
rory@Zaphod ~> codesign -dv foo
Executable=/Users/rory/foo
Identifier=foo
Format=generic
CodeDirectory v=20200 size=131 flags=0x0(none) hashes=0+2 location=embedded
Signature size=9172
Timestamp=14 Sep 2023 at 09:24:29
Info.plist=not bound
TeamIdentifier=B********5
Sealed Resources=none
Internal requirements count=1 size=168
rory@Zaphod ~>
versus:
rory@Zaphod ~/W/j/d/frameworks (master)> codesign -dv JRE.xcframework
JRE.xcframework: bundle format unrecognized, invalid, or unsuitable
rory@Zaphod ~/W/j/d/frameworks (master) [1]>
So it seems the codesign tool doesn't even recognise the xcframework as something that could have a signature.
PS If we're going to discuss here, I guess its worth reopening this Issue.
from j2objc.
The thing is, the patch to gen_xcframework.sh would be trivial if the resulting framework was something that the codesign tool saw as valid. But we need to figure out why it doesn't, I guess.
from j2objc.
Actually, thinking about it a bit more, if - like us - you embed the JRE.xcframework in an app, you can get xcode to sign it as part of the app during build. So I think its perfectly valid for such a framework to be unsigned (though of course Apple encourage developers of frameworks to sign their output, for 'supply chain security' reasons) - the problem we have is more just that the package is not considered valid by the tool. So i'm not actually certain we need to bother patching the script to get it to sign the package as part of the j2objc build itself.
TL;DR: I don't think we need to sign the package, it just needs to be in a format that the 'codesign' tool considers valid for querying and signing.
from j2objc.
I did an experiment with our own static library project. Note that 'codesign' can both read and write the signing information:
rory@Zaphod ~/W/i/l/2.58.3 (sprint/greyhound)> file liblibasw_ios.a
liblibasw_ios.a: current ar archive
rory@Zaphod ~/W/i/l/2.58.3 (sprint/greyhound)> lipo -info liblibasw_ios.a
Non-fat file: liblibasw_ios.a is architecture: arm64
rory@Zaphod ~/W/i/l/2.58.3 (sprint/greyhound)> xcodebuild -create-xcframework -output foo.xcframework -library liblibasw_ios.a
xcframework successfully written out to: /Users/rory/Workspace/iOS_v3/libasw_ios/2.58.3/foo.xcframework
rory@Zaphod ~/W/i/l/2.58.3 (sprint/greyhound)> codesign -dv foo.xcframework
foo.xcframework: code object is not signed at all
rory@Zaphod ~/W/i/l/2.58.3 (sprint/greyhound) [1]> codesign --timestamp -s "Apple Development: Rory Sinclair (9********A)" foo.xcframework
rory@Zaphod ~/W/i/l/2.58.3 (sprint/greyhound)> codesign -dv foo.xcframework
Executable=/Users/rory/Workspace/iOS_v3/libasw_ios/2.58.3/foo.xcframework/Info.plist
Identifier=foo
Format=bundle
CodeDirectory v=20200 size=195 flags=0x0(none) hashes=1+3 location=embedded
Signature size=9171
Timestamp=14 Sep 2023 at 10:14:42
Info.plist entries=3
TeamIdentifier=B********5
Sealed Resources version=2 rules=10 files=1
Internal requirements count=1 size=168
rory@Zaphod ~/W/i/l/2.58.3 (sprint/greyhound)>
from j2objc.
Firebase had something similar. Their fix might help us figure it out. firebase/firebase-ios-sdk#11401
from j2objc.
Well, i've actually solved this locally for my team, and i'm working on a patch for j2objc now. Namely moving the 'Headers' folder to the root of the bundle, instead of a symlink, and ditching the Versions folder entirely. With that setup, 'codesign' now correctly identifies the bundle as unsigned:
rory@Zaphod ~/W/j/d/frameworks (asmallworld/framework_patch)> ls JRE.xcframework
Headers/
ios-arm64_x86_64-simulator/
Info.plist macos-arm64_x86_64/
ios-arm64_arm64e/ watchos-arm64_32_armv7k/
ios-arm64_x86_64-maccatalyst/ watchos-arm64_x86_64-simulator/
rory@Zaphod ~/W/j/d/frameworks (asmallworld/framework_patch)> codesign -dv JRE.xcframework/
JRE.xcframework/: code object is not signed at all
rory@Zaphod ~/W/j/d/frameworks (asmallworld/framework_patch) [1]>
from j2objc.
Yes that symlink and versions was the issue! @litstrong
from j2objc.
Fixed by PR #2175
from j2objc.
from j2objc.
Related Issues (20)
- Is this convert JAVA 11 code? HOT 3
- a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] HOT 7
- Facing permission denide issue while converting java code to objective C HOT 1
- The 'build_subset_frameworks.sh' script fails
- CI Workflow Runs are failing HOT 1
- JRE_Core.xcframework is missing headers HOT 2
- make dist fails make: *** [jre_emul_jars_dist] Error 2 HOT 9
- Headers information is missing from the XCFrameworks' "Info.plist" files HOT 6
- Encountering "multiple commands produce 'module.modulemap'" error when linking a target with any two of the J2ObjC XCFrameworks HOT 1
- When can you update the new version? HOT 3
- JAVA code is configured with JVM, how do I configure JVM into J2OBJC? HOT 1
- My
- Myself
- Files with same name HOT 3
- Size of JRE.xcframework exceeds 75MB limit of appstoreconnect HOT 2
- bitwise error ( sudo make dist command ). JDK 15 osx Sonoma 14.1.2
- The contents of JRE.xcframework (static vs dynamic lib)
- Bazel 6 example workspace
- Inquiry about Support for Apple's Privacy Manifest Files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from j2objc.