Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.13k stars 341 forks source link

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

Closed chrisbanes closed 4 years ago

chrisbanes commented 4 years ago

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 
SUPERCILEX commented 4 years ago

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 commented 4 years ago

Cool, thanks!

tprochazka commented 4 years ago

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 commented 4 years ago

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