cianru / huawei-appgallery-publish-gradle-plugin

Huawei AppGallery Publish Gradle Plugin allows you to publish the android release build file (*.apk or *.aab) to the Huawei AppGallery store
Apache License 2.0
111 stars 20 forks source link

1.4.1 was compiled with JDK 19 and breaks compability #52

Closed G00fY2 closed 8 months ago

G00fY2 commented 8 months ago

After updating to 1.4.1 we see the following error:

> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':classpath'.
      > Could not resolve ru.cian:plugin:1.4.1.
        Required by:
            project : > ru.cian.huawei-publish-gradle-plugin:ru.cian.huawei-publish-gradle-plugin.gradle.plugin:1.4.1
         > No matching variant of ru.cian:plugin:1.4.1 was found. The consumer was configured to find a library for use during runtime, compatible with Java 17, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.5' but:
             - Variant 'apiElements' capability ru.cian:plugin:1.4.1 declares a library, packaged as a jar, and its dependencies declared externally:
                 - Incompatible because this component declares a component for use during compile-time, compatible with Java 19 and the consumer needed a component for use during runtime, compatible with Java 17
                 - Other compatible attribute:
                     - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
             - Variant 'runtimeElements' capability ru.cian:plugin:1.4.1 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
                 - Incompatible because this component declares a component, compatible with Java 19 and the consumer needed a component, compatible with Java 17
                 - Other compatible attribute:
                     - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')

I opened the "HuaweiPublishPlugin.class" with a hex editor and can clearly see, that the Java Class File Format is set to 00 3F = 63 = Java 19.

You should probably define the jvmTarget in you build.gradle to make sure the plugin is compiled with the desired Java version (otherwise it will pick the jvm version of the compiler that is being used.)

cosic commented 8 months ago

@G00fY2 Hi! That's my fault. I forgot to switch on jdk17 when published plugin. Please try a new 1.4.2 plugin version. It's the same version but built with jdk17 intead of jdk19.

G00fY2 commented 8 months ago

Can confirm that 1.4.2 fixes this issue.