Closed ZaLiTHkA closed 5 years ago
Just discovered something interesting: the previous version of our app ran on Android 4.4 and higher, so in order to create a build that I could test on an older device, I dropped the ANDROID_SUPPORT_VERSION
to 19.+
. Now the build completes in 44s
.
How would this make a difference here?
hi @ZaLiTHkA , thanks for raising this issue. A new version of the plugin has been release, 2.1.0, which now allows you to specify a compatible android_support_version without the need to use cordova-android-support-gradle-release
.
cordova plugin add cordova-plugin-file-opener2 --variable ANDROID_SUPPORT_VERSION=27.+
The reason I suggest this is that it could be a combination of the two plugins that causes your build to be slow. Would be good to know if this is the case or not.
Cheers
After a great deal of trial and error and re-re-configuring my Java environment, I can only put this down to some compatibility between numerous different build tools.. I actually ended up with the same slow build times with a few other Cordova-based projects as well, one of which doesn't need this plugin. Guess that's just the nature of software issues, the root cause for some issues aren't all that clear.
Either way, if anyone else does find this thread looking for help with slow Gradle builds, while I can't pinpoint exactly what caused it, I got my build times back down to the expected one or two minutes by removing my custom installation of Gradle. I suspect this may have been an issue where my custom Gradle installation was conflicting with the Gradle Wrapper, all thanks to MS and their horrid handling of environment configuration in Windows.
Anyways, I don't have much experience with Gradle itself (read lots about it though), so going forward I'll simply rely on the Gradle Wrapper based usage that comes bundled with the Phonegap/Cordova project build process.
@shnist, thanks for the note, I saw your response pop up while I was typing.. Since this doesn't seem to be related to this plugin after all, I don't think there's any need to debug it further. Feel free to open this one again if you would like me to test anything specific, but otherwise I'm closing this one as a non-issue.
After not finding anything helpful about why the project I'm working on started taking over 10 minutes to build, I decided to create a blank project and start adding Cordova plugins one-by-one, which led me to this specific plugin causing massive delays for my build.
The steps below cover all the custom plugins our project uses, so for simplicity I'm just going to copy/paste the notes I took through my debugging process:
cz.blocshop.socketsforcordova
:3s
cordova-android@7
cordova-plugin-file
:3s
cordova-sqlite-storage
:4s
cordova-plugin-file-opener2
:7M 36s
but it failed with the messageFailed to execute aapt
15m 16s
but it failed with the same messagecordova-android-support-gradle-release
15s
cordova-android-support-gradle-release
(settingANDROID_SUPPORT_VERSION
to27.+
):4s
cordova-plugin-file-opener2
:8m 50s
, succeeded after re-addingcordova-android-support-gradle-release
8m 27s
Just for reference, before I started checking the plugins, I did a comparison between building our actual project using Ionic CLI wrapper vs the Cordova CLI directly, both with the
--verbose
flag. The output for both can be seen in this Gist.For the sake of environment information: