Describe the issue
Expo config plugin getPackages() insertion point inside ReactNativeHostWrapper used in Expo <= 54 has been replaced with ExpoReactHostFactory in this commit.
Full error produced when using the ORT RN Expo config plugin with Expo 55:
Error: [android.mainApplication]: withAndroidMainApplicationBaseMod: Failed to match "/override fun getPackages\(\)/" in contents:
package com.anonymous.expoapp
// @generated begin onnxruntime-react-native-import - expo prebuild (DO NOT MODIFY) sync-4543d7f2625243dfdef886002e5bf12df91957f2
import ai.onnxruntime.reactnative.OnnxruntimePackage
// @generated end onnxruntime-react-native-import
import android.app.Application
import android.content.res.Configuration
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
import com.facebook.react.ReactPackage
import com.facebook.react.ReactHost
import com.facebook.react.common.ReleaseLevel
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint
import expo.modules.ApplicationLifecycleDispatcher
import expo.modules.ExpoReactHostFactory
class MainApplication : Application(), ReactApplication {
override val reactHost: ReactHost by lazy {
ExpoReactHostFactory.getDefaultReactHost(
context = applicationContext,
packageList =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}
)
}
override fun onCreate() {
super.onCreate()
DefaultNewArchitectureEntryPoint.releaseLevel = try {
ReleaseLevel.valueOf(BuildConfig.REACT_NATIVE_RELEASE_LEVEL.uppercase())
} catch (e: IllegalArgumentException) {
ReleaseLevel.STABLE
}
loadReactNative(this)
ApplicationLifecycleDispatcher.onApplicationCreate(this)
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
}
}
The new API offers the equivalent functionality with a builder-style DSL insertion point in the packageList parameter of ExpoReactHostFactory.getDefaultReactHost:
ExpoReactHostFactory.getDefaultReactHost(
context = applicationContext,
packageList =
PackageList(this).packages.apply {
add(OnnxruntimePackage()) // <- this should be injected starting from Expo 55
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}
)
To reproduce
- Create an Expo app with Expo SDK 55
- Add
onnxruntime-react-native dependency
- Add ORT RN Expo config plugin to the app
- Try to prebuild the Android app (
npx expo prebuild)
Urgency
Users of Expo 55 and above won't be able to use the ORT RN Expo config plugin.
Platform
Android
OS Version
15
ONNX Runtime Installation
Released Package
Compiler Version (if 'Built from Source')
No response
Package Name (if 'Released Package')
onnxruntime-react-native
ONNX Runtime Version or Commit ID
1.24.3
ONNX Runtime API
JavaScript
Architecture
ARM64
Execution Provider
Default CPU
Execution Provider Library Version
No response
Describe the issue
Expo config plugin
getPackages()insertion point insideReactNativeHostWrapperused in Expo <= 54 has been replaced withExpoReactHostFactoryin this commit.Full error produced when using the ORT RN Expo config plugin with Expo 55:
The new API offers the equivalent functionality with a builder-style DSL insertion point in the
packageListparameter ofExpoReactHostFactory.getDefaultReactHost:To reproduce
onnxruntime-react-nativedependencynpx expo prebuild)Urgency
Users of Expo 55 and above won't be able to use the ORT RN Expo config plugin.
Platform
Android
OS Version
15
ONNX Runtime Installation
Released Package
Compiler Version (if 'Built from Source')
No response
Package Name (if 'Released Package')
onnxruntime-react-native
ONNX Runtime Version or Commit ID
1.24.3
ONNX Runtime API
JavaScript
Architecture
ARM64
Execution Provider
Default CPU
Execution Provider Library Version
No response