ponewheel / android-ponewheel

pOneWheel Android app
MIT License
71 stars 25 forks source link

Disable pre dex and reduce parallelism for CI builds #41

Closed twyatt closed 6 years ago

twyatt commented 6 years ago

Attempting to further reduce memory usage during CircleCI builds to address lingering issues.

Disables pre dex which is unnecessary for CI builds:

By default the Gradle android plugin pre-dexes dependencies, converting their Java bytecode into Android bytecode. This speeds up development greatly since gradle only needs to do incremental dexing as you change code.

Because CircleCI always runs clean builds this pre-dexing has no benefit; in fact it makes compilation slower and can also use large quantities of memory. We recommend disabling pre-dexing for Android builds on CircleCI.

See also: Building multi-dex Android project gets OOM

ebabel commented 6 years ago

Unfortunately this build still has the same error.

twyatt commented 6 years ago

Found that the likely cause of this issue is a bug in the Android gradle plugin.

I don't want to assume that there aren't potential implications of updating the Android gradle plugin version, so feel free the bump the version if you want, but the bug sounds to be minor (and can be ignored if you're not ready to upgrade your plugin version).

TL;DR bug in Android gradle plugin versions prior to 3.1.0-alpha5 erroneously emit a stacktrace when project targets 1.8

ebabel commented 6 years ago

Looks like the latest is 3.1.0-alpha5. Maybe we'll just wait for a beta or rc and ignore for now. Thanks for figuring all this out @twyatt!

twyatt commented 6 years ago

By 1.8 I meant:

targetCompatibility JavaVersion.VERSION_1_8