1. The default content in Settings.gradle in the Android platform directory is
// GENERATED file-do not EDITinclude ":"": Cordovalib"
If you modify this file directly to add a module reference, the next Ionic Cordova build Android command will revert back to the configuration above
So you need to change it somewhere else.
Open the following path file
Android/cordova/lib/builders/gradlebuilder.js
Find this place.
// Write the Settings.gradle file. Fs.writefilesync (Path.join (this. Root, ' Settings.gradle '), '//GENERATED file-do not edit\n ' +< c7/> ' include ': ' \ n ' + settingsgradlepaths.join (') ';
Add your own third-party reference ' include ' to ' include ': ', ': the framework ' \ n '
Final effect
// Write the Settings.gradle file. Fs.writefilesync (Path.join (this. Root, ' Settings.gradle '), '//GENERATED file-do not EDIT \ n ' + ' include ': ', ': Framework ' \ n ' + settingsgradlepaths.join (') ';
Add compile to dependencies content (Project path: "Framework");
Final effect
Dependencies { ' libs ', include: ' *.jar ') // sub-project dependencies START debugcompile (Project (Path: "Cordovalib", Configuration: "Debug")) "Cordovalib", Configuration: "Release")) // sub-project DEPENDENCIES END " Framework "));}
Ionic framework Android platform, adding a third-party module reference