I have updated the version of Android Studio at the 3.4.1.
Immediately the version of Android Gradle Plugin Version and Gradle Version weren't the last so I have changed with 3.4.1 and 5.1.1 (File > Project structure > Project).
Now, I'm trying to create an apk but I have the error "Could not find com.android.tools.build:gradle:3.4.1".
The project is created with cordova and first I have updated cordova at the version 9.0.0.
I also have noticed that I don't have Build > Generated Signed Apk but only Build > Build Bundle.
After a long search, I have tried to:
1. change task wrapper with
wrapper {gradleVersion = '2.14.1'}
add google() in
repositories { mavenCentral() jcenter() google() }
Verify that the link "distributionUrl=https://services.gradle.org/distributions/gradle-5.1.1-all.zip" is correct
Verify that there is the function mavenCentral()
In File > Settings > Build, Execution... > Build Tools > Gradle "Use default gradle wrapper" is checked and "Offline work" not checked
build.gradle
apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral()
jcenter()
}
// Switch the Android Gradle plugin version requirement depending on the
// installed version of Gradle. This dependency is documented at
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
}
}
// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
repositories {
mavenCentral();
jcenter()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-
5.1.1-all.zip
What can I do to fix the problem? And what can I do to have the function Generated Signed Apk?