Request failed (code 401) on expo build:android

Hi! I’m trying to build the APK for Android but I keep getting a 401 error. I’ve searched everywhere for a solution but none seem to work. I was thinking there was something wrong with my Expo account. First I tried logging out then loggin back in; no luck. Then I created another account, only to get the same 401 errors. I’ve also tried building while my firewall was disabled, still didn’t work.

Solutions I’ve tried but did not work (with links):

  • creating a new account
  • exp logout && exp login then exp build:android
  • npm i -g expo and npm i -g exp

https://forums.expo.dev/t/account-request-failed-with-status-code-401/9664
https://github.com/expo/expo/issues/1740

Here is the error when running expo build:android

Error: Request failed with status code 401
    at createError (C:\Users\tommy\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\core\createError.js:16:15)
    at settle (C:\Users\tommy\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\core\settle.js:17:12)
    at IncomingMessage.handleStreamEnd (C:\Users\tommy\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\adapters\http.js:237:11)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Occasionally I get this error when running expo build:android

Uncaught Error { [Error: EPERM: operation not permitted, rename 'C:\Users\tommy\.expo\state.json.870850413' -> 'C:\Users\tommy\.expo\state.json']
  errno: -4048,
  code: 'EPERM',
  syscall: 'rename',
  path: 'C:\\Users\\tommy\\.expo\\state.json.870850413',
  dest: 'C:\\Users\\tommy\\.expo\\state.json' }

I also get this error when trying to publish from the Expo client:
(It’s strange because I was able to publish my app before with no issues)

Request failed with status code 401
raven@2.6.3 alert: failed to send exception to sentry: HTTP Error (413): undefined

Here are my Expo diagnostics

  Expo CLI 3.0.10 environment info:
    System:
      OS: Windows 10
    Binaries:
      npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD

Thank you!

Hey @limera2nn,

We were experiencing some server issues around the. Could you (if you haven’t already) try to build again and let me know what happens?

Cheers,
Adam

Hi, I tried again and it works now thanks!

I’m also getting this error, but for expo build:ios.

expo build:ios        
Checking if there is a build in progress...

Request failed with status code 401
Error: Request failed with status code 401
    at createError (/Users/chandler/.nvm/versions/node/v9.11.2/lib/node_modules/expo-cli/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/Users/chandler/.nvm/versions/node/v9.11.2/lib/node_modules/expo-cli/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/Users/chandler/.nvm/versions/node/v9.11.2/lib/node_modules/expo-cli/node_modules/axios/lib/adapters/http.js:237:11)
    at IncomingMessage.emit (events.js:208:15)
    at endReadableNT (_stream_readable.js:1154:12)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

REACT CLI seems like a better option because of the expo servers and having to deal with this

401 errors means they are rejecting us as unauthenticated so they are not letting you make apps

Hey @chandlervdw @mazenonexpo,

Are you two using Team accounts? If so, can you be sure that you have the appropriate account username under the owner field in your app.json and also check and make sure you have the appropriate permissions for building under said account.

If you are just using a normal account, we have another issue here. Though I just ran expo build:android and build:ios without issue using a normal account.

2 Likes

Thanks so much for this — the wrong owner field was my issue.

5 Likes

Me Too, It appears to be working, Just got my First App push with React Native great open Source Software Expo!

This is my favorite program right now

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.