Environment
- Operating System: Mac M1 Ventura 13.0
export JAVA_HOME="/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home"
export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_SDK_ROOT=${ANDROID_HOME}
export PATH=${PATH}:${ANDROID_HOME}/emulator
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Meteor.js
version@2.12
cordova-android@10.1.2
android-targetSdkVersion 31
Installed Packages
- Gradle 7.5.1
- Android SDK Build Tools 34.0.0-rc4
- Android SDK Command Line Tools 9.0
- Android Emulator 32.1.12
- Android SDK Platform-Tools 34.0.1
> Task :CordovaLib:compileDebugJavaWithJavac FAILED
An exception has occurred in the compiler (1.8.0_332). 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.pp on Android Emulator /
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)
Description
I’m trying to run my Meteor.js Android app using the meteor run android
command on Mac M1, but I’m encountering errors. I have set up the necessary environment variables, installed the required packages and tools, but I’m still getting an error when compiling the app with CordovaLib:compileDebugJavaWithJavac
.
The error message indicates an issue with the Java compiler. Specifically, the error message suggests that the MODULE
attribute is unrecognized by the compiler. I’m unsure how to resolve this error, and I would appreciate any assistance in resolving this issue.
When I researched the error above, I saw a few places that said I should use java 1.11 above and I tried it, and in this case I am getting the error below.
Your system does not yet seem to fulfill all requirements to build apps for Android.
Please follow the installation instructions in the mobile guide:
http://guide.meteor.com/cordova.html#installing-prerequisites
Status of the individual requirements:
✓ Java JDK
✓ Android SDK
✗ Android target: Command failed with exit code 1: avdmanager list target
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more
✓ Gradle