Expo App Doesn't Load on Android
See original GitHub issueI created a new repo from this template, followed the quickstart guidelines, and got this error from expo:
Error: Unable to resolve module ./index.ts from C:\Users\...\apps\expo/.:
None of these files exist:
* index.ts(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs)
* index.ts\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs)
at ModuleResolver.resolveDependency (C:\Users\...\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:153:15)
at DependencyGraph.resolveDependency (C:\Users\...\node_modules\metro\src\node-haste\DependencyGraph.js:276:43)
at C:\Users\...\node_modules\metro\src\lib\transformHelpers.js:171:21
at Server._resolveRelativePath (C:\Users\...\node_modules\metro\src\Server.js:1256:12)
at async Server.requestProcessor [as _processBundleRequest] (C:\Users\...\node_modules\metro\src\Server.js:529:37)
at async Server._processRequest (C:\Users\...\node_modules\metro\src\Server.js:449:9)
index.ts is definitely in the expo home directory.
What I’ve tried:
- Searching up different issues related to “Expo”, “Unable to resolve module”, and “None of these files exist”
- Changing the value of “main” in expo’s package.json
- Creating a new t3-turbo repo using a different laptop, and a different phone (Do not have a mac, or iPhone)
- Creating a brand new expo app using create-expo-app, but then running pnpm install in it.
Results:
- My hunch is that number 4 is the best lead to solving the problem. For this experiment, I made two expo apps using create-expo-app. For one app, I ran npm install (even if it was unnecessary), and in the other, I ran pnpm install. The npm app ran exactly as expected, but the pnpm app gave the exact same error as above (with a different “main” file). I then tried running npm install in the pnpm app; 2 packages were added and 5 packages were changed. I then ran the pnpm expo app again, and it ran like normal.
- There were a bunch of results that seemed to be related to my searching (1), but I don’t think any of them were this exact problem. It seemed to be a bunch of actual packages that were missing, and a lot of the solutions to their problems were to fix the way something was imported, or to install a new package.
- Changing the value of “main” (2) would give errors if the path didn’t exist. I thought it was possible that the directory it was running from may be different that expected, but after testing a bunch of different paths, it seems like this isn’t the case. In normal expo apps, the “main” file is “./node_modules/expo/AppEntry”. I tried different variations of this too, but was still either given the error above, or the “path doesn’t exist” error
- As for experiment 3, this may be a problem with how I’ve installed things. I am the common denominator. I did a fresh install of practically everything on new devices though (Android Studio, Expo, setting up env vars, etc.), and at the end of everything, I got the exact same error as given above
Is anyone else able to reproduce this issue? Any ideas about what may be wrong?
Issue Analytics
- State:
- Created 9 months ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Unable to connect Android phone to my project with Expo
I was having the same issue, the solution is easy just make a Firewall rule that allows connection from your mobile device to...
Read more >5 common errors found in a React Native app (using Expo)
When creating a mobile app with React Native, you can use Expo to streamline some complexities. Meet the most common errors and how...
Read more >Expo Client doesn't open in android · Issue #8752 - GitHub
The app freezes in splash sreen. I can't even open the camera to get the QR code to emulate my project. Is there...
Read more >Troubleshooting build errors and crashes - Expo Documentation
Go to your build details page (find it on the build dashboard if you don't have it open already) and expand any failed...
Read more >Expo Something Went Wrong : 1 Expo React Native Tip You ...
We consider one important expo react native trick that you should know to help you solve many connection problems. This includes expo app...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am experiencing the same issue. I managed to get Expo Go running again by changing
react
to version18.1.0
.As a side effect I’m now unable to create a build. I’m getting the following error message during the gradlew step:
I’m not sure why but when I change all the react versions in the monorepo to use
18.1.0
the builds start to work again. I feel like there is something wrong with the configuration not fetching the packages from the correct location.I hope Expo SDK 48 isn’t too far out so that we can use React 18.2 with full support - although I haven’t noticed it not working as it is now.