Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error apkOrDex can't be serialized. #32

Merged
merged 1 commit into from
Nov 16, 2015
Merged

fix error apkOrDex can't be serialized. #32

merged 1 commit into from
Nov 16, 2015

Conversation

YangshengLu
Copy link
Contributor

when execute task count**DexMethods. Thought dex methods
can be seen in console output. But there's an exception like
"Property 'apkOrDex' with value 'com.android.build.gradle.internal.api.ApkVariantOutputImpl_Decorated@1f61ab4' cannot be serialized."

when execute task count**DexMethods. Thought dex methods
can be seen in console output. But there's an exception like
"Property 'apkOrDex' with value 'com.android.build.gradle.internal.api.ApkVariantOutputImpl_Decorated@1f61ab4' cannot be serialized."
benjamin-bader added a commit that referenced this pull request Nov 16, 2015
fix error apkOrDex can't be serialized.
@benjamin-bader benjamin-bader merged commit 7e29e72 into KeepSafe:master Nov 16, 2015
@benjamin-bader
Copy link
Collaborator

Thanks!

benjamin-bader added a commit to benjamin-bader/dexcount-gradle-plugin that referenced this pull request Jan 26, 2016
This fixes a bug wherein the dexcount task fails if the variant's output
is renamed after the dexcount plugin is applied and prior to task execution.

This also opts dexcount out of Gradle's incremental compilation cache.  The
proximate cause of this bug is that we're holding a stale `java.io.File`
object; the cure is to instead hold a reference to the variant's output.
This doesn't work with incremental compliation, because variant output
implementations aren't `Serializable` (noted in KeepSafe#32), and Gradle depends
on task state being serializable.  This mismatch means that dexcount will
appear to randomly crash.

The least-bad solution is to just remove the task-input annotation, and
run the count task every time.  Not great, but better than not working.

Fixes KeepSafe#40 and KeepSafe#46.
benjamin-bader added a commit that referenced this pull request Jan 26, 2016
Revert #32, remove `@Input` annotation, add diagnostics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants