2025-02-03 12:16 PM
Hi,
I'm trying to compile NFC Tap for iOS but no luck so far. I've resolved the following issues, by following the advice of other posts on this forum:
After these fixes, the project still fails to compile due to the errors shown below. I'm suspecting an issue with the j2objc version. I'm using the latest from their repo. Is there any recommended version that I should use?
Xcode Version: 16.1
STSW-ST25IOS002 version: 7.6.0
STSW-ST25IOS005 version: 1.0.0
Thanks!
Solved! Go to Solution.
2025-02-04 07:12 AM
Yay! Finally got it to run. I had to add an extra build step to embed st25sdkFramework into the final bundle. (Project -> Build Phases -> + -> New Copy Files phase -> Rename to "Embed Frameworks" -> Destination "Frameworks" -> st25sdkFramework.framework
So, for my future self, and for others trying to do this, here is the summary of the steps I followed to compile and run NFC Tap:
Relevant configuration variables are:
HEADER_SEARCH_PATHS = ...
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/NFCTap/st25sdklib/include/**
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/NFCTap/st25sdklib/com/st/st25pc/model
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/NFCTap/openssl/**
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/Frameworks/st25sdkFramework.framework/Headers
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/Frameworks/st25sdkFramework.framework/Headers/Jre
Thanks for the help.
Best,
2025-02-04 12:23 AM
Hi Jcard,
Thx for your interest.
We never tried with latest version of j2objC tool. We recommend you use the version 2.4 : it was the version used for our software.
Otherwise, if you use the st25sdkframework provided in "en.stsw-st25ios005.zip", you shouldn't need to install J2OBJC, as framework is self-sufficient and contains all binaries + header needed for building iOS NFC Tap.
hope it helps and clarifies more.
Keep me informed of your changes.
Br,
2025-02-04 04:04 AM - edited 2025-02-04 04:06 AM
Thanks for the quick reply, @victor laraison
I went ahead with your second suggestion, that is, to use st25sdkframework.
These are my build settings now:
HEADER_SEARCH_PATHS =
/Users/javier/dev/nfc-tap/NFCTap/st25sdklib/include/com/st/st25sdk/**
/Users/javier/dev/nfc-tap/NFCTap/st25sdklib/com/st/st25pc/model
/Users/javier/dev/nfc-tap/NFCTap/openssl/**
/Users/javier/dev/nfc-tap/st25sdkFramework.framework/Headers/**
J2OBJC_HOME = /Users/javier/dev/nfc-tap/st25sdkFramework.framework/
FRAMEWORKS_FOLDER_PATH = NFC Tap.app/Frameworks
FRAMEWORK_SEARCH_PATHS =
/Users/javier/dev/nfc-tap/st25sdkFramework.framework/frameworks
/Users/javier/dev/nfc-tap
With these I got past the errors from my original post. Now I'm struggling with this:
I'm tweaking the search paths of the include files, but so far no luck. Any suggestions?
Thanks!
Javier
EDIT: Additional detail on the specific include files below:
2025-02-04 05:40 AM
Getting there inch by inch...
The cyclic dependency is fixed by making the j2objc search paths non-recursive. That is:
- "$(SRCROOT)/st25sdkFramework.framework/Headers/**",
+ "$(SRCROOT)/st25sdkFramework.framework/Headers",
+ "$(SRCROOT)/st25sdkFramework.framework/Headers/Jre",
So compilation now completes successfully. Now dealing with a linking error...
Library 'jre_emul' not found
You mentioned that:
the st25sdkframework provided in "en.stsw-st25ios005.zip" [...] is self-sufficient and contains all binaries + header needed for building iOS NFC Tap.
... but I cannot find `libjre_emul.a` there. Should it be?
2025-02-04 05:46 AM
Oh, just removed -ljre_emul from the linker flags, and the app builds. Great!
The app starts running on the phone, I see the splash screen... and the it crashes:
So close...
2025-02-04 07:12 AM
Yay! Finally got it to run. I had to add an extra build step to embed st25sdkFramework into the final bundle. (Project -> Build Phases -> + -> New Copy Files phase -> Rename to "Embed Frameworks" -> Destination "Frameworks" -> st25sdkFramework.framework
So, for my future self, and for others trying to do this, here is the summary of the steps I followed to compile and run NFC Tap:
Relevant configuration variables are:
HEADER_SEARCH_PATHS = ...
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/NFCTap/st25sdklib/include/**
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/NFCTap/st25sdklib/com/st/st25pc/model
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/NFCTap/openssl/**
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/Frameworks/st25sdkFramework.framework/Headers
$(PROJECT_DIR)/Users/javier/dev/nfc-tap/Frameworks/st25sdkFramework.framework/Headers/Jre
Thanks for the help.
Best,
2025-02-04 07:46 AM
Thx so much Jcard3 for your investigations, feedback and solution at the end.
I will update documentation accordingly.
Just one minor comment : why do you need to define J2OBJC to `$(PROJECT_DIR)/Frameworks/st25sdkFramework.framework` ? Normally, we shouldn't use anymore J2OBJC varaible with framework.
In addition, I guess you forgot to embed framework in your app at the beggining. This could explain why you must
Br,
2025-02-04 09:26 AM
> why do you need to define J2OBJC to `$(PROJECT_DIR)/Frameworks/st25sdkFramework.framework` ? Normally, we shouldn't use anymore J2OBJC varaible with framework.
Yes, you are right, that is not strictly needed. It is just that $(J2OBJC) was referenced in the search paths, so by setting the variable, the search paths were set correctly. But the better fix is to remove that variable altogether.
> I guess you forgot to embed framework in your app at the beggining
Yes, I thought that by dragging a Framework into the project, Xcode would take care of that step for you. I guess it does not.
Thanks for the help!