question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CastedArrayListArgsBundler gives compilation errors.

See original GitHub issue

I get the following error when trying to use CastedArrayListArgsBundler as a bundler for an Arraylist of parcelable object.

Error:(32, 35) error: incompatible types: List<CAP#1> cannot be converted to List<Foo> where CAP#1 is a fresh type-variable: CAP#1 extends Parcelable from capture of ? extends Parcelable

in my fragment

@Arg(bundler = CastedArrayListArgsBundler.class) List<Foo> foobar;

and my foo class

`public class Foo implements Parcelable { String happy;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.happy);
    }

    public Foo() {
    }

    protected Foo(Parcel in) {
        this.happy = in.readString();
    }

    public static final Parcelable.Creator<Foo> CREATOR = new Parcelable.Creator<Foo>() {
        @Override
        public Foo createFromParcel(Parcel source) {
            return new Foo(source);
        }

        @Override
        public Foo[] newArray(int size) {
            return new Foo[size];
        }
    };
}`

the error is here in the Builder class

` public static final void injectArguments(@NonNull InterestRateDetailsFragment fragment) { Bundle args = fragment.getArguments(); if (args == null) { throw new IllegalStateException("No arguments set. Have you setup this Fragment with the corresponding FragmentArgs Builder? "); }

if (!args.containsKey("com.hannesdorfmann.fragmentargs.custom.bundler.2312A478rand.foobar")) {
  throw new IllegalStateException("required argument foobar is not set");
}
fragment.foobar = bundler1.get("foobar", args); //<-------error here

}`

using latest gradle and build tools

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sockeqwecommented, Jun 10, 2016

Thanks for reporting. It seems that this is a bug

0reactions
sockeqwecommented, Oct 20, 2016

This is fixed in latest 4.0.0-SNAPSHOT

Read more comments on GitHub >

github_iconTop Results From Across the Web

c++ - &(array+1) gives compilation error while &arr works
Because & is taking the address of an lvalue, i.e. an object. arr is an lvalue that corresponds to the array. This is...
Read more >
Correcting Compilation Errors - IBM
The main sections of a compiler listing that are useful for fixing compilation errors are: The source section; The Additional Messages section ...
Read more >
CIS 1100 Compile Errors Walkthrough
Compiler errors happen when you write Java that's syntactically invalid or features a mismatch in acceptable types. In these cases, Java fails to...
Read more >
XCode 14 compile errors immediatel… - Apple Developer
I'm unable to use XCode 14 to develop my app because as soon as a compiler error is shown, it is immediately withdrawn...
Read more >
Compilation error - Wikipedia
Compilation error refers to a state when a compiler fails to compile a piece of computer program source code, either due to errors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found