Skip to content

Fix android aar build #16

Closed
Closed

Description

@ortex

Built aar doesn't work

java.lang.UnsatisfiedLinkError: dlopen failed: library "libroc.so.0.1" not found
    at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
    at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
    at java.lang.System.loadLibrary(System.java:1667)
    at com.github.rocproject.roc.RocLibrary.loadLibrary(RocLibrary.java:5)
    at com.github.rocproject.roc.ChannelSet.<init>(ChannelSet.java:18)
    at com.github.rocproject.roc.ChannelSet.<clinit>(ChannelSet.java:14)

how to build:

export JAVA_VERSION=8 
export ANDROID_API=28 
export ANDROID_BUILD_TOOLS_VERSION=28.0.3 
export ANDROID_NDK_VERSION=21.1.6352462 
export ROC_BASE_DIR=$HOME/roc-build

./scripts/travis/android/install.sh 
./scripts/travis/android/script.sh 

how to reproduce:

As a temporary workaround to build arr I changed in https://github.com/roc-project/roc/blob/master/SConstruct#L1079
from

lib_env['SHLIBSUFFIX'] = '%s.%s' % (lib_env['SHLIBSUFFIX'], abi_version)

to

lib_env['SHLIBSUFFIX'] = '%s' % (lib_env['SHLIBSUFFIX'], abi_version)

Activity

  1. gavv commented on Jun 4, 2020

    @gavv
    Member

    Note: ironically, soname and symlink feature was first introduced specifically for Android port: roc-streaming/roc-toolkit#222 (comment)

  2. MatteoArella commented on Jun 5, 2020

    @MatteoArella
    Member

    Yes gradle plugin doesn't pack shared libraries with extensions that differ from .so so libroc.so.0.1 file won't be packed inside aar.
    I've fixed setting LDFLAGS="-Wl,-soname,libroc.so" before building roc library with scons

  3. added theissue type on Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions