Appcenter: Build for React Native Android - new step/task "Running jetifier" (AndroidX, React-Native 0.60)

Created on 14 Aug 2019  路  23Comments  路  Source: microsoft/appcenter

Describe the solution you'd like
Add new step/task "Running jetifier" in App Center Build services for React Native Android.

React Native 0.60 has been migrated over to AndroidX.
This is a breaking change that makes impossible using App Center Build for React Native Android without additional configuration.

Official React Native blog post about AndroidX breaking change in React Native 0.60 - https://facebook.github.io/react-native/blog/2019/07/03/version-60#androidx-support

react-native run-android command now runs jetifier automatically:
https://github.com/react-native-community/cli/blob/master/packages/platform-android/src/commands/runAndroid/index.ts#L70

This automatic jetifier run in react-native cli makes ambiguous why App Center Build service doesn't work for React Native Android.

Describe alternatives you've considered
Create appcenter-pre-build.sh script with following content:

#!/usr/bin/env bash
node node_modules/jetifier/bin/jetify

Additional context
This is important only when React Native project uses react-native modules that are not migrated to AndroidX yet.
Examples of such modules (2019-08-14):

  • react-native-reanimated (https://github.com/kmagiera/react-native-reanimated/issues/337)
  • react-native-vector-icons (https://github.com/oblador/react-native-vector-icons/issues/930)
build feature request

Most helpful comment

Well, today I learned emitting something on console.warn is a breaking change. Honestly shocked about that.

I issued [email protected] that is equivalent to 1.6.6, no console.warn deprecation.

I am going to re-issue the deprecation notice, but if it's a breaking change okay - it'll go out as 2.0. If AppCenter still breaks at that point at least I was trying semver...

All 23 comments

I am facing issue with react-native-gesture-handler. Any update on this issue ?

Hi there, we're taking a look at this issue and working on a solution at the moment! Thanks for your patience!

Hello everyone, the fix for this issue has been deployed recently. Could you please re-save build configuration and run a new build to validate that everything works for you?

@max-lobanov, everything works good. Thank you!

Great!
I am closing the issue, please let me know if you have any questions

Looks like Run Jetify task disapear from appcenter a few days ago

@a-sane What React Native version are you using?

@DennisPan 0.61.5

@a-sane That should work. Could you reach out to support (via the portal)? That'll allow us to collect your app details and look further

@DennisPan I also have the same problem since today.

jetify task not running

@addingama Our team tried couple test applications and couldn't reproduce. Do you mind also reaching out to support for us to take a deeper look?

We had the same problem since two weeks ago. I repushed the branch under a new name and it's working again. Not great

@DennisPan Two days ago everything was good, but now jetify task not running. React Native v0.62.2

@artemkhalygov Please reach out to support so we can take a deeper look.

Not working for me today either. React Native 0.63.0.
package.json has

"postinstall": "npx jetify",

and I setup an appcenter-pre-build.sh as was suggested above. still failing.

Everything was working fine but today it just happened. I setup an appcenter-pre-build.sh as was suggested by @alexander-w-o-s and it finally worked Thanks.
But this issue should not be recurring and that too out of nowhere.

UPDATE:
I think this issued should be re opened, as I am facing this same issue today again.
I added the command in appcenter-pre-build.sh a few months ago, and today out of nowhere I am facing this issue again. I tried to make a build in local machine and ran the jetify command and it's working on local.

Seems that jetifier decided to add some extra messages that might be breaking builds:
https://github.com/react-native-community/cli/issues/1409

Fix your dependencies - that is take the messages into account by proposing PRs to the few straggling modules or use patch-package to fix them locally - at some point jetifier needs to sunset, so far with one day live it appears react-native-track-player and...no other module people have reported are left as stragglers. Close to the finish line on jetifier it just needs your help to fix the final module(s) your app depends on

It appears the console.warn's I added are mapped to stderr somehow?
https://github.com/mikehardy/jetifier/commit/a027dd065c62e19af29afe19e500391b62d39847

That should not happen, and I believe --no-jetifier is the invocation argument for the react-native CLI to not invoke jetifier at all, avoiding all warnings (assuming your project no longer needs jetifier!)

Hope this helps

Screen Shot 2021-05-05 at 10 49 24 am

Well, today I learned emitting something on console.warn is a breaking change. Honestly shocked about that.

I issued [email protected] that is equivalent to 1.6.6, no console.warn deprecation.

I am going to re-issue the deprecation notice, but if it's a breaking change okay - it'll go out as 2.0. If AppCenter still breaks at that point at least I was trying semver...

you are a saint

thx!

Was this page helpful?
0 / 5 - 0 ratings