Software Archive
Read-only legacy content
17061 Discussions

Android Build Fails: Based on project file size?

Paul_R_
Beginner
343 Views

I'm using Intel XDK 3759, building for Android (with Crosswalk v19 embedded, Cordova CLI v6.2.0, Android min. API 19). I've been able to build my project successfully for testing individual pieces of content, but it fails (or hangs) whenever I try to build with all the content populated and present in the www folder.  I believe this is due to the file size of the complete project, but I'm not sure.  I've tried removing plugins and changing the Cordova CLI version, but neither has helped.  I've also tried numerous builds with various combinations of content; I'm able to build successfully when the final .apk is under ~130 MB, but once I go above that the build process consistently fails or hangs.

I'm not seeing any particular message in the error log (attached, "build.201702045108.txt"); it even states "BUILD SUCCESSFUL" at the end of the log, but no files are listed under the built apk(s).  It does log "All input files are considered out-of-date for incremental task..." for numerous tasks, and subsequently lists "Skipping task...as it has no actions."

 

0 Kudos
5 Replies
PaulF_IntelCorp
Employee
343 Views

There is a total package size limit for builds, but it's not a well-defined number. My recollection is that you hit it at about 400MB. Regardless, the largest size APK you can submit to Google is 100MB. Note that you APK is a ZIP, so it might expand to 300MB (or more) when installed on a device, even if it fits into a 100MB APK.

Regarding the build system, the expanded size of your www + package-assets + plugins folders determines your build footprint. So if your project folder is on the order of 400MB (which may be the case if your APK is >130MB), that is likely the source of the build problem (your project is too large).

0 Kudos
Paul_R_
Beginner
343 Views

Thanks Paul. I'm submitting to Amazon, through FTP, so the size limit is not an issue.  My total folder asset size is anywhere from 200-240 MB.  My 130 MB .apk expands to 176 MB.  I believe I've had the build fail/hang with less (that doesn't include Crosswalk, which I believe is added during the build process?).  Is there anything in the error log regarding the build size limit?

What are my options going forward?  I was think I may need to migrate what I've done in Intel XDK to Cordova CLI, and do the build locally, but I'm not familiar with that process.

0 Kudos
PaulF_IntelCorp
Employee
343 Views

Unfortunately, when you hit the build size limit there is no warning in the build log, the sort of behavior you see there is what we've seen in the past. It's a tough one to catch because it depends on many factors.

See this post for some basic instructions on converting your app to CLI > https://software.intel.com/en-us/forums/intel-xdk/topic/685326#comment-1885369 < and use this conversion script to create a config.xml file based on your current project's settings. The Crosswalk instructions in that xdk-to-cli script will force creation of a multi-architecture Crosswalk APK, so it may come out larger than what you've been building with the XDK (by about 16MB). The net result is easier to work with, because it requires only having to submit one APK to the store for distribution on either ARM or x86 devices.

0 Kudos
Paul_R_
Beginner
343 Views

Thank you; the script was very helpful.  I had some initial CLI build errors, but resolved them by taking the opportunity to update Crosswalk and a few other plugins to more recent versions (that weren't yet available in Intel XDK).

0 Kudos
Namık_Zafer_E_
New Contributor I
343 Views

Hi Paul R,

If you use Cordova CLI build, before adding android platform and building, try to run install command at below link

https://www.npmjs.com/package/cordova-minify

It reduces my application with crosswalk size 47MB to 7.1MB

0 Kudos
Reply