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

[template] add jsc pickFirst packagingOptions #24535

Closed
wants to merge 1 commit into from

Conversation

Salakar
Copy link
Contributor

@Salakar Salakar commented Apr 19, 2019

Summary

Fixes the following build failures on Android Studio (happening when using the 0.60 template):

image

image

cc @dulmandakh

Changelog

[Android] [Fixed] - Fixed a more than one file was found... lib/x86/libjsc.so build failure with the template

Test Plan

Build is now successful and the app starts with this change:

image

image

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 19, 2019
@Salakar Salakar requested a review from dulmandakh April 19, 2019 21:04
@Kudo
Copy link
Contributor

Kudo commented Apr 22, 2019

@Salakar I am sorry to introduce this issue.
Just doubt why there are multiple lib.jsc.
Could you please provide information below the screenshot you pasted?
IIRC there will have the path to the libjsc.so.

@Salakar
Copy link
Contributor Author

Salakar commented Apr 22, 2019

Hey @Kudo - this was just a fresh RN init of the template currently on 0.60-stable branch (no extra changes made) - there was also nothing extra after the screenshot sorry. I guess the only difference is that it points to the 0.59.5 RN release

Reproducible example from the template is here: https://github.com/invertase/react-native-auto-link-example (a single npx command there to create a template - if you remove the 2 lines from the generated project that I added as part of this PR - invertase/react-native-auto-link-example@71d2cc7 - the error will appear)

@Kudo
Copy link
Contributor

Kudo commented Apr 22, 2019

@Salakar Yes, the problem may related to 0.59.5 release.
The react-native-0.59.5.aar still introduced libjsc.so either by maven dependency or packed x86_64/arm64-v8a lib.jsc directly.
I am sorry that cannot pair 0.60 template with 0.59 AAR.
In the mean time that 0.60-rc not published yet, maybe to generate 0.60 AAR handy ./gradlew :ReactAndroid:installArchives

@Salakar
Copy link
Contributor Author

Salakar commented Apr 22, 2019

@Kudo I agree that this is most likely down to 0.59.5 as well.

Maybe it's still worth merging this though, in case anyone downgrades their template for whatever reason (it happens)?

@Kudo
Copy link
Contributor

Kudo commented Apr 23, 2019

@Salakar IMHO, pickFirst is not reliable to choose correct JSC.
If user like to choose android-jsc-intl from 0.60 but gradle pickFirst may use the JSC from 0.59 (which is no Intl supported).
Intl not defined error happens implicitly.
I would prefer to clarify how duplicated libjsc.so happens instead of just pass the build issue.

In fact, we are trying to remove the pickFirst for libc++_shared.so as well.
react-native-community/jsc-android-buildscripts#95

Copy link
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna land this because it prevents a painful issue for some people in certain situations but I agree we should get rid of the pickFirst stuff altogether.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@Salakar
Copy link
Contributor Author

Salakar commented Apr 23, 2019

@Kudo that's fair, how would you recommend we remove pickFirst behaviour as I can do another PR for this

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @Salakar in 7ac1d18.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Apr 23, 2019
@Kudo
Copy link
Contributor

Kudo commented Apr 24, 2019

@Salakar I still waiting for the PR which exclude libc++_shared.so being merged and release a new version to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants