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

Cannot use Builder with custom Parcelable type ? #117

Closed
borsini opened this issue May 2, 2017 · 9 comments
Closed

Cannot use Builder with custom Parcelable type ? #117

borsini opened this issue May 2, 2017 · 9 comments

Comments

@borsini
Copy link

borsini commented May 2, 2017

Hi,

I'm not able to compile when using implements Parcelable with an @AutoValue.Builder and a custom ParcelAdapter I wrote for a Joda DateTime. I got an error: Expected a method with this signature: my.package.Foo.Builder setDescribeContents(int), or a describeContentsBuilder() method.

I'm using auto-value 1.4.1 and parcel-adapter 0.2.5.


import android.os.Parcelable;
import android.support.annotation.Nullable;
import com.google.auto.value.AutoValue;
import com.ryanharter.auto.value.parcel.ParcelAdapter;
import org.joda.time.DateTime;
import my.package.JodaDateTimeAdapter;

@AutoValue
public abstract class Foo implements Parcelable {

    @ParcelAdapter(JodaDateTimeAdapter.class)
    @Nullable
    public abstract DateTime bar();

    public static Builder builder() {
        return new AutoValue_Foo.Builder();
    }

    @AutoValue.Builder
    public abstract static class Builder {
        public abstract Builder setBar(DateTime d);
        public abstract Foo build();
    }
}
@borsini borsini changed the title Cannot use Builder with Parcelable ? Cannot use Builder with custom Parcelable type ? May 2, 2017
@JakeWharton
Copy link
Collaborator

JakeWharton commented May 2, 2017 via email

@grandstaish
Copy link
Contributor

I just tried this with the versions you mentioned and didn't have any issues

@autonomousapps
Copy link

I got a similar issue when I updated my annotation processing from using apt to annotationProcessor. Can't even build my project. Using AutoValue everywhere, as well as the FragmentArgs library.

@davidtcdeveloper
Copy link

Same situation here.
Is there any addition information required? Is there anything I can do to help?

@yuyumonwin
Copy link

Same here. Happens on Kotlin too.

@anbarasuthresnathan
Copy link

Is there any luck anyone Fixed it?

@ZacSweers
Copy link
Collaborator

Please file a bug with auto value, as it seems unrelated here. We can revisit as necessary though

@desh-woes
Copy link

I am currently having the same issue trying to build with bazel. I get the error

Expected a method with this signature: my.package.Foo.Builder.Builder setDescribeContents(int), or a describeContentsBuilder()

While trying to compile implements Parcelable with an @AutoValue.Builder.

How was this issue resolved?

@desh-woes
Copy link

Actually, it seems like this does the trick. compile 'com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.9'

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

No branches or pull requests

9 participants