From 2fd50882b56aa16befd5cfbc3c6b27e53c72474e Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Wed, 4 Dec 2019 23:23:38 -0800 Subject: [PATCH] fix build failure due to duplicate libc++_shared.so (#27417) Summary: This PR fixes build failure caused by duplicate libc++_shared.so, because dependencies (like Flipper) might include one in addition to RN. ## Changelog [Android] [Changed] - fix build failure due to duplicate libc++_shared.so Pull Request resolved: https://github.com/facebook/react-native/pull/27417 Test Plan: Create a project from master, then build and run. Build will fail without the patch, and succeed with the patch. Differential Revision: D18827583 Pulled By: mdvacca fbshipit-source-id: 1272cedd299278403f87215c36aaf58217eae3c5 --- template/android/app/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/template/android/app/build.gradle b/template/android/app/build.gradle index 3267a0b9f29..03fcdf3196c 100644 --- a/template/android/app/build.gradle +++ b/template/android/app/build.gradle @@ -163,6 +163,14 @@ android { proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } + + 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" + } + // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output ->