Skip to content

Wont build on RN 0.83 (Expo 55) #17

@MacDaysix

Description

@MacDaysix

The package requires patching to be compatible with modern React Native (New Architecture / Expo SDK 52+) due to three issues:

  • Deprecated Android support libraries: The package depends on com.android.support:appcompat-v7 and com.android.support:design, which must be replaced with their AndroidX equivalents (androidx.appcompat, com.google.android.material, androidx.localbroadcastmanager). The Queue-it Android SDK transitively pulls in legacy support libs, so those need to be excluded explicitly.
  • Version catalog dependency references: build.gradle uses version catalog syntax (libs.react.android, libs.fbjni) which is not reliably available in library module contexts — these need to be replaced with explicit string coordinates.
  • Hardcoded codegen output filenames in CMake: CMakeLists.txt references specific generated .cpp filenames that may differ across RN versions; switching to a GLOB pattern makes the build resilient to codegen output changes.

Currently I am able to run this app by applying the following patch:

diff --git a/android/build.gradle b/android/build.gradle
index dc883f3284f90bc739c626e9dfec8898cc415fad..ebdc4df47ac2d98e856c44133ec2342822696cb0 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -102,11 +102,14 @@ android {
 def kotlin_version = getExtOrDefault('kotlinVersion')
 dependencies {
   implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
-  implementation(libs.react.android)
-  implementation(libs.fbjni)
+  implementation "com.facebook.react:react-android"
+  implementation "com.facebook.fbjni:fbjni:0.5.1"
 
   //App dependencies
-  implementation('com.queue-it.androidsdk:library:2.0.36')
-  implementation('com.android.support:appcompat-v7:28.0.0')
-  implementation('com.android.support:design:28.0.0')
+  implementation('com.queue-it.androidsdk:library:2.0.36') {
+    exclude group: "com.android.support"
+  }
+  implementation "androidx.appcompat:appcompat:1.7.0"
+  implementation "com.google.android.material:material:1.12.0"
+  implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.1.0"
 }
diff --git a/android/src/main/jni/CMakeLists.txt b/android/src/main/jni/CMakeLists.txt
index 6c3ff4e2f59d4da88cbf260c08904b068c97bb63..ffb5deba33a755936c351ef00bd5b359bfe74f0a 100644
--- a/android/src/main/jni/CMakeLists.txt
+++ b/android/src/main/jni/CMakeLists.txt
@@ -24,10 +24,12 @@ file(TO_CMAKE_PATH "${REACT_ANDROID_DIR}" REACT_ANDROID_DIR)
 
 include("${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake")
 
-set(SOURCE_FILES
-  "${CODEGEN_DIR}/ReactNativeQueueIt-generated.cpp"
-  "${CODEGEN_DIR}/react/renderer/components/ReactNativeQueueIt/ReactNativeQueueItJSI-generated.cpp"
-)
+file(
+  GLOB SOURCE_FILES
+  CONFIGURE_DEPENDS
+  "${CODEGEN_DIR}/*.cpp"
+  "${CODEGEN_DIR}/react/renderer/components/ReactNativeQueueIt/*.cpp"
+)
 
 include_directories(
     "${CODEGEN_DIR}"

There are also issues with the AndroidManifest.xml merge when trying to build.

Applying this expo plugin allows it to build:

/* eslint-env node */
/* global require, module */

const { withAndroidManifest, createRunOncePlugin } = require("expo/config-plugins")

const QUEUE_ACTIVITY_NAME = "com.queue_it.androidsdk.QueueActivity"

const withQueueIt = (config) => {
  return withAndroidManifest(config, (config) => {
    const application = config.modResults?.manifest?.application?.[0]

    if (!application) {
      return config
    }

    if (!application.$) {
      application.$ = {}
    }

    application.$["tools:replace"] = "android:allowBackup"

    if (!application.activity) {
      application.activity = []
    }

    const alreadyExists = application.activity.some(
      (activity) => activity?.$?.["android:name"] === QUEUE_ACTIVITY_NAME,
    )

    if (!alreadyExists) {
      application.activity.push({
        $: {
          "android:name": QUEUE_ACTIVITY_NAME,
        },
      })
    }

    return config
  })
}

const pkg = require("../package.json")

module.exports = createRunOncePlugin(withQueueIt, pkg.name, pkg.version)

I wanted to ask if the allowsBackup setting is actually required for QueueIt?

Stack:
"react-native": "0.83.6",
"expo": "55.0.17",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions