I am creating a react-native expo app and i wanted to test it on my physical mobile which currently runs on Android Version 11.
the problem is i am following all the expo dcoumentation and step correctly to generate a preview build with apk, but i am getting the same problem every time.
Problem: Build is successfully done, and it is getting successfully installed on device & emulator but it is not opening it showing a flash screen and then closes automatically.
What I have Done so far to reaolve the erro => 1). I’ve tested and analyzed apk in android studio and found out this error.
08/11 12:31:08: Launching 'new1_1' on Pixel 5 API 30.
Install successfully finished in 6 s 245 ms.
$ adb shell am start -n "com.surajaswal29.myapp/com.surajaswal29.myapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 23870 on device 'Pixel_5_API_30 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/ajaswal29.myap: Unexpected CPU variant for X86 using defaults: x86
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
V/fb-UnpackingSoSource: locked dso store /data/user/0/com.surajaswal29.myapp/lib-main
I/fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.surajaswal29.myapp/lib-main
V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.surajaswal29.myapp/lib-main
V/SoLoader: Init SoLoader delegate
E/EmbeddedManifest: Could not read embedded manifest
java.lang.NullPointerException
at expo.modules.updates.manifest.BareUpdateManifest$Companion.fromBareManifest(BareUpdateManifest.kt:97)
at expo.modules.updates.manifest.ManifestFactory.getEmbeddedManifest(ManifestFactory.kt:36)
at expo.modules.updates.manifest.EmbeddedManifest.get(EmbeddedManifest.kt:30)
at expo.modules.updates.launcher.NoDatabaseLauncher.<init>(NoDatabaseLauncher.kt:70)
at expo.modules.updates.launcher.NoDatabaseLauncher.<init>(NoDatabaseLauncher.kt:23)
at expo.modules.updates.UpdatesController.start(UpdatesController.kt:243)
at expo.modules.updates.UpdatesController$Companion.initialize(UpdatesController.kt:603)
at expo.modules.updates.UpdatesPackage$createReactNativeHostHandlers$handler$1.onWillCreateReactInstanceManager(UpdatesPackage.kt:56)
at expo.modules.ReactNativeHostWrapperBase.createReactInstanceManager(ReactNativeHostWrapperBase.kt:27)
at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42)
at com.surajaswal29.myapp.MainApplication.onCreate(MainApplication.java:71)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.surajaswal29.myapp, PID: 23870
java.lang.AssertionError: The embedded manifest is invalid or could not be read. Make sure you have configured expo-updates correctly in android/app/build.gradle. null
at expo.modules.updates.manifest.EmbeddedManifest.get(EmbeddedManifest.kt:34)
at expo.modules.updates.launcher.NoDatabaseLauncher.<init>(NoDatabaseLauncher.kt:70)
at expo.modules.updates.launcher.NoDatabaseLauncher.<init>(NoDatabaseLauncher.kt:23)
at expo.modules.updates.UpdatesController.start(UpdatesController.kt:243)
at expo.modules.updates.UpdatesController$Companion.initialize(UpdatesController.kt:603)
at expo.modules.updates.UpdatesPackage$createReactNativeHostHandlers$handler$1.onWillCreateReactInstanceManager(UpdatesPackage.kt:56)
at expo.modules.ReactNativeHostWrapperBase.createReactInstanceManager(ReactNativeHostWrapperBase.kt:27)
at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42)
at com.surajaswal29.myapp.MainApplication.onCreate(MainApplication.java:71)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
- My eas.json file
{
"build": {
"preview": {
"android": {
"buildType": "apk"
}
},
"preview2": {
"android": {
"gradleCommand": ":app:assembleRelease"
}
},
"preview3": {
"developmentClient": true
},
"production": {}
}
}
- My app.json file
{
"expo": {
"name": "my-app",
"slug": "my-app",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"plugins": [
[
"expo-updates",
{
"username": "surajaswal29"
}
]
],
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.surajaswal29.myapp"
},
"web": {
"favicon": "./assets/favicon.png"
},
"extra": {
"eas": {
"projectId": "c82a7215-d33d-44b9-90cb-15317f417dd4"
}
}
}
}
4). Package.json
{
"name": "my-app",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "~49.0.7",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-native": "0.72.3",
"expo-updates": "~0.18.11",
"expo-splash-screen": "~0.20.5"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}