Sdbox firebase issues for 3.17.2 on iOS


Has anyone tried to use the latest sdkbox firebase plugin for 3.17.2 on iOS, through CMake
(android works fine)
I’m currently still playing around, trying it with some solution I had for
3.17.1 here SDKBOX Firebase with CMake on iOS - #20 by Sleicreider

but it seems like the setup for the plugin has changed and is now using some new xcframework stuff which is new to me and non of the old solutions or the automatically provided cmake changes from sdkbox work so far.

Here my current cmake part for firebase including some of my own changes:

        find_library(ZLIB z)
        find_library(LIBSQL3 SQLITE3)
        target_link_libraries(${APP_NAME} ${ZLIB} ${LIBSQL3})

        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework GameController")
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework MediaPlayer")
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework StoreKit")
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework SystemConfiguration")

        # sdkbox changes below don't work
        #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} libsqlite3.0.tbd")
        NAMES PluginFirebase
        PATHS ${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac
        target_link_libraries(${APP_NAME} ${F_FIREBASE})

Current error:

Undefined symbols for architecture armv7:

  "_OBJC_CLASS_$_FIRAnalytics", referenced from:
      objc-class-ref in PluginFirebase(AnalyticsWrapper-364bf8cb37ecea5d1d47273108fc05f546307bf80e74b2a40c2d534585c986e4.o)
  "_OBJC_CLASS_$_FIRApp", referenced from:
      objc-class-ref in PluginFirebase(AnalyticsWrapper-364bf8cb37ecea5d1d47273108fc05f546307bf80e74b2a40c2d534585c986e4.o)

I will keep this updated if I do find a solution.
If anyone could help or knows a solution to this, let me know, sadly didn’t modify CMake stuff much recently, therefore my knowledge on it is not the best atm.

We can ask @htlxyz to have a look.

update, it does work by simply dragging the xcframework folders into the XCode project, but obviously this is not the best solution, since everytime you execute cmake, they will be removed.

could be that CMake just doesn’t support those xcframework , but i’ll keep researching too

Yes, CMake is not supporting xcframework for now.

In SDKBox, we provide a method to link xcframework.
need to send arch param to the method manually.

LinkXCFramework("${CMAKE_CURRENT_LIST_DIR}/FBAEMKit.xcframework" ios-arm64_i386_x86_64-simulator ${LIB_NAME})
1 Like

ah great thanks.

This did work for me with the following adjustments:

    set(F_PATH ${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/Firebase/FirebaseAnalytics)
    LinkXCFramework("${F_PATH}/FirebaseAnalytics.xcframework" ios-arm64_armv7 ${APP_NAME})
    LinkXCFramework("${F_PATH}/FirebaseCore.xcframework" ios-arm64_armv7 ${APP_NAME})
    LinkXCFramework("${F_PATH}/FirebaseCoreDiagnostics.xcframework" ios-arm64_armv7 ${APP_NAME})
    LinkXCFramework("${F_PATH}/FirebaseInstallations.xcframework" ios-arm64_armv7 ${APP_NAME})
    LinkXCFramework("${F_PATH}/GoogleAppMeasurement.xcframework" ios-arm64_armv7 ${APP_NAME})
    LinkXCFramework("${F_PATH}/GoogleDataTransport.xcframework" ios-arm64_armv7 ${APP_NAME})
    LinkXCFramework("${F_PATH}/GoogleUtilities.xcframework" ios-arm64_armv7 ${APP_NAME})
    LinkXCFramework("${F_PATH}/nanopb.xcframework" ios-arm64_armv7 ${APP_NAME})
    LinkXCFramework("${F_PATH}/PromisesObjC.xcframework" ios-arm64_armv7 ${APP_NAME})

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.