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

ClassCastException with AGP 4.2.0-alpha01: InternalArtifactType$BUNDLE cannot be cast to ArtifactType #824

Closed
chrisbanes opened this issue Jun 16, 2020 · 4 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@chrisbanes
Copy link

Command: ./gradlew publishRelease

Versions

AGP 4.2.0-alpha01
Gradle 6.5-rc1

Log

2020-06-12T13:09:29.1097373Z Caused by: java.lang.ClassCastException: com.android.build.gradle.internal.scope.InternalArtifactType$BUNDLE cannot be cast to com.android.build.api.artifact.ArtifactType
2020-06-12T13:09:29.1097740Z 	at com.github.triplet.gradle.play.tasks.internal.ArtifactsKt.findBundleFile(Artifacts.kt:15)
2020-06-12T13:09:29.1101219Z 	at com.github.triplet.gradle.play.tasks.PublishBundle.getBundle(PublishBundle.kt:34)
2020-06-12T13:09:29.1101730Z 	at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode$BeanPropertyValue$1$1.create(AbstractNestedRuntimeBeanNode.java:77)
2020-06-12T13:09:29.1102088Z 	at org.gradle.internal.deprecation.DeprecationLogger.whileDisabled(DeprecationLogger.java:228)
2020-06-12T13:09:29.1105581Z 	at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode$BeanPropertyValue$1.get(AbstractNestedRuntimeBeanNode.java:73)
2020-06-12T13:09:29.1105944Z 	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:167)
2020-06-12T13:09:29.1106331Z 	at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode$BeanPropertyValue.call(AbstractNestedRuntimeBeanNode.java:133)
2020-06-12T13:09:29.1109789Z 	at org.gradle.util.GUtil.uncheckedCall(GUtil.java:442)
2020-06-12T13:09:29.1110088Z 	at org.gradle.util.DeferredUtil.unpackNestableDeferred(DeferredUtil.java:64)
2020-06-12T13:09:29.1110361Z 	at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:74)
2020-06-12T13:09:29.1113040Z 	at org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection.visitContents(DefaultFileCollectionFactory.java:306)
2020-06-12T13:09:29.1113395Z 	at org.gradle.api.internal.file.CompositeFileCollection.visitDependencies(CompositeFileCollection.java:140)
2020-06-12T13:09:29.1574075Z 	at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:112)
2020-06-12T13:09:29.1575174Z 	at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmptyEdges.getNodeValues(CachingDirectedGraphWalker.java:213)
2020-06-12T13:09:29.1575716Z 	at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:121)
2020-06-12T13:09:29.1581118Z 	at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:73)
2020-06-12T13:09:29.1581694Z 	at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:67)
2020-06-12T13:09:29.1581953Z 	... 106 more
2020-06-12T13:09:29.1585328Z 
@chrisbanes chrisbanes added the bug Indicates an unexpected problem or unintended behavior label Jun 16, 2020
@SUPERCILEX
Copy link
Collaborator

Use the 3.0 snapshots. The main change is that the public API uses properties now: https://github.com/Triple-T/gradle-play-publisher#snapshot-builds

@chrisbanes
Copy link
Author

Cool, thanks!

@tprochazka
Copy link

U just found the same issue with my plugin, after I rewrote it to Koltin. Until it was in the Gradle which compile it dynamically everything works well, with all versions of the android build plugin. But now I need to compile plugin with android build plugin 4.1 if I want to use it with 4.1 and with 4.0 if I want to use it with an older version, there is just binary incompatibility.

@Queatz
Copy link

Queatz commented Nov 17, 2020

Seeing another incompatibility with 3.1.0-SNAPSHOT gradle 4.2.0-alpha16

com.android.build.api.component.analytics.AnalyticsEnabledApplicationVariantBuilder_Decorated cannot be cast to com.android.build.api.variant.ApplicationVariant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants