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

Android Build fail after upgrade to 0.61 (packagingOptions) #26656

Closed
gamingumar opened this issue Sep 30, 2019 · 6 comments
Closed

Android Build fail after upgrade to 0.61 (packagingOptions) #26656

gamingumar opened this issue Sep 30, 2019 · 6 comments
Labels
Bug Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@gamingumar
Copy link

Android Build fails after upgrading to 0.61.1.
The upgrade helper asks to remove these lines and adding these back fixes the build issue.

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

React Native version:

System:
    OS: macOS 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 290.20 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.19.0 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 11.0/11A420a - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.1 => 0.61.1
  npmGlobalPackages:
    react-native-cli: 2.0.1

Steps To Reproduce

  1. Upgrade to 0.61 from any previous version
  2. Build Android

Error in console:

* What went wrong:
Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
> More than one file was found with OS independent path 'lib/x86/libc++_shared.so'

Snack, code example, screenshot, or link to a repository:

Additional Console output:

BUILD FAILED in 23s

    at checkExecSyncError (child_process.js:616:11)
    at execFileSync (child_process.js:634:13)
    at runOnAllDevices (/.../node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:74:39)
    at buildAndRun (/.../node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
    at then.result (/.../node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)
@gamingumar gamingumar added the Bug label Sep 30, 2019
@react-native-bot react-native-bot added the Platform: Android Android applications. label Sep 30, 2019
gamingumar referenced this issue Sep 30, 2019
Summary:
Bump hermes to v0.2.1

allow-large-files

## Changelog

See https://github.com/facebook/hermes/releases/tag/v0.2.1

[Android] [Changed] - Bump hermes to v0.2.1
Pull Request resolved: #26451

Test Plan: RNTester builds and runs as expected

Differential Revision: D17394921

Pulled By: cpojer

fbshipit-source-id: 07ce5da3517b7aa24bfb5e1f6eefed6cdc9f5cb5
@kesha-antonov
Copy link
Contributor

Same here

@hamidfzm
Copy link

hamidfzm commented Oct 2, 2019

Reverting back only the following lines temporary resolved my issue:

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

But as it says in herms release 0.2.1:

The C++ runtime library is now packaged in a separate AAR to avoid pickFirst nondeterminisms

It seems it may cause some problems in the future.

@sunnylqm
Copy link
Contributor

I also met this error. But just after gradlew clean it worked (did not add packagingOptions back)

@mikehardy
Copy link
Contributor

I'm attempting to follow the "use your local react-native fork/branch" instructions on the 0.61-stable branch, and I ran into this.

In an unclean app build state (it had already built before I altered the branch to use my own fork/branch, and I just added the changes documented above and rebuilt, I got this.

I tried a clean per @sunnylqm and a rebuild and that did not work.

I reverted to the pickFirst strategy above and that did work.

Here's where to put them in the context of the file, in case anyone else needs to try pasting them back in and isn't sure what groovy scope they are in https://github.com/react-native-community/rn-diff-purge/blob/release%2F0.60.6/RnDiffApp/android/app/build.gradle#L180

@stale
Copy link

stale bot commented Jan 19, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 19, 2020
@stale
Copy link

stale bot commented Jan 26, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 26, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Jan 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

6 participants