I was able to resolve this but with some manual steps
- update to gradle 0.10.0
- Make libs module which has the jars and pre-built native so files
At this point the jars show up in external libraries and I can code against
the API's.
- add the following to the lib module gradle build file
ndk{
moduleName "name-of-so-file"
}
where 'name-of-so-file' is as it states the name of the so file without the
extension.
- sync project with gradle files
get the following error
Error:(14, 0) Build script error, unsupported Gradle DSL method found:
'ndk()'!
Possible causes could be:
- you are using Gradle version where the method is absent (<a
href="open_gradle_settings">Fix Gradle settings</a>)
- you didn't apply Gradle plugin which provides the method (<a
href="apply_gradle_plugin">Apply Gradle plugin</a>)
- or there is a mistake in a build script (<a href="goto_source">Goto
source</a>)
- comment out the code from above
// ndk{
// moduleName "name-of-so-file"
// }
- sync project with gradle files
And it works! This is obviously not a clean workflow so is this support
coming, is this a bug, or is this not supported?
-- dan
On Thursday, May 1, 2014 4:40:04 PM UTC-8, Dan O'Neill wrote:
>
> 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 '*lib**s*' folder in the '*lib*' module.
> - prebuilt native libs are in the '*/src/main/jniLibs/*' folder of the '
> *l**ib*' 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.