My company is switching to expo react-native mobile apps. We developed them in expo and ejected them. From here we wanted standalone apps without OTA and with Offline support. We also did not want to publish anything to expo for security reasons and may go to self hosting in the future.
For the time being we want to build IPAs and APKs that are self contained without ever doing
expo publish, as we do not want to publish to expo nor a self hosted space at this time.
We noticed that the expo bundle-assets requires a connection to either the expo server or the self hosted server. To get around this we copied the files directly for IOS from the dist.
We got IOS working without ever doing
expo publish by the following steps:
- Develope in expo
- Expo export
- Expo eject
- Copy bundle, manifest, and assets from the
expo exportdist folder into the app in xcode by adding to the
bundle expo assetsbuild phase.
However our problem is that we cannot figure out how to do the same for android. Again, we want to not have to do
expo publish. We tried starting a local server on our local machine and point to that as our server, however that requires a cert as it’s https.
Currently we are looking at adding embedded responses in AppConstants.java.
- embeddedResponses.add(new Constants.EmbeddedResponse(“https://exp.host/@mobile/Test”, “assets://shell-app-manifest.json”, “application/json”));
- embeddedResponses.add(new Constants.EmbeddedResponse(“https://www.OurExportURL.com/mobile/native/bundles/android-04865e5aace5c3caf194c153a693eef8.js”, “assets://shell-app.bundle”, “application/json”));
Which get us further but still get the error
Expo encountered a fatal error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.InputStream okhttp3.ResponseBody.byteStream()' on a null object reference
We thought that this may have been a feature somewhere but we can’t find it.
- Least Restrictive - publish to expo
- Restrictive - publish to self hosted
- Most Restrictive - everything is handled locally at build time
Any help with handling everything locally for android would be appreciated.