Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

OneSignal plugin increases gradle build time by a considerable amount #173

Open
ubarua123 opened this issue Jul 19, 2021 · 8 comments
Open

Comments

@ubarua123
Copy link

ubarua123 commented Jul 19, 2021

Please Add The Following

Project Setup

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.5.0'
    apply from: 'versions.gradle'
    ext {
        ....
    }

    repositories {
        google()
        jcenter()
        maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.3'
        classpath deps.kotlin.plugin
        classpath deps.apollo.plugin
        classpath deps.google_android.googleServices_plugin
        classpath deps.firebase.crashlytics_plugin
        classpath(deps.firebase.performance_metrics_plugin) {
            exclude group: 'com.google.guava', module: 'guava-jdk5'
        }
        classpath deps.custom.aboutLibraries_plugin
        classpath 'com.project.starter:easylauncher:3.9.0'
        classpath deps.push.onesignal_plugin
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        mavenLocal()
        maven { url "https://jitpack.io" }
        maven { url "https://dl.bintray.com/unsplash/unsplash-photopicker-android" }
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }

        flatDir {
            dirs 'libs'
        }
    }
    afterEvaluate {
        tasks.withType(JavaCompile.class) {
            options.compilerArgs << "-Xmaxerrs" << "1000"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

// Define versions in a single place


//When there is an error in code generation you will may see
//lots of errors due too missing generated code in your logs, we increase
//how many errors are shown here so that the real error is visible when it is near the end
allprojects {

}

app/build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.apollographql.apollo'
// Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
apply plugin: 'com.starter.easylauncher'

android {
    compileSdkVersion Integer.parseInt(build_versions.compile_sdk)
    buildToolsVersion build_versions.build_tools

    defaultConfig {
        applicationId rootProject.ext.APPLICATION_ID
        minSdkVersion build_versions.min_sdk
        targetSdkVersion build_versions.target_sdk
.
.
.
.
}

Full Error

No Error. However, on each build, the full build is executed even for small layout updates. Which wasn't the case till I added the plugin. I can't give any concrete timings and stats, I'll have to run tests for that. This was an observation.
Getting stuck on Download maven-metadata.xml

Dependency Tree

Run ./gradlew app:dependencies

OUTPUT HERE

OneSignal plugin version

0.13.4

OneSignal SDK version

4.4.0
@jkasten2
Copy link
Member

@ubarua123 We will need details on the time differences you are seeing to investigate.

Can you run ./gradlew build --scan? This will provide a report on time it takes for each task. Please provide one without the OneSignal Gradle Plugin and another with it to compare.

More details on this on Gradle's documentation: https://scans.gradle.com/

@ubarua123
Copy link
Author

I ran a ./gradlew build --scan without the OneSignal plugin and SDK - It took 2m 34s to complete

With the plugin and SDK - 6m 50s

It takes a lot of time in these tasks like

:app > Resolve dependencies of :app:developmentDebugImplementationCopy > maven-metadata.xml`
:app:developmentReleaseRuntimeClasspathCopy > maven-metadata.xml
:app:developmentReleaseRuntimeElementsCopy > maven-metadata.xml
:app:developmentStagingRuntimeElementsCopy > maven-metadata.xml
:app:productionDebugImplementationDependenciesMetadataCopy > maven-metadata.xml
:app:productionDebugRuntimeElementsCopy > maven-metadata.xml
:app:productionReleaseRuntimeClasspathCopy > maven-metadata.xml
:app:productionReleaseRuntimeElementsCopy > maven-metadata.xml
:app:productionStagingImplementationDependenciesMetadataCopy > maven-metadata.xml

and so on .. These tasks are not executed without including OneSignal. I believe it's trying to sync the dependancies each time
One workaround is I run Gradle on offline mode which prevents these tasks. But again, its a workaround.

@llollox
Copy link

llollox commented Oct 25, 2021

Same for me.
No better options were other than using the offline mode.
One Signal plugin increases the build time of the app by several minutes.

Actually, it is executed before every gradle task.
For example, even ./gradlew clean that was taking like 6s to be executed, now it takes 2m 48s.
Removing OneSignal everything goes back to normal.

Any plan to have a look at this issue?

@ubarua123
Copy link
Author

They went completely silent on it. Guess they aren't looking into it.

@StanKuzmenok
Copy link

Same for me. The plugin increases execution time for every Gradle task.
Is it going to be fixed someday?

@MargaritaAva
Copy link

Any update on this? To be honest it's really annoying, it's significantly slows down the development process.

@matteinn
Copy link

Same here, this plugin only adds up 45 seconds average to the build time

@whoisiswhowhois
Copy link

Any updates on this issue? We are having same problem, build times increased enormously.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants