Reputation: 13
I have an android application where I am trying to configure the HMS SDK, I followed the document to created an app in the app gallery, download the config json file, but when trying to add the agconnect plugin I faced some issues, first that I am using gradle DSL, while the document is written for older gradle. I followed the answer here:
to be able to download the plugin.
Now I am facing the following build error that I cannot pass yet,
An exception occurred applying plugin request [id: 'com.huawei.agconnect', artifact: 'com.huawei.agconnect:agcp:1.9.1.301']
> Failed to apply plugin 'com.huawei.agconnect'.
> com.android.tools.build:gradle is no set in the build.gradle file
Here is my project level build.gradle file:
plugins {
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
id 'com.google.gms.google-services' version '4.3.15' apply false
id 'com.huawei.agconnect' version '1.9.1.301' apply false
}
and here is my settings.gradle file:
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url "https://jitpack.io" }
maven {url "https://developer.huawei.com/repo/"}
jcenter()
}
resolutionStrategy {
eachPlugin {
println ">> ${it.requested.id.id}"
println ">> ${it.requested.id.namespace}"
println("-------------------------")
if (it.requested.id.id == 'com.huawei.agconnect') {
it.useModule('com.huawei.agconnect:agcp:1.9.1.301')
}
}
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
jcenter()
maven {url "https://developer.huawei.com/repo/"}
}
}
rootProject.name = "NotificationSample"
include ':app'
include ':NotifySDK'
and here is the plugins part from app module build.gradle file
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.gms.google-services'
id 'com.huawei.agconnect'
}
which is not build. Any ideas about how to solve this?
Upvotes: 1
Views: 260