google / google/auto

Auto-Factory beta4 fails with DuplicateFileException

Open
#474 15 comments 0 reactions 0 assignees View on GitHub
P3
Dominant language
Java
Stars
10.6k
Forks
1.2k
Avg merge
6h 32m
Merged PRs (30d)
13

Description

When I have a very minimal setup with a factory like:

```java
public class MainActivity extends AppCompatActivity {

@Inject MainActivity_DependencyFactory dependencyFactory;

@Component(modules = MyModule.class)
public interface MyComponent {}

@AutoFactory public static class Dependency {

public Dependency(@Provided String string) {}
}

@Module public abstract class MyModule {

@Provides String provideString() {
return "something";
}
}
}
```

With only the necessary dependencies

```groovy

dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
provided "javax.annotation:jsr250-api:1.0"

compile 'com.google.dagger:dagger:2.10'
annotationProcessor 'com.google.dagger:dagger-compiler:2.10'

compile "com.google.auto.factory:auto-factory:1.0-beta4"
compile 'com.android.support:multidex:1.0.1'
}
```

It works fine with beta3. However with beta4 I get a lot errors. I already cleared the cache.

```
Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK plugin.xml
File1: /home/ph1b/.gradle/caches/modules-2/files-2.1/org.eclipse.core/org.eclipse.core.contenttype/3.4.100/7052e115041d04410a4519a61307502fb7c138e6/org.eclipse.core.contenttype-3.4.100.jar
File2: /home/ph1b/.gradle/caches/modules-2/files-2.1/org.eclipse.equinox/org.eclipse.equinox.app/1.3.100/e7169b33d352f5ddb6eace73f5a4d29aae3b91ec/org.eclipse.equinox.app-1.3.100.jar
File3: /home/ph1b/.gradle/caches/modules-2/files-2.1/org.eclipse.core/org.eclipse.core.filesystem/1.3.100/37fce4f5488a21ce36021d4909acaf5687e1595e/org.eclipse.core.filesystem-1.3.100.jar
File4: /home/ph1b/.gradle/caches/modules-2/files-2.1/org.eclipse.equinox/org.eclipse.equinox.registry/3.5.101/eac5aeb82732847bc7f11e2b5c934004c4c7a543/org.eclipse.equinox.registry-3.5.101.jar
File5: /home/ph1b/.gradle/caches/modules-2/files-2.1/org.eclipse.equinox/org.eclipse.equinox.preferences/3.4.1/6770649a91266a4a17747b201723a1fea8c8a198/org.eclipse.equinox.preferences-3.4.1.jar
File6: /home/ph1b/.gradle/caches/modules-2/files-2.1/org.eclipse.core/org.eclipse.core.expressions/3.4.300/42b2139abd5638730db317a51949dac3b8d81492/org.eclipse.core.expressions-3.4.300.jar
File7: /home/ph1b/.gradle/caches/modules-2/files-2.1/org.eclipse.jdt/org.eclipse.jdt.core/3.10.0/647e19b28c106a63a14401c0f5956289792adf2f/org.eclipse.jdt.core-3.10.0.jar
File8: /home/ph1b/.gradle/caches/modules-2/files-2.1/org.eclipse.core/org.eclipse.core.resources/3.7.100/6c56ea28b84afe7d55de02763846e76dbfb0b689/org.eclipse.core.resources-3.7.100.jar
File9: /home/ph1b/.gradle/caches/modules-2/files-2.1/org.eclipse.core/org.eclipse.core.runtime/3.7.0/6658c235056134f7e86295e751129508802d71f2/org.eclipse.core.runtime-3.7.0.jar
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.