Android Parcelable models made easy

Overview

AutoParcel

Build status

AutoParcel is an AutoValue extension that enables Parcelable values generation.

Just add implements Parcelable to your @AutoValue annotated models.

@AutoValue
abstract class Person implements Parcelable {
  abstract String name();
  abstract List<Address> addresses();
  abstract Map<Person, Integer> likes();

  static Person create(String name, List<Address> addresses, Map<Person, Integer> likes) {
    return new AutoValue_Person(name, addresses, likes);
  }
}

That's that simple. And you get Parcelable, hashCode, equals and toString implementations for free.

As your models evolve you don't need to worry about keeping all the boilerplate in sync with the new implementation, it's already taken care of.

Download

Clojars Project

Use the same dependency qualifier that you would use for AutoValue (e.g. apt)

buildscript {
  repositories {
    mavenCentral()
    jcenter()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:1.0.0'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
  }
}

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

repositories {
  mavenCentral()
  jcenter()
  maven {url "https://clojars.org/repo/"}
}

dependencies {
  apt 'frankiesardo:auto-parcel:{{latest-version}}'
}

Notice the clojars line in your maven repositories

I recommend using the android-apt plugin so that Android Studio picks up the generated files. Check out the sample project for a working example.

Roadmap

  • Dismantle instanceof checks speeding up runtime serialization #16
  • Walking up superclasses to ensure the object is Parcelable #7
Comments
  • Doesn't work with annotationProcessor new tag from gradle plugin

    Doesn't work with annotationProcessor new tag from gradle plugin

    The latest gradle plugins start deprecating apt in favor of annotationProcessor configuration scope for the android gradle plugin to support the jack and jill compiler. You can test it with classpath 'com.android.tools.build:gradle:2.2.0-alpha4'

    When the current annotation processor is used, I get the following error:

    Gradle 'myProject' project refresh failed
    Error:Cannot change dependencies of configuration ':demo:_debugAnnotationProcessor' after it has been resolved.
    

    Here I paste my gradle config:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 24
        buildToolsVersion "24.0.0"
    
        defaultConfig {
            applicationId "my.mock.package"
            minSdkVersion 15
            targetSdkVersion 24
            versionCode 1
            versionName "1.0"
            useJack true
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.jakewharton:butterknife:8.1.0'
        compile 'com.android.support:appcompat-v7:24.0.0'
        compile 'com.android.support:recyclerview-v7:24.0.0'
        annotationProcessor 'com.jakewharton:butterknife-compiler:8.1.0'
    
        //Autovalue
        annotationProcessor 'com.google.auto.value:auto-value:1.3-rc2'
        provided 'com.google.auto.value:auto-value:1.3-rc2'
        annotationProcessor 'frankiesardo:auto-parcel:1.0.3'
    }
    
    
    opened by droidpl 16
  • Enforce implementation of Parcelable

    Enforce implementation of Parcelable

    We occasionally forget to include implements Parcelable on our declarations which ends up failing at runtime. The processor should enforce that all classes annotated with @AutoParcel indeed include this declaration (either directly or from a base class) thus moving this to a compile-time validation.

    I believe you can look at how @AutoService does verification and copy/paste most or all of its logic.

    opened by JakeWharton 8
  • Remove wildcard dependencies from README.md

    Remove wildcard dependencies from README.md

    Because you shouldn't have them. Ever.

    Also adds jCenter() to the repositories for Gradle, which is now the recommended way for Android. Plus adds a link to Hugo Visser's android-apt repository.

    opened by rock3r 6
  • Compatibility with provided scope

    Compatibility with provided scope

    Could you add support for provided scope?

    To be able use library with

    provided 'com.github.frankiesardo:auto-parcel-processor:+'
    

    instead of having extra dependency from apt and usage

    apt 'com.github.frankiesardo:auto-parcel-processor:+'
    

    With current version, usage of provided scope stops code generation. Environment: Android Studio 0.8.8.

    opened by AlexKorovyansky 6
  • Suggestion to Change Annotation Name, Package

    Suggestion to Change Annotation Name, Package

    The name "Android AutoValue" implies that AutoValue somehow doesn't work on Android which is of course not true. Additionally, when using both this and the original, it's needlessly ambiguous which is in use where. Additionally, using the package of android.* is a bit of an anti-pattern since it conveys you are authoring code on behalf of the platform (and therefore Google).

    I would recommend you change the annotation to @AutoParcel to better convey the behavior and change the package to auto.parcel to line-up with the other Auto offerings.

    Creating a parcel-variant of AutoValue was one of the first things I did when it came out. My version, however, tears out the weird custom string template and removes the Eclipse compiler workaround. It uses @AutoParcel as the annotation and the auto.parcel package. I have a library I want to release which relies on callers creating a few parcelable things. I want to offer a library like this one to make it easy but I am fundamentally against the two things outlined in the first paragraph. I would prefer if you made changes to accommodate these, but it's your library to do with what you want and are of course welcome to say no.

    opened by JakeWharton 5
  • Annotated constructor arguments

    Annotated constructor arguments

    The generated constructor does not keep annotations from the original constructor.

    This causes problems with inspections, checking if a @Nullable argument is passed to non-annotated parameters.

    opened by AndreasDahl 4
  • Proguard warnings about using guava classes

    Proguard warnings about using guava classes

    Since I upgraded to auto-parcel-0.3 my release build fails with these warnings from proguard:

    Warning: library class auto.parcel.processor.SimpleNameFunction extends 
      or implements program class com.google.common.base.Function
    Warning: library class auto.parcel.processor.TypeSimplifier$1$1 extends 
      or implements program class com.google.common.base.Predicate
    Warning: library class com.google.auto.common.MoreTypes$1 extends 
      or implements program class com.google.common.base.Equivalence
    Warning: there were 3 instances of library classes depending on program classes.
             You must avoid such dependencies, since the program classes will
             be processed, while the library classes will remain unchanged.
             (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
    

    These are probably related lines from my build.gradle:

        compile 'com.google.guava:guava:18.0'
        compile 'com.github.frankiesardo:auto-parcel:0.3'
        provided 'com.github.frankiesardo:auto-parcel-processor:0.3'
    

    I am not sure whether this is an issue in auto-parcel, but since I did not have it with 0.2 version I decided to report.

    opened by dimsuz 4
  • Rebase on the latest AutoValue.

    Rebase on the latest AutoValue.

    The latest AutoValue adds support for builders and value validation. Two things which would make complex parcelables much easier to work with.

    Square might be able to do this work in the next few weeks if you do not have the time.

    opened by JakeWharton 4
  • IndexOutOfBoundsException during the empty class generation

    IndexOutOfBoundsException during the empty class generation

    It is not pussible(but sometimes very useful) to have empty parcelable class like this:

    @AutoValue
    public abstract class MyAutoValue implements Parcelable {
        public static MyAutoValue create() { return new AutoValue_MyAutoValue(); }
    }
    

    Now I use workaround, but but it would be very nice to avoid this:

    @AutoValue
    public abstract class MyAutoValue implements Parcelable {
        abstract int noValue();
        public static MyAutoValue create() { return new AutoValue_MyAutoValue(0); }
    }
    

    Pure, empty AutoValue classes work correctly without "implements Parcelable" declaration.

    Error:(8, 17) error: @AutoValue processor threw an exception: java.lang.IndexOutOfBoundsException
    at clojure.lang.PersistentVector.assocN(PersistentVector.java:183)
    at clojure.lang.PersistentVector.assocN(PersistentVector.java:21)
    at clojure.lang.APersistentVector.assoc(APersistentVector.java:333)
    at clojure.lang.APersistentVector.assoc(APersistentVector.java:18)
    at clojure.lang.RT.assoc(RT.java:778)
    at clojure.core$assoc__4142.invoke(core.clj:191)
    at clojure.core$assoc_in.invoke(core.clj:5909)
    at auto_parcel.extension$add_last_QMARK_.invoke(extension.clj:65)
    at auto_parcel.extension$process.invoke(extension.clj:76)
    at clojure.lang.Var.invoke(Var.java:394)
    at auto_parcel.AutoParcelExtension.generateClass(AutoParcelExtension.java:61)
    at com.google.auto.value.processor.AutoValueProcessor.processType(AutoValueProcessor.java:424)
    at com.google.auto.value.processor.AutoValueProcessor.process(AutoValueProcessor.java:143)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
    at com.sun.tools.javac.main.Main.compile(Main.java:523)
    at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
    at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:45)
    at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:101)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:50)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:36)
    at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:34)
    at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
    at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:157)
    at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:139)
    at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93)
    at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    
    opened by zamesilyasa 3
  • Fix Travis Build: Update buildToolsVersion to 22.0.1

    Fix Travis Build: Update buildToolsVersion to 22.0.1

    Update buildToolsVersion to 22.0.1 to match the version in .travis.yml

    The build was failing because .travis.yml defines buildToolsVersion 22.0.1 and the sample uses 22.0.0

    opened by LordRaydenMK 3
  • Why do we need to call all Builder methods?

    Why do we need to call all Builder methods?

    new IllegalStateException("Missing required properties:" + missing is thrown if I don't call all Builder methods. Why do you have such behavior there? Sometimes developer may need to call : AutoParcel_SomeObject.Builder().build(); and now IllegalStateException will be thrown in this case.

    Seems like @Nullable annotation solves that problem but that a bad practice to use that annotation near primitive types.

    opened by bobroalexandr 3
  • ‌Build failed with android studio 3.1

    ‌Build failed with android studio 3.1

    Hi. i want to use auto-parecel alongside simple-stack for this task. When i add this library and sync the gradle everything is ok, but when i build the project this error appear:

    > Error:Could not resolve all files for configuration ':app:debugAnnotationProcessorClasspath'.
    > > Could not resolve frankiesardo:auto-parcel:1.0.3.
    >   Required by:
    >       project :app
    >    > Could not resolve frankiesardo:auto-parcel:1.0.3.
    >       > Could not get resource 'https://clojars.org/repo/frankiesardo/auto-parcel/1.0.3/auto-parcel-1.0.3.pom'.
    >          > Could not GET 'https://clojars.org/repo/frankiesardo/auto-parcel/1.0.3/auto-parcel-1.0.3.pom'. Received status code 403 from server: Request blocked by Privoxy
    

    I follow the instructions in this page for install auto-parcel. And this is my gradle-properties:

    systemProp.http.proxyHost=127.0.0.1
     systemProp.http.proxyPort=8123
     systemProp.https.proxyHost=127.0.0.1
     systemProp.https.proxyPort=8123
     systemProp.socks.proxyHost=127.0.0.1
     systemProp.socks.proxyPort=9050
    
    opened by LinArcX 0
  • Generics are not inherited

    Generics are not inherited

    AutoValue itself handles generics properly:

    Generated("com.google.auto.value.processor.AutoValueProcessor")
     abstract class $AutoValue_Action<T extends Parcelable> extends Action<T> {
    

    But auto-parcel fails:

    final class AutoValue_Action extends $AutoValue_Action {
    

    In 1.0.3, I get raw type

      public AutoValue_Action (
        java.lang.String type,
        T payload
    
    opened by Zhuinden 0
  • Duplicate files copied in APK project.clj

    Duplicate files copied in APK project.clj

    First time I ran the app with AutoParcel enabled was ok. But the next run throws this error and the won't run unless I remove compile 'frankiesardo:auto-parcel:1.0.3' annotationProcessor 'frankiesardo:auto-parcel:1.0.3' from build.gradle

    Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

    com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK project.clj File1: /Users/admin/.gradle/caches/modules-2/files-2.1/stencil/stencil/0.3.5/395c7f24901890f367387a122266b201d3008205/stencil-0.3.5.jar File2: /Users/admin/.gradle/caches/modules-2/files-2.1/slingshot/slingshot/0.10.3/ea80c69fdeb11687a3bd1ba6bb30ec4a41eea7a0/slingshot-0.10.3.jar File3: /Users/admin/.gradle/caches/modules-2/files-2.1/quoin/quoin/0.1.2/dbbb28df3e337233f934468915eb327ff488172/quoin-0.1.2.jar

    opened by iverc 2
  • Make generated constructor package-private

    Make generated constructor package-private

    This gets rid of a synthetic accessor method reducing the method count. See http://blog.bradcampbell.nz/a-comparison-of-parcelable-boilerplate-libraries/

    opened by egor-n 0
  • toBuilder() function is included in the constructor for the auto generated parcel code.

    toBuilder() function is included in the constructor for the auto generated parcel code.

    Builder toBuilder() function is included in the constructor for the auto generated parcel code.

    Error:(128, 14) error: no suitable constructor found for AutoValue_TestSection(String,List<QuoteGroup>,Integer)
    constructor AutoValue_TestSection.AutoValue_TestSection(String,List<QuoteGroup>,Integer,Builder) is not applicable
    (actual and formal argument lists differ in length)
    constructor AutoValue_TestSection.AutoValue_TestSection(Parcel) is not applicable
    (actual and formal argument lists differ in length)
    

    Example class.

    @AutoValue @AutoGson public abstract class TestSection implements Parcelable, Comparable<TestSection> {
    
        public abstract String name();
        public abstract List<QuoteGroup> quoteGroups();
        public abstract Integer id();
        public abstract Builder toBuilder();
    
        @Override public int compareTo(@NonNull TestSection testSection) {
            return id().compareTo(testSection.id());
        }
    
        @AutoValue.Builder public abstract static class Builder {
            public abstract Builder name(String name);
            public abstract Builder quoteGroups(List<QuoteGroup> quoteGroups);
            public abstract Builder id(Integer id);
            public abstract TestSection build();
        }
    }
    
    opened by RoryKelly 0
Releases(v1.0.3)
Owner
Francesco Sardo
Francesco Sardo
:package: Android Parcelables made easy through code generation.

Parceler Have a question? Ask it on StackOverflow. Found an issue? Please report it. In Android, Parcelables are a great way to serialize Java Objects

John Ericksen 3.6k Dec 27, 2022
A easy way to use android sharepreference

Favor A easy way of using Android SharedPreferences. How to use this library Using Gradle compile 'com.cocosw:favor:0.2.0@aar' Using Maven <depend

Kai Liao 467 Nov 10, 2022
A tool to generate Android ContentProviders.

Android ContentProvider Generator (acpg) A tool to generate Android ContentProviders. It takes a set of entity (a.k.a "table") definitions as the inpu

Benoit Lubek 623 Dec 13, 2022
A custom view styling library for Android that generates the obtainStyledAttributes() and TypedArray boilerplate code for you.

DEPRECATED This project is no longer maintained. Consider using https://github.com/airbnb/paris Barber Barber is your personal custom view stylist. Si

Zac Sweers 716 Dec 30, 2022
A code generator to create Android ContentProvider

DatabaseCodeGenerator This project is a code generator written in Java used to generate Android code. Given a database schema JSON definition file, it

Foxykeep 297 Nov 25, 2022
Pure Java code generation tool for generating a fully functional ContentProvider for Android.

RoboCoP RoboCoP is a Java library that can generate a fully-functional ContentProvider from a simple JSON schema file. Get the latest version from our

Rain 246 Dec 29, 2022
Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf. Share code between your backend, Android & iOS app! :sun_with_face:

Anakin Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf. Share code between your backend, Android & iOS app! Descript

Kirill Biakov 17 Jun 25, 2020
Android 注解自动生成与 Flutter 通信的代码

Android-Flutter-Annotation 用于 Android 端项目,通过使用注解自动生成与 Flutter 通信的代码。 可生成的三种通信渠道有: MethodChannel EventChannel BasicMessageChannel 集成 在项目的 build.gradle

JOYY UED 4 Nov 1, 2021
A small tool to help you generate android projects that have a base code.

Volt Project A small tool to help you generate android projects that have a base code. Usage Change project in base directory. python volt-gen.py <pac

Victor Varenik 3 Feb 2, 2022
IntelliJ Plugin for Android Parcelable boilerplate code generation.

IntelliJ/Android Studio Plugin for Android Parcelable boilerplate code generation This tool generates an Android Parcelable implementation based on fi

Michał Charmas 2.1k Dec 27, 2022
Android Parcelable support for the Kotlinx Serialization library.

Android Parcelable support for the Kotlinx Serialization library.

Christopher 50 Nov 20, 2022
Annotation Processor for generating Parcelable code

ParcelablePlease An AnnotationProcessor for generating Android Parcelable boilerplate code. See this blog entry for comparison with other parcel libra

Hannes Dorfmann 260 Mar 31, 2022
Auto-generate the fastest possible Parcelable implementations for Java and Kotlin

This project is deprecated It will still be maintained, but no new features will be added. Please use Parcelize, as it is the official way of generati

Bradley Campbell 492 Nov 17, 2022
An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android.

ThinkRchive An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android. WORK IN PROGRESS GOALS: Use Ret

Racka98 81 Dec 16, 2022
An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android.

An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android. This repo is a Mutliplatform version of the initial Thinkrchive which was Android-centric

Thinkrchive 59 Dec 28, 2022
Saga of Star wars - An Android sample repo showcasing Clean Arch with MVVM and Epoxy models

Star Wars Universe This is a showcase android application written in Kotlin and follows Clean Code architecture to showcase Characters from the StarWa

Adit Lal 5 Dec 13, 2022
An Android project containing image recognition and object detection models.

An Android project containing image recognition and object detection models. Users can input images into the deep learning model by taking photos, opening photo albums, and real-time previews on the Android side. After the calculation on the Android side is completed, the model will output the prediction result and show it to the user.

null 7 Nov 27, 2022
Android Chinese TTS Engine Base On Tensorflow TTS , use for TfLite Models Test。安卓离线中文TTS引擎,在TensorflowTTS基础上开发,用于TfLite模型测试。

Chinese TTS TF Lite 介绍 使用Kotlin + JetPack Compose + Tensorflow Lite开发的TTS引擎,可以完全离线使用。 可选两种模型:FastSpeech和Tacotron,这两种模型均来自TensorFlowTTS 文字转拼音方法来自:Tenso

benjamin wan 116 Jan 2, 2023
Displayin 3D models (.glTF, .glb) in an android app

3D Model Presenting in Android This is a sample android app to present any 3D model with .glb or .glTF extension by using one of 2 easy ways. Aim of t

Onuralp AVCI 8 Dec 2, 2022
A Java library that models spring dynamics and adds real world physics to your app.

Rebound About Rebound is a java library that models spring dynamics. Rebound spring models can be used to create animations that feel natural by intro

Facebook Archive 5.5k Jan 9, 2023