Skip to main content
Visitor II
May 17, 2024
Solved

Error while compiling latest IOS NFC source code

  • May 17, 2024
  • 20 replies
  • 5336 views

Hi,

I am trying to compile the IOS NFC tap source code and I am getting open ssl & J2Objc hearder not found errors.

We are trying to read and write with the ST25DV series of tags.

Details

 Xcode Version :   15.3
 min dev            :   15.0

Downloaded source code version : 7.4.0

Does the Source code support the latest versions of IOS?

Any extra steps needed for proper compilation?

Error:

Compilation errorCompilation error

 

Thanks,

Suresh

 

 

    This topic has been closed for replies.
    Best answer by SVemp.1

    Hi Victor,

    Sorry for late reply, Just wanted to make sure everything is working fine. We can close this thread as it working fine.

    Changing to version 2.4 from 2.8 is resolved the compile issue.

    Just wanted to iterate all the steps for people new to IOS.

    1. Downloaded IOS NFC tap source code(STSW-ST25IOS001) (Version 7.4.0 )

    2.Check compatible version of J2OJBC version(2.4 is compatible for 7.4.0)

    2.Downloaded Source code from https://github.com/google/j2objc/releases 

    SVemp1_5-1717572735216.png

     

     

     

    3. Goto downloaded folder and Build using command $make dist . It took some time and created dist folder with lib,frameworks,include

    4.Linking JRE also done. Make sure there no inverted colons in path i.e "ljre_emul liconv". Path should look like below.

    SVemp1_6-1717572965320.png

     

     

    5. Updated search paths with dist folder.

    SVemp1_2-1717572537983.png

    Example: Home path should be   => J2objFolder/dist/

     

    6. Update Bundle path. Updating bundle path may remove all above settings. So recheck again.

    7. Update header file in bridge.

    Compile the code.

     

    Thanks,

    20 replies

    ST Employee
    May 17, 2024

    hello ,

    Have you included J2OBJC headers and library into your environement ? 
    Please , check the J2OBJC_HOME variable into Xcode, and update it if needed. 

    In addiition, check your Header and User Include search path into build setting for your target.

    Here attached, a short presentation on how to configure Xcode for iOS NFC Tap and using J2OBJC. Ref to slides #9 => #12

    Hope it helps

    Br,

     

    SVemp.1Author
    Visitor II
    May 20, 2024

    Hi Victor,

    Thanks for the reply.

    We have tried the steps you mentioned, But errors still occuring.

    1000025758.png

    We have followed steps in 9 to 12 pages.

    We have a system with below details.

    Apple M2 pro.

    Mac os sonoma 14.4.1

    Will the given ios source code will build with this configuration?

    Please let us know if any extra steps required for build.?

     

    Regards,

    Suresh

     

    SVemp.1Author
    Visitor II
    May 21, 2024

    Hi Victor,

    Thanks for the reply.

    We have tried the steps you mentioned, But errors still occuring.

    Screenshot 2024-05-20 at 9.18.03 AM.png

     

    We have followed steps in 9 to 12 pages.

    We have a system with below details.

    Apple M2 pro.

    Mac os sonoma 14.4.1

    Will the given ios source code will build with this configuration?

    Please let us know if any extra steps required for build.?

     

    Regards,

    Suresh

     

    ST Employee
    May 22, 2024

    hi Suresh,

    I redo  from clean environment, and all is working fine. 

    Please, could you check in "bn.h" file in which case BN_ULONG is defined ? THIRTY_TWO_BIT, SIXTY_FOUR_BIT_LONG or SIXTY_FOUR_BIT ? 

    At my end, I'm using "THIRTY_TWO_BIT". 

    I have the feeling that none of these are used in your end....

     

    Let me know.

     

    SVemp.1Author
    Visitor II
    May 23, 2024

    Hi Victor,

    I am still facing issue after these changes.

    Could you send your System configuration details? So that i will try build it in same environment.

     

    Thanks,

    Suresh

     

    ST Employee
    May 23, 2024

    just to be sure : you 're building on iOS Device (iphone) or with simulator ? 

    ST Employee
    May 23, 2024

    as ios Corenfc is not supported in simulator mode, we never try with this configuration. We only support iOS Real Device (iphone) with the App. 
    Please, could you switch to real device, then let me know status ? 

    Thx and br,

    Vincent 

    SVemp.1Author
    Visitor II
    May 23, 2024

    Hi Victor,

    We are building with IOS device (iPhone XR ) only.

     

    Thanks,

    Suresh

    ST Employee
    May 23, 2024

    I 'm able to reproduce issue only in simulator mode...anyway...

    Please, could you tell me which include file "# include <openssl/opensslconf_...." is called in the file "opensslconf.h" ? 

    #include <TargetConditionals.h>

    #if TARGET_OS_IOS && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64
    # include <openssl/opensslconf_ios_x86_64.h>
    #elif TARGET_OS_IOS && TARGET_OS_SIMULATOR && TARGET_CPU_X86
    # include <openssl/opensslconf_ios_i386.h>
    #elif TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64
    # include <openssl/opensslconf_ios_arm64.h>
    #elif TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM && defined(__ARM_ARCH_7S__)
    # include <openssl/opensslconf_ios_armv7s.h>
    #elif TARGET_OS_IOS && TARGET_OS_EMBEDDED && TARGET_CPU_ARM && !defined(__ARM_ARCH_7S__)
    # include <openssl/opensslconf_ios_armv7.h>
    #elif TARGET_OS_TV && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64
    # include <openssl/opensslconf_tvos_x86_64.h>
    #elif TARGET_OS_TV && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64
    # include <openssl/opensslconf_tvos_arm64.h>
    #else
    # error Unable to determine target or target not included in OpenSSL build
    #endif

    SVemp.1Author
    Visitor II
    May 26, 2024

    Hi Victor,

    I again did everything from start.

    Followed As per document 9 to 12 pages

    1. Download for NFCtap project.

     

    2. Downloaded and installed JRE translated into OBJ-C : • https://github.com/google/j2objc/releases.

       did make dist to install 

       it generated multiple folders into "dist" folder. i.e lib,frameworks,..

    3. Link Other -ljre_emul –liconv.

    4.Updated paths. Kept path of dist folder which is generated above  

    5. Setting in J2OBJC_HOME in Xcode and set the value to the J2objC folder
    6. Library Search Path: ${J2OBJC_HOME}/lib Setting up
    7. J2Objt C code , change J2OBJC_HOME Path to /Users/sai/SATB/j2objc/dist
    8. As per 11 page we adding all Files as Import statements in OpenSSL-for-iOS-Bridging-Header.h

    SVemp1_1-1716740769088.png

     

    5. Open NFCTap project & changed our bundle id , tried to run my iPhone(Xr)
    6. Getting error 'J2ObjC_header.h' file not found

     

    SVemp1_2-1716740848786.png



    7. When  we adding all Files as Import statements in ST25NFCApp-Bridging-Header.h then Swift errors coming

     

    Can you help me where i am making mistake?

     

    Thanks,

    Suresh

     

    SVemp.1Author
    Visitor II
    May 30, 2024

    Hi Victor,

    Any update?

    We are trying JOBJC for the first time, And We kind of stuck.

    Can you help me with basic steps and example commands to follow?

    Is there any one can help building the project by connecting to our system?

     

     

    Thanks,

    Suresh