Error when adding android platform in Meteor version 2.16

I have installed java 11, gradle 8.8, android SDK 33, but when running ‘meteor add-platform android’ I get this error message

here is my setting



Could you follow the steps I mentioned here?

With Java 11 we also need to set up cmdline-tools and provide to the env variables. Your issue feels similar, and I can’t see these vars set on your system.

This is included briefly on the docs here. Surely it should be improved to mention how to set up the envs. :memo:

I have successfully added the android platform when switching back to java version 8, and added

App.setPreference("android-minSdkVersion", "30");
App.setPreference("android-compileSdkVersion", "33");
App.setPreference("android-targetSdkVersion", "33");

to the mobile-config file, but there is another problem :frowning:

A problem occurred configuring root project 'VLDC'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:7.4.2.
     Required by:
         project :
      > No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.6' but:
          - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
          - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
          - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
          - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')

update java 8 to 11 , then i got this error

my environment

Within the SDK Manager in Android Studio, go to the SDK Tools tab. Check the Android SDK Command-line Tools (latest)

Did you pre-install the Command-line Tools? Here is a comment visually on how to do it using Android studio.

The error that you get seems to be closely related on what I shared in my comment above. So before going deeper I would like you to verify proper installation and env variable updated. The latter you already showed above.
Could you verify the C:\Users\Woody\AppData\Local\Android\Sdk\cmdline-tools\latest exists as well?

yes, i fixed it, but now it has a different problem with com.google.gms.google-services


:frowning: here is my mobile-config