一、操作步骤:

在src/android/下,放进目标aar文件,

添加一个同名的.gradle文件,内容:

ext.cdvMinSdkVersion = 15

repositories{
jcenter()
flatDir{
dirs 'libs'
}
}

dependencies {
compile 'com.android.support:support-v4:+'
compile(name:'yocPlugin', ext:'aar')
}

android {
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}

如图所示:
Ionic学习笔记9 自定义插件使用aar_插件

修改plugin.xml,在下加:

<source-file src="src/android/yocPlugin.aar" target-dir="libs" />
<framework src="src/android/yocPlugin.gradle" custom="true" type="gradleReference"/>

二、错误处理

in declare-styleable fontfamilyfont unable to find attribute android:font

修改.gradle文件如下:

dependencies {
compile 'com.android.support:support-v4:23+'
compile(name:'dahuaPlugin', ext:'aar')
}

参考:https://forums.adobe.com/thread/2405676