Skip to content

Android signed release build cannot find DSO to load - Unsatisfied Link Error  #23902

@thomasarogers

Description

@thomasarogers

Bug Description

When running a signed release build on a physical device (Google Pixel 2) the application fails to open and crashes immediately with the error message below. Debug build runs without error.

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: librealmreact.so caused by: Error: Cannot load /data/app/com.singletrack-oLMiw4nVqqKxhbcbq5quCg==/lib/arm/librealmreact.so

image

From the error message it is looking for the librealmreact.so binary in /lib/arm/ but when I analyse the APK the librealmreact.so is located in /lib/armeabi-v7a/ but I do not know why it is searching on the wrong path.

image

Gradle config

apply plugin: "com.android.application"

import com.android.build.OutputFile

project.ext.react = [
entryFile: "index.js",
inputExcludes: ["ios/", "Tests/", "bundle_out/", "default.realm", "default.realm.lock", "default.realm.management/"],
nodeExecutableAndArgs: hasProperty("NODE_PATH")?[NODE_PATH]:["node"]
]

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-sentry/sentry.gradle"

def enableSeparateBuildPerCPUArchitecture = false

def enableProguardInReleaseBuilds = false

android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
    applicationId "com.singletrack"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 1
    versionName "0.7"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }

    enableSeparateBuildPerCPUArchitecture = false
}


dexOptions {
    preDexLibraries false
    javaMaxHeapSize "8g"
}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
    variant.outputs.each { output ->
        // For each separate APK per architecture, set a unique version code as described here:
        // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
        def versionCodes = ["armeabi-v7a":1, "x86":2]
        def abi = output.getFilter(OutputFile.ABI)
        if (abi != null) {  // null for the universal-debug, universal-release variants
            output.versionCodeOverride =
                    versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
        }
    }
}

}

dependencies {
implementation project(':realm')
implementation project(':react-native-sentry')
implementation project(':react-native-push-notification')ns')
implementation project(':react-native-svg')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation 'com.facebook.react:react-native:+'
// From node_modules
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}

Expected Behavior

Application should open and run without error

Environment

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i7-4578U CPU @ 3.00GHz
Memory: 679.33 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.15.0 - /usr/local/opt/node@8/bin/node
npm: 6.4.1 - /usr/local/opt/node@8/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:
API Levels: 23, 26, 27, 28
Build Tools: 23.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3
System Images: android-26 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5264788
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: ^0.57.1 => 0.57.8
npmGlobalPackages:
create-react-native-app: 2.0.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions