androidthings / sample-googleassistant

Google Assistant API sample for Android Things
Apache License 2.0
467 stars 147 forks source link

Build takes a lot of time "like a build after clean" with jackOptions #40

Closed hpsaturn closed 6 years ago

hpsaturn commented 7 years ago

Hi,

Ever, with each compilation the project take the same time like a build after clean. The solution take from ~4 min to 15 secs with each build. The solution is comment the next options:

jackOptions {
            enabled true
}
compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
}

Tools: AndroidStudio 2.3.3 stable channel. Repository same to master.

Fleker commented 7 years ago

I'm not sure that the issue is related to jack. When you do a build from clean you have to recreate classes from the Protobufs. That compilation process will take longer than a normal Android compilation.

hpsaturn commented 7 years ago

I agree, but this is the point, never it cached the binaries, all compilations have the same time (the next compilations to first), it is a big nightmare, when disabling jack, everything goes back to normal.

Fleker commented 7 years ago

When I do a clean, I expect that the binaries are deleted and need to be regenerated from scratch. I have not been able to reproduce any abnormally long compilation times with a simple rebuild

hpsaturn commented 7 years ago

My system operative and more settings are the next:


Source code (My fork): Google Assistant code for MATRIX Creator

Fleker commented 7 years ago

Can you compile the protobufs into Java classes, then copy those classes to new files and disable the protobuf generation? I think that without that step the compilation should be faster.

hpsaturn commented 7 years ago

But without the jack options works fine and very fast, for this I reported this issue.

proppy commented 7 years ago

I think we may be able to get rid of the jack dependencies now that the grpc code is broken out in a separate module.

Fleker commented 6 years ago

It doesn't seem like we're using Jack now.