Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alexander-w-o-s opened this issue Aug 14, 2019 · 26 comments
Assignees
Labels
build Related to App Center's Build service feature request New feature request

Comments

@alexander-w-o-s
Copy link

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):

@alexander-w-o-s alexander-w-o-s added the feature request New feature request label Aug 14, 2019
@YajanaRao
Copy link

YajanaRao commented Aug 19, 2019

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

@dennispan dennispan added the build Related to App Center's Build service label Aug 19, 2019
@nilofer
Copy link

nilofer commented Aug 23, 2019

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

@maxim-lobanov
Copy link

maxim-lobanov commented Aug 27, 2019

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?

@alexander-w-o-s
Copy link
Author

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

@maxim-lobanov
Copy link

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

@a-sane
Copy link

a-sane commented Dec 30, 2019

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

@dennispan
Copy link

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

@a-sane
Copy link

a-sane commented Jan 7, 2020

@dennispan 0.61.5

@dennispan
Copy link

@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

@addingama
Copy link

@dennispan I also have the same problem since today.

jetify task not running

@dennispan
Copy link

@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?

@olethanh
Copy link

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

@artemkhalygov
Copy link

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

@nilofer nilofer assigned phillipleblanc and elamalani and unassigned nilofer Apr 15, 2020
@dennispan
Copy link

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

@bramski
Copy link

bramski commented Oct 8, 2020

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.

@phillipleblanc phillipleblanc removed their assignment Oct 24, 2020
@yasircodingcrafts
Copy link

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.

@yasircodingcrafts
Copy link

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.

@carlosmen-hrbl
Copy link

Seems that jetifier decided to add some extra messages that might be breaking builds:
react-native-community/cli#1409

@mikehardy
Copy link

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

@mikehardy
Copy link

It appears the console.warn's I added are mapped to stderr somehow?
mikehardy/jetifier@a027dd0

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

@stefoid
Copy link

stefoid commented May 5, 2021

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

@mikehardy
Copy link

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...

@stefoid
Copy link

stefoid commented May 5, 2021

you are a saint

thx!

@Arkan4ik
Copy link

@mikehardy I am using 2.0.0 jetifier but have the same problem as author of this issue. Could you help please?

@mikehardy
Copy link

@Arkan4ik as far as I can tell this has nothing to do with me anymore. If you need jetifier to work still, with no console.warns, use v1.x. If you want the deprecation notice, use 2.x

But in my firm opinion, my own software should never be used by anyone anymore. AndroidX conversion is or should be complete and the --no-jetifier tag should be used at all times, in combination with current versions of software

I'm not personally going to spend any more time on AndroidX transition for that reason. The transition is over

@Arkan4ik
Copy link

Arkan4ik commented Apr 23, 2022

@mikehardy 1.68 version solved my problem, thank you. I will take a look to get rid of jetifier later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to App Center's Build service feature request New feature request
Projects
None yet
Development

No branches or pull requests