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

Native libraries missing after integration with fresco #361

Closed
oosmarco opened this issue Jun 10, 2015 · 5 comments
Closed

Native libraries missing after integration with fresco #361

oosmarco opened this issue Jun 10, 2015 · 5 comments
Labels

Comments

@oosmarco
Copy link

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.

@tyronen tyronen added the needs-details This issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem) label Jun 10, 2015
@tyronen
Copy link
Contributor

tyronen commented Jun 10, 2015

What does your build.gradle file look like?

@oosmarco
Copy link
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
Copy link
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)

@tyronen tyronen added build and removed needs-details This issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem) labels Jun 11, 2015
@kassim
Copy link

kassim commented Mar 24, 2016

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
Copy link

expilu commented Mar 15, 2017

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
Labels
Projects
None yet
Development

No branches or pull requests

5 participants