Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not resolve com.android.tools.build:gradle:8.3.2 #1829

Open
danielritter opened this issue Dec 29, 2024 · 0 comments
Open

Error: Could not resolve com.android.tools.build:gradle:8.3.2 #1829

danielritter opened this issue Dec 29, 2024 · 0 comments

Comments

@danielritter
Copy link

Environment
My app.gradle:

// You can add your native dependencies here
dependencies {
//  implementation 'androidx.multidex:multidex:2.0.1'
}

android {
    compileSdkVersion 34
    buildToolsVersion "34"
    defaultConfig {
        minSdkVersion 23
        targetSdkVersion 34
        generatedDensities = []
    }

    aaptOptions {
        additionalParameters "--no-version-vectors"
    }
}

and before-plugins.gradle:

// this configurations is loaded before building plugins, as well as before building
// the app - this is where you can apply global settings and overrides

project.ext {
    // androidXAppCompat = "1.4.1"
    // androidXExifInterface = "1.3.3"
    // androidXFragment = "1.4.1"
    // androidXMaterial = "1.5.0"
    // androidXMultidex = "2.0.1"
    // androidXTransition = "1.4.1"
    // androidXViewPager = "1.0.0"

    useKotlin = true
    kotlinVersion = "1.6.0"
    androidBuildToolsVersion = "8.4.0"
}

Describtion
During building I get the following error and nothing changes even when I add androidBuildToolsVersion = "8.4.0" to before-plugings.gradle:

...
 @ ./src/main.ts 2:0-28
WARNING in ./src/app.android.scss
Module Warning (from ../../../../node_modules/@nativescript/webpack/node_modules/sass-loader/dist/cjs.js):
26 repetitive deprecation warnings omitted.
 @ ./src/main.ts 2:0-28
webpack 5.96.1 compiled with 16 warnings in 7855 ms
Webpack compilation complete.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'core'.
> Could not resolve all files for configuration ':classpath'.

> Could not resolve com.android.tools.build:gradle:8.3.2.
     Required by:
         project :
      > No matching variant of com.android.tools.build:gradle:8.3.2 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.4' but:
          - Variant 'apiElements' capability com.android.tools.build:gradle:8.3.2 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 11 and the consumer needed a component for use during runtime, compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.4')
          - Variant 'javadocElements' capability com.android.tools.build:gradle:8.3.2 declares
a component for use during runtime, 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 '8.4')
          - Variant 'runtimeElements' capability com.android.tools.build:gradle:8.3.2 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 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 '8.4')
          - Variant 'sourcesElements' capability com.android.tools.build:gradle:8.3.2 declares a component for use during runtime, 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 '8.4')
* 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.
BUILD FAILED in 855ms
Failed to build plugin @nativescript/core : 
Error: Command gradlew.bat failed with exit code 1

Both version seems the be hardcoded here: https://github.com/search?q=repo%3ANativeScript%2Fandroid%208.3.2&type=code and the androidBuildToolsVersion = "8.4.0" does not have any effect on the version. In the error message and under platforms/tempPlugin/core/build.gradle on line 40, it shows always the version 8.3.2: classpath 'com.android.tools.build:gradle:8.3.2'. It seems to come from package.json version_info. I tried Java 1.8, 11 and 23.

I would like to be able to override the gradle version number, so that I can resolve the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant