Attempting to create Android build with Volt but having some trouble. The following error is received:
An exception has occurred in the compiler (1.8.0_312).
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)
Build failed with an exception. * What went wrong: Execution failed for task ‘:CordovaLib:compileReleaseJavaWithJavac’.
We’ve updated our JDK version to 11 but not sure how to get the Volt build to pick up the change?
Can you double check? I saw at least two which were not up to date.
The next possibility is that a plugin has not been updated to the latest Java. To do that, do some builds leaving plugins out - see which one is causing the error.
Good! if they are all updated, the next possibility is that a plugin has not been updated to the latest Java. To do that, do some builds leaving plugins out - see which one is causing the error.
The error received and provided in the initial post doesn’t indicate that a plugin isn’t picking up the latest Java but that the build isn’t picking up the latest Java. The target sdk (31) requires jdk 11, however jdk 8 is used for build. So, wondering how to get the build to pick up the latest Java?
The move to SDK 31 was done after receiving the following build error:
The minCompileSdk (31) specified in a
dependency’s AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module’s compileSdkVersion (android-30)
Dependency: androidx.work:work-runtime:2.7.0.
The source of the error appears to be “androidx.work:work-runtime:2.7.0”, not a plugin.
Here’s a possible fix
Error from voltbuilder log:
Execution failed for task ‘:app:checkReleaseAarMetadata’.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
The minCompileSdk (31) specified in a
dependency’s AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module’s compileSdkVersion (android-30).
Dependency: androidx.work:work-runtime:2.7.0.
AAR metadata file: /root/.gradle/caches/transforms-3/8bdba0aef32e26b04c7a380b76c30e51/transformed/work-runtime-2.7.0/META-INF/com/android/build/gradle/aar-metadata.properties.
The error appears to stem from Gradle. A possible solution would be to fix how gradle handles this work manager. As referenced in the last post:
You can fix it by forcing Gradle to use an older version of Work Manager for the transitive dependency that works with API 30. In your build.gradle file add:
dependencies {
def work_version = "2.6.0"
// Force WorkManager 2.6.0 for transitive dependency
implementation("androidx.work:work-runtime-ktx:$work_version") {
force = true
}
}
It looks like we have a troller. Oh well, I guess you get what you pay for. Albeit, the monthly fee is small, the petty antagonism is enough to request a refund.
Yikes! I’m sorry if my responses haven’t been helpful yet. Certainly no antagonism was intended.
Internally, VoltBuilder has nothing to do directly with Gradle or androidx.work:work-runtime:2.7.0 or any of the other things you mention. These modules are all pulled in based on the plugins your project uses. That’s why I’ve asked the question whether you’ve figured out which plugin is triggering it.
We haven’t seen this issue before, so we’re trying to learn about it too.
Trying to learn? We’ve provided links multiple times about the error not being related to a plugin, yet almost every response has been about plugins? So, one can only conclude that basic due diligence isn’t being done and the responses can be attributed to a troll.