question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom .so loading breaks Android App Bundles built with Android Gradle Plugin 3.3

See original GitHub issue

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
      Memory: 1.23 GB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.2 - /var/folders/m0/z43h23_j2z93cptz7ddffst4h3whf0/T/yarn--1548357696136-0.8201936393698348/node
      Yarn: 1.12.3 - /var/folders/m0/z43h23_j2z93cptz7ddffst4h3whf0/T/yarn--1548357696136-0.8201936393698348/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.2/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        Build Tools: 23.0.1, 26.0.3, 27.0.2, 27.0.3, 28.0.2, 28.0.3
        API Levels: 23, 25, 26, 27, 28
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      @types/react: 16.4.18 => 16.4.18
      @types/react-native: 0.57.7 => 0.57.7
      react: 16.6.1 => 16.6.1
      react-native: 0.57.7 => 0.57.7
    npmGlobalPackages:
      react-native-cli: 2.0.1

✨  Done in 13.49s.

Description

https://issuetracker.google.com/issues/122953695#comment13 has some comments from Google on this. The .so files are not extracted to disk, so they don’t exist where RN is looking for them. This only occurs with .aab files (app bundles), not .apk files.

“Someone should probably file a bug with reactnative so they stop reading the .so from the install directory and instead read it from the APK or use the standard Android API to load so files.”

Reproducible Demo

Build an Android App Bundle (guide at https://developer.android.com/guide/app-bundle/) using Android Gradle Plugin 3.3 and try to load React Native - it will fail to find libreactnativejni.so

https://developer.android.com/studio/run/#reference has information on App Bundles.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
tgensolcommented, Jan 28, 2019

Same issue. Getting couldn't find DSO to load: libreactnativejni.so with Android Gradle Plugin 3.3 and using Android App bundle. Even with RN 0.58 or 0.58.1, it doest not matter

1reaction
dulmandakhcommented, Apr 10, 2019

IIRC, it was cherry-picked in 0.58.4.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known issues with Android Studio and Android Gradle Plugin
This update causes an underlying behavior change related to signing keys. When you navigate to Build > Generate Signed Bundle / APK and...
Read more >
Android Gradle plugin release notes - Android Developers
If the specified plugin version has not been downloaded, Gradle downloads it the next time you build your project or click File >...
Read more >
About Android App Bundles
Google Play uses your app bundle to generate and serve optimized APKs for each device configuration, so only the code and resources that...
Read more >
Configure your build - Android Developers
Note: Because Gradle and the Android Gradle plugin run independently from Android Studio, you need to update the build tools separately. Read the...
Read more >
Optimize your build speed | Android Developers
Gradle searches repositories in the order that they're declared, so build performance is improved if the repositories listed first contain most of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found