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

Problem creating under a package with UpperCases #25

Closed
vdubedout opened this issue Apr 12, 2016 · 0 comments
Closed

Problem creating under a package with UpperCases #25

vdubedout opened this issue Apr 12, 2016 · 0 comments

Comments

@vdubedout
Copy link

Hi,

I found this error this morning using it.

Reproduce Step:

  • Create a package named MyPackage
  • Create a autovalue MyPackage.MyAutoValue.class
@AutoValue public abstract class MyAutoValue {
    @SerializedName("test") public abstract String test();
    @SerializedName("test_2") public abstract String test2();

    public static MyAutoValue create() {
        return null;
    }
}

-> this compiles

  • add the TypeAdapter
@AutoValue public abstract class MyAutoValue {
    @SerializedName("test") public abstract String test();
    @SerializedName("test_2") public abstract String test2();

    public static MyAutoValue create() {
        return null;
    }

    public static TypeAdapter<MyAutoValue> typeAdapter(Gson gson) {
        return new AutoValue_TestAutoValueGson.GsonTypeAdapter(gson);
    }
}
Error:(8, 40) error: cannot find symbol class MyPackage
Error:(18, 78) error: package MyPackage does not exist
Error:(26, 59) error: package MyPackage does not exist
Error:(35, 25) error: package MyPackage does not exist

I had another error looking like this
Could not find best guess class for .MyPackage.MyAutoValue.class on line 144

   ClassName autoValueClass = ClassName.bestGuess(context.autoValueClass().getQualifiedName().toString());

How to avoid the problem using this release

Put all packages in lowercase

?

Does get qualified name is returning a path with lowercase and another package is looking to an uppercase path?

It was an error by my part using an uppercase in a package but I had hard time to pinpoint the problem.

I hope it helps

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

1 participant