I have project with an app module and lib module.  The lib module as prebuilt third party jars and native libs that I want to share with app such the the lib module is reuseable with multiple apps which require the same set of jars and native libs. 

My project structure is the following: 
- Local jar files are in the 'libs' folder in the 'lib' module. 
- prebuilt native libs are in the '/src/main/jniLibs/' folder of the 'lib' module

My app build gradle build has the following: 

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }

    packagingOptions{
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    // module dependency
    compile project(":lib")
    // local binary dependency
    compile fileTree(dir: 'libs', include: ['*.jar'])
    // remote binary dependency
    compile 'com.android.support:appcompat-v7:19.+'


My lib module gradle build has the following:

apply plugin: 'android-library'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    // local binary dependency
    compile fileTree(dir: 'libs', include: ['*.jar'])
}


I can work with the API's provided by the jars in the 'lib' module and the project compiles and deploys to device, but the prebuilt native libs are not picked up so the app throws a runtime exception.  Is it possible to include prebuilt native libs from a library module

 

--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to