Problem validating app.json: Unable to perform cache refresh - react-native

i had everything working fine, great tool Expo. however, after updating the expo (npm i -g expo --save) i started getting this problem.
i managed to solve the invalid version issue by adding "sdkVersion": "38.0.0" to my app config - but it was working fine before that. don't know why it started appearing now. struggling to solve "unknown option `--assetExts'" issue here, could you please help ?
Warning: Problem validating app.json: Unable to perform cache refresh
for \schema-undefined.json: Error: Request failed with status code 404.
Error: Invalid sdkVersion. Valid options are 7.0.0, 8.0... 38.0.0
error: unknown option `--assetExts'
Metro Bundler process exited with code 1
Set EXPO_DEBUG=true in your env to view the stack trace.

Problem got fixed for me after updating the expo-cli to the latest version:
npm install -g expo-cli

I had the same problem, what solved it for me was clearing the react-native packager cache.
I ran: expo start --clear
Expo cli docs:
https://docs.expo.io/workflow/expo-cli/
In my package I added:
"start:clear": "expo start --clear",
just to help in the future...

Related

Expo-start: An unexpected error has occurred

I am setting up react-native and expo on my machine.
When i run expo start in my terminal i get a blank white screen with the text "An unexpected error has occurred" And also when i scan the QR code i get "Network response timed out".
I tried following all the steps on setting up my expo environment using the docs so i do not know where i went wrong and how to resolve it.
I even tried deleting and reinstalling expo-cli on my machine.
I am using linux and I have expo-cli#5.6.0 installed.
Found the solution! Apparently expo-cli v5.4.10 or greater versions has some issues with the web interface. Rolled back to 5.4.9 and DevTools work again now. This is the rollback command
npm install expo-cli#5.4.9 --location=global
For uninstalling the Previous CLi you can use
yarn global remove expo-cli
or
npm -g uninstall expo-cli --save
if you are using npm

Warning: Invalid version react-native#0.64.2 for expo sdkVersion 43.0.0. Use react-native#0.64.3

I am working on an expo project and everything is working fine, but I began to get a warning message when android is building as
Warning: Invalid version react-native#0.64.2 for expo sdkVersion 43.0.0. Use react-native#0.64.3
The app is still running fine but I don't how to fix this error yet and I want to know if it won't cause an issue later.
I have tried to run npx react-native upgrade 0.64.3 but it didn't work, I got this error
info Fetching diff between v0.64.2 and v0.64.3... error Fetch request
failed with status 404: 404: Not Found. error Failed to fetch diff for
react-native#0.64.3. Maybe it's not released yet?
changing the version of react-native manually in the package.json and run expo install worked for me
I use the expo doctor command it allows diagnose issues with the project.
I would recommend using the expo upgrade command. It upgrades the project packages and config for the given SDK version.
More to find here.
I just faced the same issue. Basically it's telling you should use a higher version of your react-native. I solved it just by updating it to the specified version.
npx react-native upgrade 0.64.3
More info here.
Cheers,
If as in my case one need a specific version of react-native, let's say older because some legacy dependencies in a particular project that for some reason can't be upgrade, then change the version in the package.json won't work.
What worked as the cli suggested is to use:
expo doctor --fix-dependencies
That installed the correct lower version of react-native
To find out actual problems run this command :
expo doctor
To solve all problems regarding package conflicts run this command:
expo doctor --fix-dependencies
Use sudo on Unix based OS if you have permission issue to run those commands.
To solve the error, I used the below command:
npm install react-native-clean-project --save-dev
It is a library that allows us to resolve conflicts.
This library is added to your dependencies.
This handles the problem and if it is not the case add this command:
react-native clean-project-auto

Error: ": Unexpected token \u0000 in JSON at position 0" when using yarn to add a react package

I am trying to install the following package through yarn yarn add react-native-gesture-handler#1.10.2. I read multiple answers to this question yet none was of use. I think the problem might come from the fact I am on a windows computer yet don't know how to solve it.
Whenenever y try to do a yarn add ..#version I get the following error:
yarn add v1.22.11
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is
advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "C:\\Users\\...\\AppData\\Local\\Yarn\\Cache\\v6\\npm-unbox-primitive-1.0.1-085e215625ec3162574dc8859abee78a59b14471-integrity\\node_modules\\unbox-primitive\\.yarn-metadata.json:
Unexpected token \u0000 in JSON at position 0".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\...\\OneDrive\\Documents\\GitHub\\wc_app\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
I have same problem with installing next.js app many times
now its fixed
with clear cache of yarn
yarn cache clean
I have faced a similar problem while creating a latest react native project(0.65) in my Windows machine:
error An unexpected error occurred: "C:\Users\arefin\AppData\Local\Yarn\Cache\v6\npm-is-ci-3.0.0-c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994-integrity\node_modules\is-ci\.yarn-metadata.json: Unexpected token \u0000 in JSON at position 0".
My system configuration for react native development is as follows:
node --version: v15.7.0
yarn --version: 1.22.5
npm --version: 7.12.1
java --version: java 15.0.2 2021-01-19
I used these commands below, which finally solved the problem in my case:
yarn init && yarn add react-native && yarn react-native init
SpendnGain
which I found at here

connect ECONNREFUSED 127.0.0.1:19001 when trying to do `expo publish`

I get this error message when trying to run the expo publish command.
Building iOS bundle
connect ECONNREFUSED 127.0.0.1:19001
Set EXPO_DEBUG=true in your env to view the stack trace.```
I tried updating expo to the latest version, didn't work.
I am using expo-cli version 3.11.9, node version 12.9.0 and npm version 6.10.2.
Any info would be appreciated, thanks in advance.
This error occurs because the React Native application is not running. To avoid this kind of error, you must first start the application and at the same time open another window to run the compile command.
I had the same problem. But after some research (https://forums.expo.io/t/error-when-trying-to-run-exp-publish/223), I found that deleting the .expo folder in your project fixes the problem.
Let me know if that worked for you.

How to solve this error, Uncaught Error: 36.0.0 is not a valid SDK version. Options are 35.0.0, 34.0.0, 33.0.0, UNVERSIONED

I am working on React native new project when I enter npm start I got this error on my Mobile with blue screen Uncaught Error: 36.0.0 is not a valid SDK version. Options are 35.0.0, 34.0.0, 33.0.0, UNVERSIONED. I tried to solve this error by using these commands
npm install (for node module)
expo update
npm install react-native-gesture-handler --save
npm start
But It didn't work, please help me to resolve this issue.
As said here, you can try to delete the expo client on the emulator, and run the project again. This should work.
Here's the documentation of how to upgrade your expo version, but i think you don't will need it, because you're on the latest version.