Here\'s my Ionic Info
cli packages: (/Users/billb/dev/customer-mkt-app/node_modules)
@ionic/cli-utils : 1.15.2
ionic (I
If you are using Cordova build.gradle is automatically generated and when you next build the project the change in accepted answer above get overwritten back to the old that doesn't work.
So edit platforms/android/cordova/lib/builder/GradleBuiler.js Comment out lines 136-139 and add the next line
/*depsList += ' debugCompile(project(path: "' + libName + '", configuration: "debug"))';
insertExclude(p);
depsList += ' releaseCompile(project(path: "' + libName + '", configuration: "release"))';
insertExclude(p);
*/
depsList += " compile project(':CordovaLib')";
insertExclude(p);
This is a known problem you can find the related jira issue here and the underlying problem is this one and both are "in progress". And there is already a pull request on github which you can try out but I can't promise you that it is already a working version. You can install it like this if you would like to try that:
cordova platform add https://github.com/infil00p/cordova-android.git#StudioThreeFix
Add this in Android build .gradle dependencies. That's all.
compile project(':CordovaLib')
For example:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
//debugCompile(project(path: "CordovaLib", configuration: "debug"))
//releaseCompile(project(path: "CordovaLib", configuration: "release"))
compile project(':CordovaLib')
compile "com.android.support:support-v4:24.1.1+"
compile "com.google.android.gms:play-services-analytics:+"
// SUB-PROJECT DEPENDENCIES END
}