So I am working on an old project and Android Studio warned me to change from jcenter() to mavenCentral() as jcenter() is not beeing updated.
So this was my initial project build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.13
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And I have changed it to the following one:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.13
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
With the initial build.gradle using jcenter() everything was working fine, but using mavenCentral it fails to resolve these 2 github libraries:
"Failed to resolve: com.loopeer.lib:shadow:0.0.3"
"Failed to resolve: com.vatsal.imagezoomer:image-zoomer:1.0.2"
I don´t know why with jcenter() I don´t have any problem and using mavenCentral() yes, could there be any solution or maybe they can be only working with jcenter()?
The curious thing is that for example I have searched for information of one of this libraries and supposedly it should work with mavenCentral -> "ImageZoomer is available in the MavenCentral, so getting it as simple as adding it as a dependency" (This is what it is said in this github library)
Related
I want to install the gradle plugin version 7.6
but I get this Error :
Could not determine the dependencies of task ':path_provider_android:test'.
Could not create task ':path_provider_android:testProfileUnitTest'.
this and base files have different roots: E:\flutter downloader the main program\flutterdownloaderthemainprogram\build\path_provider_android and C:\Users\Gcc\Downloads\Compressed\flutter_windows_3.3.0-stable\flutter.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.22\android.
this is the build.gradle:
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I use the java19
I try java17 and java11
I tried diffrent version of the gradle but I get the same Error
-go to the project terminal (ctrl+j in vscode) and run flutter clean
-go to the android folder and delete the .gradle folder
-run flutter pub get
-run flutter run
I'm using Android Studio Dolphin | 2021.3. I want to get gradle 4.0.1 but I got this:
Could not find com.android.tools.build:gradle:4.0.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom
Required by:
project :
Add google Maven repository and sync project
Open File
build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
There's a Java file I'm meant to convert to Kotlin. I'm stuck with this Gradle problem and can't find my way around it. What can I do to resolve this issue?
Go to build.gradle(Module)
and inside dependencies add the following line.
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
It should look something like this
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
im trying to integrate in HMS Huawei, in adding classpath im have error:
Could not resolve com.huawei.agconnect:agcp:1.6.0.300.
my build.gradle:
buildscript {
repositories {
google()
jcenter()
maven {url 'https://developer.huawei.com/repo/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.8'
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
}
}
allprojects {
repositories {
google()
jcenter()
repositories {
maven { url 'http://dl.bintray.com/swallowsonny/ext/' }
maven { url 'https://jitpack.io' }
maven { url 'https://developer.huawei.com/repo/' }
}
}
}
my gradle ver: 6.7.1 and gradle plugin ver: 4.1.3
Try this:
Go to File -> Project Settings -> Gradle and uncheck the Gradle offline work option.
Synchronize the project again and let all the dependencies get downloaded.
I have corrected settings.gradle like this:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter()
maven {url 'https://developer.huawei.com/repo/'} // add this line
}
}
When I run my App, AS comes up with this error. Says that the file was not found at https://repo.jfrog.org/artifactory/libs-release-bintray/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar?referrer. Please help! Putting google() repo doesn't work.
I ran into this issue as well. Basically, the issue is that mentioned jar file is no longer in jcenter. I resolved by changing the order of search in our app build.gradle:
buildscript {
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}