I’m trying to build an Android project using Cordova, but I’m getting the following error:
Could not resolve all artifacts for configuration ':CordovaLib:classpath'. Could not find com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3.
I’ve checked the download locations mentioned in the error and it seems that the plugin is not available. I’ve also tried --stacktrace, but I’m not getting any more relevant information. Does anyone know how to resolve this issue or have any suggestions on how to proceed?
I have managed to resolve the above issue, however, I am now facing a new error related to the Bintray library, which requires the http-builder.0.7.2 dependency. I tried applying the same solution as before, adding the https://nexus.web.cern.ch/nexus/content/repositories/public/ repository in the platforms/android/app/build.gradle file. I also added the following line in the dependencies: classpath 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.2'.
Additionally, I tried including the repository in the platforms/android/build.gradle file, but doing so, it no longer recognized the Bintray dependency. Now I am not sure how to make both dependencies work properly. I would appreciate any guidance you could provide.
NOTA!! La solucion para lo de bintray fue agregar los siguientes repositorios en el platforms/android/build.gradle:
maven { url 'https://plugins.gradle.org/m2/' } can be replaced by gradlePluginPortal().
I strongly recommend not to use JitPack if you can anyhow avoid using it, and if you really need it, at least use a content repository filter to define what exactly to take from there. It is broken-by-design as normal repository, unreliable, buggy, and slow.
You should not use a buildscript { ... } block to add plugins to the classpath, but use the plugins { ... } block instead to apply plugins, or to add them to the classpath.
You should not depend on gradlePluginPortal() in your normal repositories unless you develop an actual Gradle plugin where you need other plugins as production dependencies
Using allprojects { ... } or any other means of cross-project configuration is highly discouraged. It immediately introduces project coupling and works-against or disables some more sophisticated Gradle features and optimizations. Instead use convention plugins to centralize build logic, for example in buildSrc or an included build, for example implemented as precompiled script plugin.
More a personal recommendation, I strongly suggest switching to Kotlin DSL. By now it is the default DSL, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.