Generally you should use preview
if you want an APK and leave production
as-is, which will produce a .aab file. You want to upload a .aab file to Google Play rather than a .apk, because then the Play store can optimize what it sends to a device when the app is downloaded.
The preview app is build in production mode, so it’s pretty much the same thing, but it builds as an APK to make it easy for you to side load onto a phone or emulator.
Where did you see this?
No, it just shows the splash screen. This normally indicates that there’s some issue with the JavaScript, but you can’t tell just from those symptoms what the problem is.
If I try it in Expo Go with npx expo start --minify --no-dev
then I get this:
And if I view the error log I get this:
Although, strangely, if I just reload then it gets to the SignIn/Sign Up screen. I have to kill the app and expo start
to get the error to appear again. And if I try without --minify --no-dev
then I do not get the error.
I tried generating the bundle locally like this:
$ npx expo export -p android -c .
and it gave me an error about react-native-gesture-handler
not being installed:
Starting Metro Bundler
warning: Bundler cache is empty, rebuilding (this may take a minute)
Android Bundling failed 8593ms
Android node_modules/expo/AppEntry.js ▓▓▓▓░░░░░░░░░░░░ 26.2% ( 626/1224)
Error: Unable to resolve module react-native-gesture-handler from /scratch/PlateScannerApp/node_modules/@react-navigation/stack/src/views/GestureHandlerNative.tsx: react-native-gesture-handler could not be found within the project or in these directories:
node_modules
3 | PanGestureHandler as PanGestureHandlerNative,
4 | PanGestureHandlerProperties,
> 5 | } from 'react-native-gesture-handler';
| ^
6 |
7 | import GestureHandlerRefContext from '../utils/GestureHandlerRefContext';
8 |
Error: Unable to resolve module react-native-gesture-handler from /scratch/PlateScannerApp/node_modules/@react-navigation/stack/src/views/GestureHandlerNative.tsx: react-native-gesture-handler could not be found within the project or in these directories:
node_modules
3 | PanGestureHandler as PanGestureHandlerNative,
4 | PanGestureHandlerProperties,
> 5 | } from 'react-native-gesture-handler';
| ^
6 |
7 | import GestureHandlerRefContext from '../utils/GestureHandlerRefContext';
8 |
at ModuleResolver.resolveDependency (/scratch/PlateScannerApp/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:162:15)
at DependencyGraph.resolveDependency (/scratch/PlateScannerApp/node_modules/metro/src/node-haste/DependencyGraph.js:260:43)
at Object.resolve (/scratch/PlateScannerApp/node_modules/metro/src/lib/transformHelpers.js:177:21)
at Graph._resolveDependencies (/scratch/PlateScannerApp/node_modules/metro/src/DeltaBundler/Graph.js:432:35)
at Graph._processModule (/scratch/PlateScannerApp/node_modules/metro/src/DeltaBundler/Graph.js:218:38)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Graph._addDependency (/scratch/PlateScannerApp/node_modules/metro/src/DeltaBundler/Graph.js:314:20)
at async Promise.all (index 0)
at async Graph._processModule (/scratch/PlateScannerApp/node_modules/metro/src/DeltaBundler/Graph.js:263:5)
If I run npx expo install react-native-gesture-handler
and build again then I get to the SignIn/Sign Up screen.
I still see the warnings from my previous message in the build log, so not sure why that is.