Kompatibilitätsfehler bei expo-camera und @react-native-firebase-PluginsAndroid

Forum für diejenigen, die für Android programmieren
Anonymous
 Kompatibilitätsfehler bei expo-camera und @react-native-firebase-Plugins

Post by Anonymous »

Ich habe ein Projekt, das die Verwendung der Plugins „react-native-firebase“ und „expo-camera“ erfordert. Das Problem besteht darin, dass jedes Mal, wenn ich versuche, das Projekt auszuführen oder vorab zu erstellen, sofort ein Fehler auftritt (siehe Bild unten).
Image

Fehler:

Code: Select all

PluginError: Package "@react-native-firebase/app" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Unexpected token 'typeof'
SyntaxError: Unexpected token 'typeof'
at compileSourceTextModule (node:internal/modules/esm/utils:318:16)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:380:18)
at loadESMFromCJS (node:internal/modules/cjs/loader:1578:24)
at Module._compile (node:internal/modules/cjs/loader:1743:5)
at Object..js (node:internal/modules/cjs/loader:1893:10)
at Module.load (node:internal/modules/cjs/loader:1481:32)
at Module._load (node:internal/modules/cjs/loader:1300:12)
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
at Module.require (node:internal/modules/cjs/loader:1504:12)
Ich habe hier ein Projekt erstellt, um den Fehler zu reproduzieren: https://github.com/jamespageced/expo-ca ... me-ov-file
package.json-Inhalte

Code: Select all

{
"name": "demo",
"version": "1.0.0",
"main": "index.ts",
"scripts": {
"dev-android": "cross-env NODE_ENV=development npx expo run:android --port 8082",
"dev-ios": "cross-env NODE_ENV=development npx expo run:ios --port 8082",
"prod-android": "cross-env NODE_ENV=production npx expo run:android --port 8082",
"prod-ios": "cross-env NODE_ENV=production npx expo run:ios --port 8082",
"ts-check": "tsc",
"android": "expo run:android",
"ios": "expo run:ios"
},
"dependencies": {
"@react-native-firebase/app": "^23.7.0",
"@react-native-firebase/auth": "^23.7.0",
"@react-native-firebase/crashlytics": "^23.7.0",
"expo": "~53.0.24",
"expo-asset": "~11.1.7",
"expo-build-properties": "~0.14.8",
"expo-camera": "~16.1.11",
"expo-system-ui": "~5.0.11",
"expo-status-bar": "~2.2.3",
"react": "19.0.0",
"react-native": "0.79.6"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/node": "^24.10.2",
"@types/react": "~19.0.10",
"cross-env": "^10.1.0",
"react-native-dotenv": "^3.4.11",
"typescript": "~5.8.3"
},
"private": true
}
app.config.js-Inhalt

Code: Select all

module.exports = {
name: 'demo',
slug: 'demo',
version: '1.0.0',
orientation: 'portrait',
icon: './assets/icon.png',
userInterfaceStyle: 'light',
newArchEnabled: true,
splash: {
image: './assets/splash-icon.png',
resizeMode: 'contain',
backgroundColor: '#ffffff'
},
ios: {
supportsTablet: true
},
android: {
adaptiveIcon: {
foregroundImage: './assets/adaptive-icon.png',
backgroundColor: '#ffffff'
},
package: 'com.anonymous.demo',
edgeToEdgeEnabled: true
},
web: {
favicon: './assets/favicon.png'
},
plugins: [
['@react-native-firebase/app'],
['@react-native-firebase/auth'],
['@react-native-firebase/crashlytics'],
[
'expo-camera',
{
cameraPermission: 'Allow $(PRODUCT_NAME) to access your camera',
microphonePermission: 'Allow $(PRODUCT_NAME) to access your microphone',
recordAudioAndroid: true
}
],
[
'expo-build-properties',
{
android: {
minSdkVersion: 26,
compileSdkVersion: 35,
targetSdkVersion: 35
},
ios: {
useFrameworks: 'static'
}
}
]
]
};

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post