AAR doesn't include so files from dependency

Hello, I am developing a library for an android app. I have a dependency to an external library that contains some .so lib files and res files. When I build the apk, the .so files and res, from the external library, are included, but when I generate the aar of my library, they are not included.

This is my build.gradle file:
apply plugin: ‘com.android.library’

android {
compileSdkVersion 23
buildToolsVersion “23.0.3”

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 21

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        res.srcDirs = []
        assets.srcDirs = []

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


dependencies {
compile project(’:externalLibrary’)

How should I add the files into the .aar?