Expo EAS Android APK-Build bleibt bei Verwendung des Expo-Routers bei „Bundle JS (0/1)“ hängen (Metro wird nie beendet)Android

Forum für diejenigen, die für Android programmieren
Anonymous
 Expo EAS Android APK-Build bleibt bei Verwendung des Expo-Routers bei „Bundle JS (0/1)“ hängen (Metro wird nie beendet)

Post by Anonymous »

Ich versuche, ein Android APK mit EAS Build für ein Expo + React Native-Projekt zu erstellen, aber der Build hängt ständig beim Schritt „Bundle JS“ und wird nie abgeschlossen.
Verwendeter Befehl

Code: Select all

eas build -p android --profile apk
Was passiert
  • Der Build schreitet normal durch die Abhängigkeitsinstallations- und Prebuild-Schritte voran.
  • Es hängt auf unbestimmte Zeit beim Schritt „Bundle JS“ und zeigt 0/1 an. Dies ist das Bild meines Protokolls
  • Das Protokoll stoppt beim Bündeln:

Code: Select all

Starting Metro Bundler
Android node_modules/expo-router/entry.js ░░░░░░░░░░░░░░░░  0.0% (0/1)
  • />
  • Code: Select all

    npx expo-doctor
    meldet keine Probleme.
Umgebung
  • Expo SDK: 54
  • expo-router: ~6.0.21
  • React Native: 0.81.5
  • Neue Architektur aktiviert
  • EAS CLI: >= 16.28.0
  • Plattform: Android (APK-Build)
Das ist mein package.json

Code: Select all

{
"name": "app",
"version": "1.0.1",
"main": "expo-router/entry",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"test": "jest --coverage",
"bundle": "expo export --platform android"
},
"dependencies": {
"@expo/metro-runtime": "~6.1.2",
"@react-native-async-storage/async-storage": "2.2.0",
"@react-native-community/datetimepicker": "8.4.4",
"@react-navigation/native": "^7.1.8",
"@sentry/react-native": "~7.2.0",
"expo": "^54.0.30",
"expo-constants": "~18.0.12",
"expo-image-picker": "~17.0.10",
"expo-linking": "~8.0.11",
"expo-notifications": "~0.32.15",
"expo-router": "~6.0.21",
"expo-secure-store": "~15.0.8",
"expo-status-bar": "~3.0.9",
"expo-system-ui": "~6.0.9",
"expo-updates": "~29.0.15",
"expo-web-browser": "~15.0.10",
"jwt-decode": "^4.0.0",
"nativewind": "^4.2.1",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-native": "0.81.5",
"react-native-dropdown-picker": "^5.4.6",
"react-native-elements": "^3.4.3",
"react-native-gesture-handler": "~2.28.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-pager-view": "6.9.1",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-tab-view": "^4.2.2",
"react-native-web": "^0.21.0",
"react-native-worklets": "0.5.1",
"react-native-worklets-core": "^1.6.2",
"tailwindcss": "^3.4.15",
"zod": "^3.23.8",
"zustand": "^5.0.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/react": "~19.1.0",
"jest": "^29.7.0",
"jest-expo": "~54.0.16",
"typescript": "~5.9.2"
},
"private": true,
"extra": {
"expoClient": {
"hostType": "lan"
}
}
}
Das ist meine metro.config.js

Code: Select all

const { getDefaultConfig } = require('expo/metro-config');
const { withNativeWind } = require('nativewind/metro');

const config = getDefaultConfig(__dirname);
config.watchFolders = [];
config.server = {
enhanceMiddleware: (middleware) =>  middleware,
};
module.exports = withNativeWind(config, { input: './global.css' });
Das ist mein eas.json (ich verstecke einige der API)

Code: Select all

{
"cli": {
"version": ">= 16.28.0",
"appVersionSource": "remote"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"channel": "development",
"env": {
"EXPO_PUBLIC_API_URL": "HIDDEN"
}
},
"preview": {
"distribution": "internal",
"channel": "preview"
},
"apk": {
"android": {
"buildType": "apk"
},
"cache": {
"disabled": false
},
"channel": "production",
"env": {
"EXPO_PUBLIC_API_URL": "HIDDEN",
"EXPO_NO_METRO_WATCHER": "1",
"CI": "true"
}
},
"production": {
"android": {
"buildType": "apk"
},
"channel": "production",
"cache": {
"disabled": false
},
"env": {
"EXPO_NO_METRO_WATCHER": "1",
"CI": "true"
}
}
},
"submit": {
"production": {}
}
}
Das ist meine app.json

Code: Select all

{
"expo": {
"name": "App",
"slug": "App",
"scheme": "myapp",
"version": "1.0.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"splash": {
"image": "./assets/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.yourname.app"
},
"android": {
"package": "com.yourname.app",
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"edgeToEdgeEnabled": true,
"predictiveBackGestureEnabled": false
},
"web": {
"favicon": "./assets/favicon.png"
},
"extra": {
"eas": {
"projectId": "HIDDEN",
"apiUrl": "process.env.EXPO_PUBLIC_API_URL"
}
},
"updates": {
"enabled": false
},
"runtimeVersion": {
"policy": "appVersion"
},
"plugins": [
//"expo-font",
"expo-router"
// "@sentry/react-native",
]
}
}
Was ich versucht habe
  • Npx expo-doctor ausführen (keine Probleme gefunden)
  • Caches löschen und neu erstellen
  • Metro Watcher deaktivieren über EXPO_NO_METRO_WATCHER=1
  • Bestätigen, dass die App in Expo Go und dem Android-Emulator funktioniert
  • Metro.config.js anpassen
  • Nicht verwandte Abhängigkeiten entfernen (keine Auswirkung)
Frage
Warum bleibt EAS Build bei „Bundle JS (0/1)“ hängen, wenn ein Android APK mit expo-router erstellt wird, obwohl die App lokal einwandfrei läuft?
Ist dies ein bekanntes Problem mit:

[*]Expo SDK 54

[*]Neue Architektur
>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post