if it’s unclear from reading that what needs to be done, please try creating a new app with expo init and choose bare workflow, then compare the resulting files with your app. also see the expo-updates readme: expo/README.md at master · expo/expo · GitHub
Everything looks identical. I noticed an error produced by my my IDE’s debugger:
A problem occurred evaluating project ':app'.
Could not read script '/Users/user/myProject/node_modules/expo-updates/scripts/create-manifest-android.gradle' as it does not exist.
try doing a release build in the new project you created for comparison, yarn android --variant Release - if that gives you the same error then you will know something is wrong on a system level vs project level. if it works, then you may be missing some part of the config
I have scoured every inch of code and compared everything to the test build you asked me to spin up and can’t find the root cause.
When I run react-native run android I get the error from the OP.
When I run yarn android --variant Release I get an Invariant Violation that application "main" has not been registered.
I went through several troubleshooting steps for that error to no avail. I didn’t change anything about the name configuration in MainApplication.java or MainActivity.java
Ah I’ve come too far in my current project to compare right. Anyway, a part of the problem got fixed once I ran expo update. I say a part because I don’t have problems with the built apk using expo build:android or even using barcode of expo start. But can’t get npm run android to work directly on my emulated device.
I am new to expo terminology. I believe I’ve managed project - never ejected. I was trying to make react-native run-android work which made me encounter this error. I caught the error in Logcat of Android Studio. java.lang.AssertionError: The embedded manifest is invalid or could not be read. Make sure you have created app.manifest and app.bundle files and added them to the assets folder. If you are using Expo CLI, make sure you have run expo publish or expo export at least once.
I’ve ran expo publish after which I was able to figure out about expo build:android that built a working .apk.
you wouldn’t use react-native run-android in a managed project. run expo start —android or yarn android. if you have ios and android directories in your project then it’s a bare project as in we don’t manage the native projects for you. you can remove those if you don’t use them
Hi, I am going through the same situation after an expo eject. The app builds and it gets installed in the android emulator but it fails to open with " java.io.FileNotFoundException: app.manifest".
I have already fixed several issues but in this case, I can see that the eject command did everything that was expected. I even compared the output of an expo init bare workflow project and I see no differences in the key sections. I have ejected 20 days ago and I have now hit this major roadblock. Please help. I am on “expo-updates”: “~0.2.0” and currently locked to “version”: “0.2.14”. See screenshots below, everything seems to be OK, with the exception of a config file in expo-udpates that VSCode is flagging as with errors. That referenced “expo-module-scripts/tsconfig.base” file does not exist in my node_modules, but not sure if this is missleading. Any help will be greatly appreciated.
adb logcat *:E -T 100 (when openning the app in the emulator)
08-25 01:54:39.195 22038 26859 E ActivityThread: Failed to find provider info for com.google.android.apps.gsa.testing.ui.audio.recorded
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: Could not read embedded manifest
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: java.io.FileNotFoundException: app.manifest
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.content.res.AssetManager.nativeOpenAsset(Native Method)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.content.res.AssetManager.open(AssetManager.java:744)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.content.res.AssetManager.open(AssetManager.java:721)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at expo.modules.updates.loader.EmbeddedLoader.readEmbeddedManifest(EmbeddedLoader.java:73)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at expo.modules.updates.UpdatesController.start(UpdatesController.java:285)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at expo.modules.updates.UpdatesController.initialize(UpdatesController.java:96)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at com.lemmonet.contentcreators.MainApplication.onCreate(MainApplication.java:85)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.app.ActivityThread.access$1100(ActivityThread.java:199)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.os.Handler.dispatchMessage(Handler.java:106)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.os.Looper.loop(Looper.java:193)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at android.app.ActivityThread.main(ActivityThread.java:6669)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at java.lang.reflect.Method.invoke(Native Method)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-25 01:54:42.068 27779 27779 E EmbeddedLoader: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
--------- beginning of crash
08-25 01:54:42.069 27779 27779 E AndroidRuntime: FATAL EXCEPTION: main
08-25 01:54:42.069 27779 27779 E AndroidRuntime: Process: com.lemmonet.contentcreators, PID: 27779
08-25 01:54:42.069 27779 27779 E AndroidRuntime: 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. app.manifest
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at expo.modules.updates.loader.EmbeddedLoader.readEmbeddedManifest(EmbeddedLoader.java:78)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at expo.modules.updates.UpdatesController.start(UpdatesController.java:285)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at expo.modules.updates.UpdatesController.initialize(UpdatesController.java:96)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at com.lemmonet.contentcreators.MainApplication.onCreate(MainApplication.java:85)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at android.app.ActivityThread.access$1100(ActivityThread.java:199)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6669)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-25 01:54:42.069 27779 27779 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
For anyone who lands on this issue, I was able to solve the problem by removing the line import com.facebook.react.BuildConfig; from MainApplication.java. Now the Android app runs as expected.