Skip to content

Native libraries missing after integration with fresco #361

Closed
@oosmarco

Description

@oosmarco

Hi,

I am trying to integrate fresco (0.5.1) on existing project with pre-build .so libraries. I found original .so files are no longer available in nativeLibraryPath (e.g. /data/app-lib/{PACKAGE_NAME}-N)

I found similar thread related to this #264, yet unable to get it work with creating the missing directories.

Activity

added
needs-detailsThis issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem)
on Jun 10, 2015
tyronen

tyronen commented on Jun 10, 2015

@tyronen
Contributor

What does your build.gradle file look like?

oosmarco

oosmarco commented on Jun 10, 2015

@oosmarco
Author

build.gradle

 dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile project(":VideoRecorder")
        compile "com.android.support:appcompat-v7:21.0.+"
    }

directory structure of library project VideoRecorder

  • build.gradle
  • app/
  • --- libs/
  •       ------ javacpp.jar
    
  •       ------ javacv.jar
    
  • --- src/
  • ------ main/
    
  •   --------- jniLibs/armeabi/*.so
    

build.gradle of VideoRecorder

buildscript {
    repositories {
        jcenter()
    }   
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
    }   
}

allprojects {
    repositories {
        jcenter()
    }   
}

./app/build.gradle of VideoRecorder

apply plugin: 'android-library'

group = 'common.shared'
version = '1.0.0'
archivesBaseName = 'VideoRecorder'

android {
    compileSdkVersion 17
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 17
    }   
}
dependencies {
    compile 'com.android.support:support-v4:+'
    compile files('libs/javacpp.jar')
    compile files('libs/javacv.jar')
}
oosmarco

oosmarco commented on Jun 11, 2015

@oosmarco
Author

We found all .so files are present in the apk file after unzipping with apktool, yet some of them can't be copied to devices nativeLibraryPath for some reason. Any clue for that?

Yet we managed to get the .so libraries included correctly by making separated apks (ref. http://frescolib.org/docs/multiple-apks.html)

added and removed
needs-detailsThis issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem)
on Jun 11, 2015
kassim

kassim commented on Mar 24, 2016

@kassim

a common issue with native libs on Android is that if one native lib is available for an abi then all your native libs need to be available for that abi, it won't fall back to a lower supporting abi, so x86_64 won't fall back to x86

I had to put in this


    packagingOptions {
        exclude "lib/armeabi/libbitmaps.so"
        exclude "lib/armeabi/libgifimage.so"
        exclude "lib/armeabi/libimagepipeline.so"
        exclude "lib/armeabi/libmemchunk.so"
        exclude "lib/armeabi/libwebp.so"
        exclude "lib/armeabi/libwebpimage.so"
        exclude "lib/arm64-v8a/libbitmaps.so"
        exclude "lib/arm64-v8a/libgifimage.so"
        exclude "lib/arm64-v8a/libimagepipeline.so"
        exclude "lib/arm64-v8a/libmemchunk.so"
        exclude "lib/arm64-v8a/libwebp.so"
        exclude "lib/arm64-v8a/libwebpimage.so"
        exclude "lib/x86_64/libbitmaps.so"
        exclude "lib/x86_64/libgifimage.so"
        exclude "lib/x86_64/libimagepipeline.so"
        exclude "lib/x86_64/libmemchunk.so"
        exclude "lib/x86_64/libwebp.so"
        exclude "lib/x86_64/libwebpimage.so"
    }

in the android section of my build.gradle file

to allow a single apk build to work - though the better solution is to produce abi splits

expilu

expilu commented on Mar 15, 2017

@expilu

I'll leave this comment here for the people that might run into my same problem.

I have an app that uses both Fresco and Unity 3D (through a UnityPlayerActivity).

The Unity activity was crashing with the error "unable to find main". I noticed this only happened in devices with arm64-v8a.

Adding what @kassim said to the build.gradle file fixed the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @massimocarli@expilu@tyronen@kassim@oosmarco

        Issue actions

          Native libraries missing after integration with fresco · Issue #361 · facebook/fresco