Framework support in 8.4

hard to say. is the framework inside your .app bundle as you’d expect, or not?

Yes its in the same place for both the simulator and device build.

Have I got to do anything special when I include the framework file ?

Could somebody look into my issue ?

can you resend me your very latest project & import, just so we can be sure we’re looking at the same stuff?

I emailed you a link to the project.

1 Like

Hmm. the app runs ok (afaict, it shows an empty view with a flip view controller) on Simulator. on a real device it launches, but ever gets to the App Delegate (which could have millions of different reasons), the only relevant messages i see in the log are

(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] [realTime] Evaluating consumption...
(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] [realTime] Updated resource consumption: 20.000s [Milestone: 20.000s; Units consumed: 1; Residual: <private>]
(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] [realTime] Allowance exhausted!
(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] [realTime] Stopped monitoring.
(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] Deactivating <FBProcessWatchdog: 0x175468100; name: process-launch>
(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] [realTime] Stopped monitoring.
(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] Watchdog <FBProcessWatchdog: 0x175468100; name: process-launch> provision violated: <FBSProcessResourceProvision: 0x174338100; allowance: <FBSProcessResourceAllowance; type: realTime; timeValue: 20.0s; unitCount: 1>>
(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] Process declined watchdog termination with reason: process is being debugged
(FrontBoard)[57] <Error>: [com.dwarfland.realmapptest34] Provision violated for watchdog process-launch: <FBSProcessResourceProvision: 0x174338100; allowance: <FBSProcessResourceAllowance; type: realTime; timeValue: 20.0s; unitCount: 1>; violated: YES>
(FrontBoardServices)[57] <Error>: Not terminating "com.dwarfland.realmapptest34" for violated provision because: "process is being debugged"
(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] Invalidating <FBProcessWatchdog: 0x175468100; name: process-launch>
(FrontBoardServices)[57] <Info>: [com.dwarfland.realmapptest34] [realTime] Invalidated

which i read to mean “this app isn;'t reacting fast enough after startup”. not knowing anything about Realm, i cannot begin to say what could cause this, but it does not seem, to me, related to any build issue with how we link or package the framework.

I don’t know what I broke in the UI.

Where does that log come from ?

I assume you are debugging from Fire ?

When I launch the app from my phone the launch screen briefly appears and disappears, does it do that with you ?

Is there anything else I can do to determine why I seem to get different results ?

I’ll see if I can find another framework to test with.

yes, i’d suggest to start with some really simple/trivial framework. maybe create one in xcode that just has a single class/function, and call that? i’ll give it another try later this week as well.

I get similar results with the exception I dont see the library not loaded message.

In the simulator it runs, if I debug on my device it gets stuck on the loading screen and if I run it from the device the loading screen appears and then disappears.

SimpleFramework.zip (27.3 KB)
SimpleFrameworkTestApp.zip (2.6 MB)

Thanks, logged as bugs://76461

Hmm, i get

        :  CrossBox error Link: ld: warning: ignoring file /Users/mh/Test Projects/Framrworks76461/SimpleFrameworkTestApp/FX/SimpleFramework/iOS Simulator/SimpleFramework.framework/SimpleFramework, missing required architecture x86_64 in file /Users/mh/Test Projects/Framrworks76461/SimpleFrameworkTestApp/FX/SimpleFramework/iOS Simulator/SimpleFramework.framework/SimpleFramework (2 slices)
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_SomeClass", referenced from:
      objc-class-ref in SimpleFrameworkTestApp.o
ld: symbol(s) not found for architecture x86_64

when i build for simulator, and

Floorshow:~ mh $ file "/Users/mh/Test Projects/Framrworks76461/SimpleFrameworkTestApp/FX/SimpleFramework/iOS Simulator/SimpleFramework.framework/SimpleFramework"
/Users/mh/Test Projects/Framrworks76461/SimpleFrameworkTestApp/FX/SimpleFramework/iOS Simulator/SimpleFramework.framework/SimpleFramework: Mach-O universal binary with 2 architectures: [arm_v7: Mach-O dynamically linked shared library arm_v7] [arm64: Mach-O 64-bit dynamically linked shared library arm64]
/Users/mh/Test Projects/Framrworks76461/SimpleFrameworkTestApp/FX/SimpleFramework/iOS Simulator/SimpleFramework.framework/SimpleFramework (for architecture armv7):	Mach-O dynamically linked shared library arm_v7
/Users/mh/Test Projects/Framrworks76461/SimpleFrameworkTestApp/FX/SimpleFramework/iOS Simulator/SimpleFramework.framework/SimpleFramework (for architecture arm64):	Mach-O 64-bit dynamically linked shared library arm64

with the exact binaries you sent me. IOW the simulator binary is built for ARM? (the non-SImulator one too). This could be an import problem ofc (bug in the script copying the wrong file OR something you did wrong), hard to say since i don’t have your original code-side binaries of course. can you ore-check that?

of course i can test the main issue with this, as building for the device is fine…

Curious, i get this error when i run on device:

~> Process started.
dyld: Library not loaded: @rpath/SimpleFramework.framework/SimpleFramework
  Referenced from: /var/containers/Bundle/Application/7BBFE7CE-2241-432C-8014-99A936F62A30/SimpleFrameworkTestApp.app/SimpleFrameworkTestApp
  Reason: no suitable image found.  Did find:
        /private/var/containers/Bundle/Application/7BBFE7CE-2241-432C-8014-99A936F62A30/SimpleFrameworkTestApp.app/SimpleFramework.framework/SimpleFramework: required code signature missing for '/private/var/containers/Bundle/Application/7BBFE7CE-2241-432C-8014-99A936F62A30/SimpleFrameworkTestApp.app/SimpleFramework.framework/SimpleFramework'

adding --deep to the code signing options does NOT help.

signing the .framework separately, before build, with

/usr/bin/codesign --force --sign "iPhone Developer: marc hoffman (K2YTD84U6W)" --entitlements "/Users/mh/Test Projects/Framrworks76461/SimpleFrameworkTestApp/obj/Debug/iOS/SimpleFrameworkTestApp.xcent__" /Users/mh/Test\ Projects/Framrworks76461/SimpleFrameworkTestApp/FX/SimpleFramework/iOS/SimpleFramework.framework 

does work. so i guess .frameworks simply need to be signed for iOS. does that work for you too?

(note that, unrealated, something causes LLDB and thus fire to crash when i run the thusly working app inside the debugger. looking into that separately). So try just deploying, and running manually, jic.

Sorry I forgot I had built the phone version last. Im not an xcode expert so Im not really sure what the proper approach is. I only use it when you force me :slight_smile:

I built the simulator version 1st, ran train and then tested in the simulator. I then hit a similar issue saying the arm version was missing, so I built the phone version and did the same steps.

Yes thats the error I got and also with realm. I dont understand how the realm example I gave you worked but it wouldnt for me.

I’ll try tonight.

Ok, i’ll chuck that part down to “user error” in the widest sense, for the import then.

Yes your right the framework needs signing. Once I do that on my framework it runs on the device.

I was googling codesign and I found this

They reference realm as well. There is a strip_frameworks.sh which if you open you can see it does a codesign

1 Like

bugs://76461 got closed with status nochangereq.

Excellent, glad to hear that’s all working now!

So the realm documentation says this

If using Realm in an iOS, watchOS or tvOS project, create a new “Run
Script Phase” in your app’s target’s “Build Phases” and paste the
following snippet in the script text field: bash “${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework/strip-frameworks.sh”

How would you suggest I do that with Fire ?

just run the script manually once? say alongside your import?