Re: armeabi in Gradle build

1,980 views
Skip to first unread message

Szabolcs Berecz

unread,
Apr 8, 2013, 10:48:38 AM4/8/13
to adt...@googlegroups.com
AFAIK native libraries are not supported, yet. You can use this hack to make it work, though:

Add the following lines to your build.gradle:
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
pkgTask.jniDir new File(projectDir, 'libs')
}
If it does not work (I did not try it), try to make it work based on this: https://gist.github.com/khernyo/4226923


On Mon, Apr 8, 2013 at 11:53 AM, Greg Milette <greg...@gmail.com> wrote:
My ant build works fine, but gradle build doesn't. Is there a special syntax I need to put in my gradle build to handle native libraries?

Details:

My Android project that has:
libs/armeabi/libruntimecore_java.so 
 and 
libs/armeabi-v7a/libruntimecore_java.so 

When I execute the resulting gradle compiled apk, there is a problem with loading the library. 
e.g and error containing this: (findLibrary returned null  at java.lang.Runtime.loadLibrary(Runtime.java:365)

Including this in my gradle build did not work.
        compile fileTree(dir: 'libs/armeabi-v7a', include: '*.so,')
        compile fileTree(dir: 'libs/armeabi', include: '*.so,')

--
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 adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Xavier Ducrohet

unread,
Apr 8, 2013, 1:15:14 PM4/8/13
to adt...@googlegroups.com
NDK support will come later, fully integrated, so right now we don't have the basic support that Ant does. It's close though so the code above should work.
--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Crossle Song

unread,
May 19, 2013, 10:55:44 PM5/19/13
to adt...@googlegroups.com
Oh... We need AQAP

Yonnie Lu

unread,
Jun 5, 2013, 1:25:14 AM6/5/13
to adt...@googlegroups.com
I used this method in gradle plugin 0.4.2. Still not package the so libs to my apk. What's wrong?

Assaf Gamliel

unread,
Jun 16, 2013, 8:09:30 AM6/16/13
to adt...@googlegroups.com
Hey, I'd like to point you here: http://stackoverflow.com/a/17131418/1557187
It worked for me perfectly.
Reply all
Reply to author
Forward
0 new messages