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] Automatically apply android.packagingOptions from gradle.properties #15863

Merged
merged 3 commits into from
Jan 19, 2022

Conversation

EvanBacon
Copy link
Contributor

@EvanBacon EvanBacon commented Jan 10, 2022

Why

  • Android build error for ffmpeg-kit-react-native config-plugins#31 (comment)
  • Provide a safe interface for modifying the android.packagingOptions in the android/app/build.gradle. Users could tap withGradleProperties to statically modify the android.packagingOptions.pickFirsts value.
  • One caveat to this approach is that it's strictly additive so you can't use it to remove existing values (not a use-case I've encountered yet).

Test Plan

  • Not entirely sure how to test if this works since I couldn't reproduce the build errors.

Checklist

  • Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md).
  • This diff will work correctly for expo build (eg: updated @expo/xdl).
  • This diff will work correctly for expo prebuild & EAS Build (eg: updated a module plugin).

@expo-bot expo-bot added the bot: passed checks ExpoBot has nothing to complain about label Jan 10, 2022
@EvanBacon EvanBacon requested a review from Kudo January 11, 2022 19:28
@hirbod
Copy link
Contributor

hirbod commented Jan 11, 2022

I like this approach. Way better than my current regexp attempts.

@EvanBacon EvanBacon marked this pull request as ready for review January 13, 2022 19:40
Copy link
Contributor

@Kudo Kudo left a comment

Choose a reason for hiding this comment

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

i've tried with the example in gradle.properties
android.packagingOptions.excludes = **/x86/libjsc.so,**/x86_64/libjsc.so,**/arm64-v8a/libhermes-inspector.so

and verify with unzip -l app/build/outputs/apk/debug/app-debug.apk | grep libjsc.so

it's even better if we could trim() the spaces. i once added a space after the , and doubt why it didn't work 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants