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

Update gradle and mk files #22231

Closed
wants to merge 1 commit into from
Closed

Conversation

hramos
Copy link
Contributor

@hramos hramos commented Nov 9, 2018

Summary:

  • Use clang instead of the deprecated ndkbuild
  • Use libc++ instead of the deprecated gnustl
  • Updated gradle and android plugin version
  • Fixed missing arch in local-cli template
  • clean task should now always succeed
  • clean task deletes build artifacts
  • No need to specify buildToolsVersion. It's derived.
  • Elvis operator for more readable code

Differential Revision: D13004499

Summary:
- Use clang instead of the deprecated ndkbuild
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code

Differential Revision: D13004499

fbshipit-source-id: f1945cb8aaacf7d7719897ab06aae6717b44da93
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. ✅pr adds tests labels Nov 9, 2018
@dulmandakh
Copy link
Contributor

dulmandakh commented Nov 10, 2018

Cool 👍

Also, I think it might be more appropriate to bump compileSdkVersion to 28, because Android Gradle plugin 3.2.x requires build-tools 28.0.3 or above.

@akshetpandey
Copy link

This still needs to address that android-jsc is build with gnustl.
Also, in the summary Use clang instead of the deprecated ndkbuild should instead be Use clang instead of the deprecated gcc as the build still uses the deprecated ndkbuild instead of cmake in case the summary ends up in the changelog

@hey99xx
Copy link

hey99xx commented Nov 13, 2018

Won't this break in runtime as android-jsc still depends on libgnustl? It doesn't ship with as it was deleting libgnustl_shared.so to not conflict with the one used in this project, but I'd guess it still expects to find it in the apk. Will android-jsc just pick up libc++_shared.so and be functional? Otherwise shouldn't Kudo/android-jsc@0437216 go in first?

@hey99xx
Copy link

hey99xx commented Nov 13, 2018

Oh maybe I'm missing this part react-native-community/jsc-android-buildscripts#66 (comment)

@DanielZlotin
Copy link
Contributor

Won't this break in runtime as android-jsc still depends on libgnustl?

Right, I'm trying to allow users to choose which JSC to use, the current old one or the new one. But seeing that the older jsc uses gnustl might prove to be a problem. We probably need to remove this line, good catch. Also the new JSC forces min api 21 but there might be a workaround in the works.

@hey99xx
Copy link

hey99xx commented Nov 14, 2018

Wouldn't it be better to wait for minSdk downgrade that you've already approved and then upgrade to new JSC in here, then android-jsc would be obsolete.
Anyways I'll leave that up to you, maybe you prefer other way as safer; but FYI according to the other PR you can also clean up Folly patch in ReactAndroid/build.gradle#L89-L99.

Edit: Also should others ignore this PR in favor of the new one you've opened?

@Kudo
Copy link
Contributor

Kudo commented Nov 14, 2018

@DanielZlotin FYI, I checked the ticket at https://code.google.com/p/android/issues/detail?id=158630.
The packagingOptions.pickFirst seems to work from android library now.
If this works, we don't need to remove libc++_shared.so from JSC handy.
I will try and update if this works later.

@Kudo
Copy link
Contributor

Kudo commented Nov 14, 2018

Updates:
packagingOptions.pickFirst works, but it should be added in user's application build.gradle.
I.e. at local-cli/templates/HelloWorld/android/app/build.gradle, but not at ReactAndroid/build.gradle
Not pretty perfect.

The usage somehow like this.

android {
    ...
    ...
    packagingOptions {
        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
        pickFirst 'lib/arm64-v8a/libc++_shared.so'
        pickFirst 'lib/x86/libc++_shared.so'
        pickFirst 'lib/x86_64/libc++_shared.so'
    }
}

@DanielZlotin
Copy link
Contributor

Yes please continue discussion on #22263

@hramos hramos closed this Nov 15, 2018
DanielZlotin added a commit to DanielZlotin/react-native that referenced this pull request Nov 25, 2018
Summary:
Pull Request resolved: facebook#22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: facebook#22263

Differential Revision: D13004499

fbshipit-source-id: b4eca5d76482539c2c91833801b534e90cf153eb
pull bot pushed a commit to Rachelmorrell/react-native that referenced this pull request Dec 27, 2018
Summary:
Pull Request resolved: facebook#22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: facebook#22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
@react-native-bot
Copy link
Collaborator

Daniel Zlotin merged commit f3e5cce into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Dec 27, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Dec 27, 2018
vovkasm pushed a commit to vovkasm/react-native that referenced this pull request Dec 31, 2018
Summary:
Pull Request resolved: facebook#22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: facebook#22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
rozele pushed a commit to microsoft/react-native-windows that referenced this pull request Jul 18, 2019
Summary:
Pull Request resolved: facebook/react-native#22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: facebook/react-native#22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
KusStar pushed a commit to KusStar/react-native that referenced this pull request Oct 29, 2020
Summary:
Pull Request resolved: facebook#22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: facebook#22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

9 participants