AutoValue sample: error: cannot find symbol class AutoValue_Animal

后端 未结 1 336
独厮守ぢ
独厮守ぢ 2021-01-22 13:40

I\'m trying to learn about @AutoValue. I follow the example in https://github.com/google/auto/blob/master/value/userguide/index.md

I\'m using Android Studio 3.4

相关标签:
1条回答
  • 2021-01-22 14:33

    Apparent, the issue is because, I put my

    @AutoValue
    abstract class Animal {
        static Animal create(String name, int numberOfLegs) {
            return new AutoValue_Animal(name, numberOfLegs);
        }
    
        abstract String name();
        abstract int numberOfLegs();
    }
    

    In the test folder instead of the source folder. Moving it over to the source folder (same place as MainActivity) solve the problem.

    0 讨论(0)
提交回复
热议问题