// 删除旧的aar
task deleteOldAar(type: Delete) {
//删除Unity工程下的Android资源
delete 'D:/UnityProjects/AcGame0403/Assets/Plugins/Android/acgame0403-release.aar'
}
//导出aar
task exportAar(type: Copy) {
from('build/outputs/aar/')
into('D:/UnityProjects/AcGame0403/Assets/Plugins/Android/')
include('acgame0403-release.aar')
}
exportAar.dependsOn(deleteOldAar, build)
这段放在build.gradle最后面,然后通过点击as右侧gradle列表中的exportArr执行