EAS Android build fails

Hi, my Android builds are failing after upgrading to Expo 47. Here’s the error log from EAS

[stderr]

FAILURE: Build failed with an exception.

135[stderr]

* What went wrong:

136[stderr]

Could not determine the dependencies of task ':app:buildReleasePreBundle'.

137[stderr]

> Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.

138[stderr]

   > Could not resolve com.razorpay:checkout:1.6.+.

139[stderr]

     Required by:

140[stderr]

         project :app > project :react-native-razorpay

141[stderr]

      > Failed to list versions for com.razorpay:checkout.

142[stderr]

         > Unable to load Maven meta-data from https://www.jitpack.io/com/razorpay/checkout/maven-metadata.xml.

143[stderr]

            > Could not GET 'https://www.jitpack.io/com/razorpay/checkout/maven-metadata.xml'. Received status code 521 from server: 

144[stderr]

   > Could not resolve com.github.CanHub:Android-Image-Cropper:4.3.0.

145[stderr]

     Required by:

146[stderr]

         project :app > project :expo > project :expo-image-picker

147[stderr]

      > Skipped due to earlier error

148[stderr]

   > Could not resolve com.github.TalbotGooday:PdfiumAndroid:1.0.1.

149[stderr]

     Required by:

150[stderr]

         project :app > project :react-native-pdf > com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3

151[stderr]

      > Skipped due to earlier error

152[stderr]

* Try:

153[stderr]

> Run with --stacktrace option to get the stack trace.

154[stderr]

> Run with --info or --debug option to get more log output.

155[stderr]

> Run with --scan to get full insights.

156[stderr]

* Get more help at https://help.gradle.org

157[stderr]

BUILD FAILED in 3m 16s

In your post, please share:

  • managed workflow
  • eas-cli/3.1.1 darwin-arm64 node-v18.7.0
  • tried reverting back to older package version of react-native-razorpay but still same error.

Hi @idrlmartian

I can confirm I get the same error:

This is a test SDK 47 app that I installed expo-image-picker and react-native-razorpay in because the error you got mentioned those two.

EDIT: The razorpay one at least seems to be because jitpack.io seems to be down:

Actually, that’s probably the whole problem. The rest all seem to be “Skipped due to earlier error

1 Like

Hi @wodin that’s a relief to know. Just curious - which is the website that tells you if jitpack is down?

The one I used for that screenshot was isup.me, a.k.a. downfor.io, a.k.a downforeveryoneorjustme.com

EDIT: See also: https://status.jitpack.io/

1 Like

@wodin why does jitpack’s official status page say All systems operational which is not what downfor.io shows?

I don’t know, but their own homepage says this:

Also updownradar.com shows:

EDIT: And it I try to fetch the URL it was complaining about I get this:

% curl -I https://www.jitpack.io/com/razorpay/checkout/maven-metadata.xml
HTTP/2 521
date: Thu, 22 Dec 2022 11:33:17 GMT
content-type: text/html; charset=UTF-8
cf-ray: 77d88a5b1ecd4935-CPT
cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
expires: Thu, 01 Jan 1970 00:00:01 GMT
set-cookie: cf_use_ob=0; path=/; expires=Thu, 22-Dec-22 11:33:47 GMT
referrer-policy: same-origin
x-frame-options: SAMEORIGIN
x-jp-cf: 1
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=XvhqCZkBSUb8fM0Rl17tsQGGKgF3ndApRRo1kRNO1411eCh0Xm4p8%2Bd%2F7BV5HVc4jQesQkwSm%2B%2B5gu7ahrwrpGWzWiU00uBnEybFJAZEwnGVOTmcAUoEIjjefMsUiKs%2F"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare

Apparently 521 is a Cloudflare error:

Cloudflare error 521 occurs when Cloudflare cannot make a TCP connection to your origin server. Cloudflare attempted to connect to your origin server on port 80 or 443, but received a connection refused error.

@idrlmartian maybe see if Razorpay can help?

We are not on SDK 47 but also experiencing the issue.

Hi @oops_jenn

This has nothing to do with the Expo SDK. Razorpay’s Java library is hosted on jitpack, which is currently having issues. So when the Android build is built, the library can’t be downloaded and you get this error. If you’re using some other library that is hosted on jitpack you will have the same problem.

EDIT: It seems that Razorpay is not actually hosted on JitPack, but somehow the JitPack outage affected it. I don’t yet understand why that is.

In particular I’m talking about this:

Hi @wodin @oops_jenn
I have filed this issue with razorpay at:

2 Likes

I had another look and I don’t actually see any mention of jitpack.io in react-native-razorpay’s build.gradle. But if you run npx expo prebuild then you’ll see that there is a reference to that in your app’s build.gradle. (If you try this, rather do it in a new test app, because if has side effects like generating the native project and making changes to your package.json etc.

According to what I’ve found this could cause gradle to fall back to jitpack.io instead of Maven Central when trying to fetch com.razorpay:checkout if it can’t find it on Maven Central.

So it could be that the JitPack issues are not the main problem, but I am not entirely sure.

Ok, but the main question is when is Jitpack going to be up now? Its been a long time since this outage and as @oops_jenn mentioned, she’s not able to build it on earlier Expo SDK also.

I am having the same issue since yesterday and JitPack.io is still giving the connection error.

Hello!

Im facing same issue. I think actually to change the url of android deps in build.gradle file from jitpack.io to something equivalent using config plugins what do you think?

JitPack is back up this morning and my build is working now.

2 Likes

I tried a workaround like that earlier (actually just removing JitPack entirely) because it seems that com.razorpay:checkout is actually available on Maven Central, but then I got other build errors.

Attempted workaround that caused other problems

In case you want to give it a try until this problem is resolved, I just added the following to my scripts in package.json:

"eas-build-post-install": "sed -i.bak /jitpack.io/d android/build.gradle; rm -f android/build.gradle.bak"

Just when I was about to post this, @benphung posted to say JitPack is working now :slight_smile:

EDIT: I can confirm it’s working for me now too.

3 Likes

Hello friends, I did all the steps of getting the output correctly, but there is an error
Of course, this problem occurred today, until yesterday I was getting the output easily
Error: Request failed: 403 (Forbidden)