Cordova Slack Digest

Sat, 05 Mar 2022 08:21:07 GMT

User count: 4687

Join the conversation at slack.cordova.io

Channel #cordova-android (9 messages)


Fri, 04 Mar 2022 09:11:46 GMT

@nepmontanez says

Hi guys, is Cordova Android v10.1.1 support Android SDK 31 as a targetSDKversion in config.xml? thank you

Fri, 04 Mar 2022 10:39:22 GMT

@nepmontanez says

cause I'm running an error message while building my app

Fri, 04 Mar 2022 10:42:36 GMT

@nepmontanez says

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\...\AppData\Local\Android\Sdk (recommended setting)
ANDROID_HOME=undefined (DEPRECATED)
Using Android SDK: C:\Users\...\AppData\Local\Android\Sdk
Reading build config file: C:\<Project_Name>\<Project_Name>\build.json
Subproject Path: CordovaLib
Subproject Path: app

> Task :CordovaLib:compileDebugJavaWithJavac FAILED
An exception has occurred in the compiler (1.8.0_321). Please file a bug against the Java compiler via the Java bug reporting page (<http://bugreport.java.com>) after checking the Bug Database (<http://bugs.java.com>) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)
        at com.sun.tools.javac.util.Assert.error(Assert.java:133)
        at com.sun.tools.javac.code.TypeAnnotations.annotationType(TypeAnnotations.java:231)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.separateAnnotationsKinds(TypeAnnotations.java:294)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitMethodDef(TypeAnnotations.java:1066)
        at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitClassDef(TypeAnnotations.java:1042)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
        at com.sun.tools.javac.code.TypeAnnotations$1.run(TypeAnnotations.java:127)
        at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:152)
        at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
        at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)
        at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
        at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
        at org.gradle.internal.compiler.java.IncrementalCompileTask.call(IncrementalCompileTask.java:89)
        ....

* What went wrong:
Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
&gt; Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.        

* Get more help at <https://help.gradle.org>

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See <https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings>

BUILD FAILED in 2s
23 actionable tasks: 2 executed, 21 up-to-date
Command failed with exit code 1: C:\&lt;Project_Name&gt;\&lt;Project_Name&gt;\platforms\android\gradlew cdvBuildDebug -b C:\&lt;Project_Name&gt;\&lt;Project_Name&gt;\platforms\android\build.gradle```

Fri, 04 Mar 2022 11:38:22 GMT

@erisu says

Cordova-Android 10.x only supports targetSDK 30.

As far as I remember, targetSDK 31 will require Java 11 and this change might require other changes such as build tool, Gradle, etc..

You will probably need to investigate and research into those changes and might need to also apply changes to the core code, where needed.

Fri, 04 Mar 2022 11:49:02 GMT

@javarea says

I recomend u open a proyect in android studio. Many times Android Studio solved the build problems

Fri, 04 Mar 2022 11:50:30 GMT

@nepmontanez says

thank you for the respond guys

Fri, 04 Mar 2022 11:54:27 GMT

@nepmontanez says

I was researching the issue but still not able to fix it. @erisu @javarea Is true that if your app does not support SDK 31, it will not be available in the Play Store for Android 12 phones? thank you

Fri, 04 Mar 2022 12:01:51 GMT

@erisu says

No, it should still be visible to Android 12 phones.

targetSdkVersion > This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version. The application is still able to run on older versions (down to minSdkVersion).

Fri, 04 Mar 2022 12:12:32 GMT

@nepmontanez says

oh! thanks a lot @erisu