Could not resolve in adding HMS Huawei repos in gradle - java

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
}
}

Related

Could not find com.android.tools.build:gradle:4.0.1. - android

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

Failed to resolve libraries when changing from jcenter() to mavenCentral()

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)

Failed to resolve: com.paytm.appinvokesdk:appinvokesdk:1.6.5 Paytm integration

Problem causing while integrating patym sdk android. Shows that "Failed to resolve: com.paytm.appinvokesdk:appinvokesdk:1.6.5" while doing with latest build:gradle 7.2.1. Please help me to solve this any help will be appretiated.
modify the settings.gradle file with maven repository
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven {
url "https://artifactory.paytm.in/libs-release-local"
}
}
}
it will help you do the integration of paytm integration

Android Studio Error "lint-gradle-api-26.1.2 not found

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()
}
}

Include AdView library with gradle

I have my android project, and this is my part of my gradle file as explained in tutorial here
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
apply plugin: 'com.android.application'
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
compile project(':engine')
compile project(':android')
compile 'com.google.android.gms:play-services-ads:11.2.0'
}
However after doing this, I still can't seem to include AdView object. It just doesn't seem to import.

Categories

Resources