Comments (11)
Is your compilation failing? The message you have posted is usually a warning by AutoValue which will be fixed in the next AutoValue release.
from auto-value-with.
Yes it is, the AutoValue classes don't seem to be generating when I use the with-er. Is there anyway of getting around this? Or do I just have to wait for the next AutoValue release?
from auto-value-with.
No it should work with 1.2. Can you copy and paste the complete gradle
output?
On Thu, 2 Jun 2016 at 16:46 Veyndan Stuart [email protected] wrote:
Yes it is, the AutoValue classes don't seem to be generating when I use
the with-er. Is there anyway of getting around this? Or do I just have to
wait for the next AutoValue release?—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#29 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABS5GbUL_KgI1-s7k0bn6VwdqzahyiHiks5qHuzXgaJpZM4IsJiQ
.
from auto-value-with.
Executing tasks: [:app:incrementalDebugSupportDex]
Configuration on demand is an incubating feature.
Jack is required to support java 8 language features.
Incremental java compilation is an incubating feature.
Jack is required to support java 8 language features.
:app:buildInfoDebugLoader
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2340Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:app:prepareComJakewhartonButterknife801Library UP-TO-DATE
:app:prepareComJakewhartonRxbindingRxbinding040Library UP-TO-DATE
:app:prepareComSquareupSqlbriteSqlbrite063Library UP-TO-DATE
:app:prepareComTrelloRxlifecycle061Library UP-TO-DATE
:app:prepareComTrelloRxlifecycleComponents061Library UP-TO-DATE
:app:prepareIoReactivexRxandroid120Library UP-TO-DATE
:app:prepareDebugDependencies
:app:transformClassesWithExtractJarsForDebug UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac
/Users/veyndan/AndroidStudioProjects/Hermes/app/src/main/java/com/veyndan/hermes/home/model/Comic.java:32: warning: @autovalue classes cannot have abstract methods other than property getters and Builder converters
public abstract Comic withImgRatio(float imgRatio);
^
/Users/veyndan/AndroidStudioProjects/Hermes/app/src/main/java/com/veyndan/hermes/home/model/Comic.java:32: warning: @autovalue classes cannot have abstract methods other than property getters and Builder converters
public abstract Comic withImgRatio(float imgRatio);
^
/Users/veyndan/AndroidStudioProjects/Hermes/app/build/generated/source/apt/debug/com/veyndan/hermes/home/model/AutoValue_Comic.java:13: error: AutoValue_Comic is not abstract and does not override abstract method withImgRatio(float) in Comic
final class AutoValue_Comic extends $AutoValue_Comic {
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
2 warnings
FAILED
FAILURE: Build failed with an exception.
-
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.Compilation failed; see the compiler error output for details.
-
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.566 secs
from auto-value-with.
It looks like the extension isn't applied. Can you make sure auto-value-with is in the dependency list when running gradle app:dependencies --configuration=apt
?
from auto-value-with.
Yeah it is showing up, here's the cropped output:
+--- com.gabrielittner.auto.value:auto-value-with:0.1.3
| +--- com.google.auto.value:auto-value:1.2
| +--- com.google.auto:auto-common:0.6 ()
| +--- com.google.auto.service:auto-service:1.0-rc2 ()
| +--- com.gabrielittner.auto.value:auto-value-extension-util:0.1.1
| | +--- com.google.auto:auto-common:0.6 ()
| | +--- com.google.auto.service:auto-service:1.0-rc2 ()
| | +--- com.squareup:javapoet:1.6.0 -> 1.7.0
| | --- com.google.auto.value:auto-value:1.2-rc1 -> 1.2
| --- com.squareup:javapoet:1.6.0 -> 1.7.0
from auto-value-with.
Please try if it does work with auto-value-with:0.1.4
and auto-value-cursor:0.5.0
, if not it would be nice if you could create a sample project that reproduces the error (I'm not seeing it).
from auto-value-with.
Thanks! Updating the dependencies seems to have fixed the error. Thanks again for all the quick responses and helping me with this problem.
from auto-value-with.
Hi Gabriel, unfortunately I'm having the same issue. This is my model:
@AutoValue
public abstract class File implements Parcelable {
public abstract String id();
public abstract String messageId();
@Nullable
public abstract String localUri();
public abstract String remoteUri();
public abstract String type();
public abstract long size();
public static Builder builder() {
return new AutoValue_CatapushFile.Builder()
.id(UUID.randomUUID().toString());
}
public abstract CatapushFile withLocalUri(String localUri);
@AutoValue.Builder
public abstract static class Builder {
public abstract Builder id(String id);
public abstract Builder localUri(@Nullable String localUri);
public abstract Builder remoteUri(String remoteUri);
public abstract Builder messageId(String messageId);
public abstract Builder type(String type);
public abstract Builder size(long size);
public abstract CatapushFile build();
}
public boolean isImage() {
final String type = this.type();
return type.equals(Mimes.PNG) || type.equals(Mimes.JPG);
}
}
If I remove:
public abstract CatapushFile withLocalUri(String localUri);
everything is fine, but with the withLocalUri
line I get:
warning: @AutoValue classes cannot have abstract methods other than property getters and Builder converters
/Users/hamen/code/[...]/library/app/src/main/java/com/[...]/library/messages/File.java:34: warning: @AutoValue classes cannot have abstract methods other than property getters and Builder converters
public abstract File withLocalUri(String localUri);
^
:app:compileProductionDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileProductionDebugJavaWithJavac'.
> java.lang.NoSuchMethodError: com.squareup.javapoet.CodeBlock.of(Ljava/lang/String;[Ljava/lang/Object;)Lcom/squareup/javapoet/CodeBlock;
I'm using:
provided "com.google.auto.value:auto-value:1.2"
apt "com.google.auto.value:auto-value:1.2"
apt 'com.ryanharter.auto.value:auto-value-parcel:0.2.1'
apt 'com.gabrielittner.auto.value:auto-value-cursor:0.5.0'
apt 'com.gabrielittner.auto.value:auto-value-with:0.1.4'
I have also tried without the Parcelable
extension but I get the same error message.
Any help? 😕
from auto-value-with.
Do you use Dagger 2? If yes it should be fixed by adding javapoet 1.7 as an apt dependency before dagger.
from auto-value-with.
Thank you, Gabriel. Adding JavaPoet solved the issue with Dagger2:
apt 'com.squareup:javapoet:1.7.0'
compile "com.google.dagger:dagger:${DAGGER_VERSION}"
apt "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"
from auto-value-with.
Related Issues (20)
- Don't attempt to implement non-abstract 'with' methods HOT 1
- The generated class uses an inexistent constructor when using AutoValue's Builder HOT 1
- Get methods are not handled properly HOT 11
- Is @CheckResult used? And if not, why? HOT 3
- 0.1.2's wither implementations return wrong AutoValue class for Nested classes
- Exception when compiling HOT 4
- Add support for generic arguments HOT 1
- Adding with-er methods generates a lot of warnings HOT 1
- @Override annotation is duplicated HOT 2
- Can't use generics in Interface, version 1.4
- Multiple Fields Support HOT 3
- Cut final release since AutoValue 1.3 is released HOT 3
- Is it okay to add an example to this repo HOT 2
- If the model uses two of the same adapter, we get a duplicate field HOT 1
- IllegalStateException: Missing required properties HOT 3
- Allow changes in generic types
- Include @CheckResult on generated methods HOT 1
- IllegalStateException: Missing required properties HOT 2
- Binaries of latest release (1.1.0) lack class files of shaded dependencies HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-value-with.