Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

ApiV2Error: Not Authorized when launching #2436

Closed
superandrew opened this issue Aug 7, 2020 · 23 comments
Closed

ApiV2Error: Not Authorized when launching #2436

superandrew opened this issue Aug 7, 2020 · 23 comments

Comments

@superandrew
Copy link

Upgraded to latest expo-cli, cannot launch on ios anymore

Expected Behavior

expo r -c

Observed Behavior

Error below

 Expo  Press ? to show a list of all available commands.
ApiV2Error: Not Authorized.
    at ApiV2Client._requestAsync (/@expo/xdl@57.9.28/src/ApiV2.ts:236:21)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
ApiV2Error: Not Authorized.
    at ApiV2Client._requestAsync (/@expo/xdl@57.9.28/src/ApiV2.ts:236:21)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Environment

Expo CLI 3.23.3 environment info:
System:
OS: macOS 10.15.6
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5692245
Xcode: 11.6/11E708 - /usr/bin/xcodebuild
npmPackages:
expo: ^37.0.0 => 37.0.12
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4
react-navigation: ^4.0.10 => 4.3.9
npmGlobalPackages:
expo-cli: 3.23.3

Reproducible Demo

I am not sure how to reproduce it outside of my computer

@superandrew
Copy link
Author

I checked and with expo-cli@3.20.3 I don't have this problem

@superandrew superandrew changed the title ApiV2Error: Not Authorized when launchin ApiV2Error: Not Authorized when launching Aug 7, 2020
@superandrew
Copy link
Author

I was logging with another user on expo-cli, not sure if this error has been introduced recently? Feel free to close the issue in case.

@byCedric
Copy link
Member

When you authenticate, it writes a session token to the expo cache directory. If you logged in with another user in the CLI, it could overwrite this path and possibly messing this up. Glad you got it working anyways 😄

@chrisdrackett
Copy link

@byCedric not sure if this should be closed. I just ran into this as well and found that downgrading to 3.20.3 also seems to fix the issue. I was trying to run the react-navigation example. Not sure this has anything to do with authentication...

@ewal
Copy link

ewal commented Aug 28, 2020

Posting even though it's closed. Dunno if this is an actual solution but for me it worked by logging out from the terminal with expo logout and after I relaunched expo the message was gone.

@OneHatRepo
Copy link

I have only run into this when Javascript Debugging is enabled. But when the error happens, I can't disable Javascript Debugging. However, expo logout did the trick!

@husniadil
Copy link

I run in to the same problem today when trying to run the react-navigation example project.
Turns out it is caused by the owner field in the app.json. Just remove it (or change it to match with your Expo username) to make it work.

image

@icnaves
Copy link

icnaves commented Sep 28, 2022

expo logout works for me

@mercurio236
Copy link

mercurio236 commented Nov 4, 2022

npx expo start --offline works for me

@mercurio236
Copy link

if the error displayed is this
InkedMicrosoftTeams-image
and in your terminal it is showing only this error
ApiV2Error: Entity Not Authorized

first make sure you have expo-cli installed
https://www.npmjs.com/package/expo-cli

if you have it installed on your machine, just give the command
npx expo logout

if expo-cli is not installed when trying to run the project it will ask to log in with an account

@vestimir
Copy link

vestimir commented Nov 9, 2022

I had the same issue and changing/removing owner didn't help.

You also need to remove the eas part of your app.json configuration (if it was set previously by another developer) and it works like a charm!

@tony-schumacher
Copy link

@vestimir comment was working for me.
Expo was trying to fetch data from the EAS Project ID.

Very painful problem when trying to work on a flight.

Thank you!

@gruckion
Copy link

gruckion commented Dec 30, 2022

None of the above appears to work for me. @vestimir what "eas" config are you speaking off as I don't see any eas config in the app.json

https://github.com/react-navigation/react-navigation/blob/8f8bf02bb77c85cd7a6451533642451954301a94/example/app.json

Must have been blind.

    "extra": {
      "eas": {
        "projectId": "a7070fc4-41f3-403d-826d-292b5d868327"
      }
    },

@vpokrityuk
Copy link

@OneHatRepo Thank you so much! expo logout fixed everything for me as well

@kuriel-trivu
Copy link

kuriel-trivu commented Feb 22, 2023

ApiV2Error: Entity Not Authorized.

Persists.

expo logout not working.

Same user on expo-cli and expo client.

With extra.eas.projectId defined.

expo: ^46.0.0
"expo-dev-client": "~1.1.1",

@codeSage-X
Copy link

I had the same issue and changing/removing owner didn't help.

You also need to remove the eas part of your app.json configuration (if it was set previously by another developer) and it works like a charm!

thank you this works like magic

@fahad0samara
Copy link

same error not fix it

@uwemneku
Copy link

uwemneku commented Apr 7, 2023

npx expo start --offline works for me

This worked.

@nakapon9517
Copy link

Maybe what works with npx expo start -offline is not the essential solution.

I was able to solve the problem with the following steps, and I hope it will be helpful to someone else.

  1. change xxx in the following URL to your organization name
  1. as shown in the attached picture, specify not a specific person but the unit of the organization listed in the red frame in the app.json > owner section
  2. start again with `expo start -clear

I wish you luck in resolving this issue.

image

@HobaiGuigui
Copy link

just lougout into expo accout by running: expo logout

@softicnermin
Copy link

One other scenario/solution:

  1. delete if exists from app.json
"eas": {
       "projectId": "......"
     }
  1. run eas init

This is will add a new projectId to your expo account and update the app.json

@onurbilenlacin
Copy link

I had the same issue and changing/removing owner didn't help.

You also need to remove the eas part of your app.json configuration (if it was set previously by another developer) and it works like a charm!

I only removed row which starting with url. It worked for me. The key which is included in url, was same as eas key
"updates": {
"fallbackToCacheTimeout": 0,
"url": "https://u.expo.dev/......."
},

letam added a commit to letam/expo-image-picker-issue-reproduce that referenced this issue Aug 27, 2023
@zeealik
Copy link

zeealik commented Sep 30, 2023

I got the similar issue and maybe this helps.
expo/eas-cli#1324 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests