expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
773 stars 81 forks source link

Error: git exited with non-zero code: 128 #1661

Closed alexander01202 closed 1 year ago

alexander01202 commented 1 year ago

Build/Submit details page URL

No response

Summary

I am running eas build --profile development --platform android but it keeps failing.

After it has been compressed and uploaded, I get this error: Error: git exited with non-zero code: 128

It never shows on my eas build dashboard. I do not receive any further error. I have no error doing expo prebuild / expo prebuild --clean.

I have done both but it still didn't work.

Specified value for "android.package" in app.config.js is ignored because an android directory was detected in the project. EAS Build will use the value found in the native code. √ Using remote Android credentials (Expo server) √ Using Keystore from configuration: Build Credentials XXXXXX (default) Compressing project files and uploading to EAS Build. Learn more: https://expo.fyi/eas-build-archive √ Compressed project files 1s (9.5 MB) √ Uploaded to EAS 8s Error: git exited with non-zero code: 128

This is where it stops...

Managed or bare?

bare

Environment

expo-env-info 1.0.5 environment info: System: OS: Windows 10 10.0.19045 Binaries: Node: 16.18.0 - C:\Program Files\nodejs\node.EXE npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD npmPackages: expo: ~44.0.0 => 44.0.6 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-web: 0.17.1 => 0.17.1 Expo Workflow: bare

Error output

Error: git exited with non-zero code: 128

Reproducible demo or steps to reproduce from a blank project

package.json

{ "name": "project", "version": "1.0.0", "scripts": { "start": "expo start --dev-client", "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web", "eject": "expo eject" }, "dependencies": { "@cometchat-pro/react-native-chat": "^3.0.10", "@eliav2/react-native-collapsible-view": "^1.4.0", "@gorhom/bottom-sheet": "^4.3.0", "@notifee/react-native": "^5.2.2", "@react-native-async-storage/async-storage": "~1.15.0", "@react-native-community/netinfo": "7.1.3", "@react-native-firebase/app": "^15.1.1", "@react-native-firebase/messaging": "^15.1.1", "@react-native-masked-view/masked-view": "0.2.6", "@react-native-picker/picker": "2.2.1", "@react-navigation/bottom-tabs": "^6.4.0", "@react-navigation/drawer": "^6.4.1", "@react-navigation/material-top-tabs": "^6.2.1", "@react-navigation/native": "^6.0.10", "@react-navigation/stack": "^6.2.1", "@sentry/react-native": "^4.6.1", "ajv": "^8.11.0", "api": "^4.5.1", "babel-plugin-inline-dotenv": "^1.7.0", "bcrypt": "^5.0.1", "dotenv": "^16.0.1", "expo": "~44.0.0", "expo-app-loading": "~1.3.0", "expo-av": "~10.2.0", "expo-background-fetch": "~10.1.0", "expo-build-properties": "^0.3.0", "expo-constants": "~13.0.1", "expo-crypto": "~10.1.1", "expo-dev-client": "~0.8.6", "expo-device": "~4.1.0", "expo-document-picker": "~10.1.3", "expo-file-system": "~13.1.4", "expo-font": "~10.0.4", "expo-haptics": "~11.1.0", "expo-image-manipulator": "~10.2.0", "expo-image-picker": "~12.0.1", "expo-linear-gradient": "~11.0.3", "expo-location": "~14.0.1", "expo-media-library": "~14.0.0", "expo-notifications": "~0.14.0", "expo-permissions": "~13.1.0", "expo-server-sdk": "^3.6.0", "expo-sharing": "~10.1.0", "expo-splash-screen": "~0.14.1", "expo-status-bar": "~1.2.0", "expo-task-manager": "~10.1.0", "expo-updates": "~0.11.7", "express": "^4.17.3", "firebase": "^9.13.0", "jetifier": "^2.0.0", "lottie-react-native": "5.0.1", "mailersend": "^1.4.5", "messagebird": "^3.7.2", "mixpanel-react-native": "^1.5.0", "moment": "^2.29.3", "mysql": "^2.18.1", "node-fetch": "^3.2.6", "onesignal-expo-plugin": "^1.0.2", "paystack": "^2.0.1", "react": "17.0.1", "react-dom": "17.0.1", "react-native": "0.64.3", "react-native-animatable": "^1.3.3", "react-native-animated-loader": "^0.0.9", "react-native-animated-splash-screen": "^2.0.5", "react-native-collapsible": "^1.6.0", "react-native-dotenv": "^3.3.1", "react-native-easy-content-loader": "^0.3.2", "react-native-fast-image": "^8.6.1", "react-native-flash-message": "^0.2.1", "react-native-gesture-handler": "~2.1.0", "react-native-indicators": "^0.17.0", "react-native-maps": "0.29.4", "react-native-maps-directions": "^1.8.0", "react-native-mask-loader": "^0.0.3", "react-native-masked-loader": "^1.1.4", "react-native-onboarding-swiper": "^1.2.0", "react-native-onesignal": "^4.3.11", "react-native-open-maps": "^0.4.0", "react-native-pager-view": "5.4.9", "react-native-phone-call": "^1.0.9", "react-native-progress": "^5.0.0", "react-native-reanimated": "~2.3.1", "react-native-safe-area-context": "3.3.2", "react-native-screens": "~3.10.1", "react-native-select-dropdown": "^1.11.0", "react-native-snap-carousel": "^3.9.1", "react-native-svg": "12.1.1", "react-native-tab-view": "^3.1.1", "react-native-web": "0.17.1", "react-native-webview": "11.15.0", "react-redux": "^7.2.8", "redux": "^4.1.2", "redux-persist": "^6.0.0", "redux-thunk": "^2.4.1", "rusha": "^0.8.14", "sentry-expo": "^4.0.0", "socket.io": "^4.4.1", "socket.io-client": "^4.4.1", "stream-chat": "^8.3.0", "stream-chat-expo": "^5.9.0", "underscore": "^1.13.4", "use-subscription": ">=1.0.0 <1.6.0", "expo-camera": "~12.1.2" }, "devDependencies": { "@babel/core": "^7.12.9", "@types/mysql": "^2.15.21", "@types/react-native": "^0.67.8" }, "private": true }

wkozyra95 commented 1 year ago

Try running with DEBUG=* environment variable, it should show a stack trace where it's failing. Without more info it's hard to say which exactly git call is failing there.

In the past, the issues like that usually were caused by incorrectly configured git repo. Is this a new repo? Are you able to commit your changes from cli?

alexander01202 commented 1 year ago

No this is not a new repo. I am not able to commit to github. Am I supposed to link my github to my eas cli? I didn't see that in the youtube video I watched when trying to build to eas. Or I'm I misunderstanding your question?

Also, how do I run with the DEBUG=* environment variable ? Do I just add it in my .env file or what? I'm a newbie forgive me

wkozyra95 commented 1 year ago

on Linux/macOS it would be just DEBUG=* eas build, I'm not familiar with setting env variables on windows, but it should be easily googlable.

I am not able to commit to github. Am I supposed to link my github to my eas cli?

No, I'm not saying to GitHub, I'm just asking if you are able to commit your changes in git. You don't need to push it anywhere. Some git command is failing when you run eas build, but the output is hidden, so most likely when you try to commit your changes you will get that error message.

alexander01202 commented 1 year ago

No I have not tried commiting to github.

Do I just run git commit ? Or is there any thing I need to do before that?

Also the env variable, do you have any link or documentation on how to run it with the DEBUG=* ? I have tried checking but I'm getting too many uncommon answers and none of them use this env variable.

Should I set debug to * as a system variable or what? I'm using windows btw

alexander01202 commented 1 year ago

When I try to run git add ., it gives me this error:

warning: LF will be replaced by CRLF in .gitignore. The file will have its original line endings in your working directory error: inflate: data stream error (incorrect header check) error: unable to unpack 5ed78794f961b8d162952daab3aa7dc1130a810a header fatal: loose object 5ed78794f961b8d162952daab3aa7dc1130a810a (stored in .git/objects/5e/d78794f961b8d162952daab3aa7dc1130a810a) is corrupt

Could this be the cause? Or is it something else?

wkozyra95 commented 1 year ago

I have tried checking but I'm getting too many uncommon answers and none of them use this env variable.

Variable is just name and value(here name is DEBUG and value is ), you don't need to check how to set this specific variable, it works the same regardless what you are setting. I didn't test it but just based on google it should probably be just `set DEBUG=` to set it in the current shell

Do I just run git commit ? Or is there any thing I need to do before that?

Sorry for being "you should know that", but git is a fundamental tool that everyone should know. Even if you already resolved the issue I recommend going through some git tutorial to at least familiarize yourself with the basics.

Could this be the cause? Or is it something else?

Yes, it looks like local git repo is corrupted, it might be disk issue or antivirus or maybe sth else, it's hard to tell.

I'm assuming this is a repo generated by expo-cli and you never used git for anything before, so in this case, the only option is to remove .git directory and recreate it with

git init . && git add -A && git commit

This would remove the entire git history, but if you never committed anything before there is nothing to delete, so it should be fine.

alexander01202 commented 1 year ago

I have used git before. Multiple times. I have even done the build before. Just that my laptop got a disk problem and some other stuff caught on and I kinda forgot most of git commands and stuff . I was mostly using git for heroku and netlify. I was still getting familiar with it. I have also committed before and pushed even.

I believe it's a hard disk issue due to my recent occurrence with my drive.

But I can't find any .git directory. I suppose it was corrupted and couldn't be recovered.

Isn't the .git directory suppose to be in the home directory? Or is there a path I'm supposed to check?

alexander01202 commented 1 year ago

Fixed! Thank you for the direction!!!

.git is a hidden file. It wasn't obvious to me because my other project had ,git folder exposed, so I thought something else.

Nevertheless, my build id now working thank you!

smoothwastaken commented 1 year ago

I have tried checking but I'm getting too many uncommon answers and none of them use this env variable.

Variable is just name and value(here name is DEBUG and value is ), you don't need to check how to set this specific variable, it works the same regardless what you are setting. I didn't test it but just based on google it should probably be just `set DEBUG=` to set it in the current shell

Do I just run git commit ? Or is there any thing I need to do before that?

Sorry for being "you should know that", but git is a fundamental tool that everyone should know. Even if you already resolved the issue I recommend going through some git tutorial to at least familiarize yourself with the basics.

Could this be the cause? Or is it something else?

Yes, it looks like local git repo is corrupted, it might be disk issue or antivirus or maybe sth else, it's hard to tell.

I'm assuming this is a repo generated by expo-cli and you never used git for anything before, so in this case, the only option is to remove .git directory and recreate it with

git init . && git add -A && git commit

This would remove the entire git history, but if you never committed anything before there is nothing to delete, so it should be fine.

It worked also for me, I had this error: git exited with non-zero code: 128 Thanks a lot ! 🎉

aitdowu commented 9 months ago

This project I've been working on has been beating my ass all day and I randomly found this thread and it just saved me. I can go to sleep peacefully tonight. Thank you guys so much for your service.