What can be wrong with?
Failed to find provider info for com.huawei.hms.contentprovider
Error while getting app update info
java.util.concurrent.ExecutionException: com.huawei.agconnect.exception.AGCServerException: code: 5 message: url is null
at com.huawei.hmf.tasks.a.j.a(Unknown Source:17)
at com.huawei.hmf.tasks.Tasks.await(Unknown Source:33)
at com.huawei.agconnect.remoteconfig.internal.a$2.run(Unknown Source:8)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: com.huawei.agconnect.exception.AGCServerException: code: 5 message: url is null
at com.huawei.agconnect.credential.obs.ac.a(Unknown Source:46)
at com.huawei.agconnect.common.api.Backend.call(Unknown Source:17)
at com.huawei.agconnect.credential.obs.ad.b(Unknown Source:310)
at com.huawei.agconnect.common.api.BackendService.sendRequest(Unknown Source:0)
at com.huawei.agconnect.remoteconfig.internal.a.c$1.onSuccess(Unknown Source:9)
at com.huawei.agconnect.remoteconfig.internal.a.c$1.onSuccess(Unknown Source:2)
at com.huawei.hmf.tasks.a.h$1.run(Unknown Source:27)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
Couldn't get data from BaseResult, exception: java.util.concurrent.ExecutionException: com.huawei.agconnect.exception.AGCServerException: code: 5 message: url is null
app module gradle deps:
implementation(libs.com.huawei.agconnect.core)
implementation(libs.com.huawei.agconnect.remoteconfig)
implementation(libs.com.huawei.hms.push)
build gradle root:
buildscript {
repositories {
maven { url = uri("https://developer.huawei.com/repo/") }
}
dependencies {
classpath(libs.com.huawei.agconnect.agcp)
}
}
...
settings gradle:
pluginManagement {
includeBuild("build-logic")
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven { url = uri("https://developer.huawei.com/repo/") }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://developer.huawei.com/repo/") }
}
}
...
plugin agconnect was applied at app build gradle file:
apply("com.huawei.agconnect")
agconnect-services.json
file was added to project folder at app module folder
Update
Ok. I have added the following to manifest:
<meta-data
android:name="push_kit_auto_init_enabled"
android:value="true" />
</application>
But now there are the following errors:
HMSSDK_HmsMessageService: start to bind
HMSSDK_HmsMessageService: handle message start...
HMSSDK_HmsMessageService: onNewToken
HMSSDK_HmsMessageService: doOnNewToken:transactionId = null , internalCode = 907135000,subjectId:null,proxyType:null
HMSSDK_HmsMessageService: Apply token failed, subId: null
HMSSDK_HmsMessageService: onTokenError to host app.
HMSSDK_HmsMessageService: onTokenError to host app with bundle.
HMSSDK_HmsMessageService: start to destroy
class MessagingService : HmsMessageService() {
override fun onNewToken(token: String) {
super.onNewToken(token)
logd("onNewToken $token")
}
}
Adding classpath(libs.android.gradlePlugin)
before agconnect plugin in root build.gradle.kts
solved the issue:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath(libs.android.gradlePlugin) // it's needed here for agconnect
// in libs version catalog: android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "gradleVersion" }
classpath(libs.huawei.agconnect.agcp)
}
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.google.dagger.hilt.android) apply false
alias(libs.plugins.androidx.navigation.safeargs) apply false
alias(libs.plugins.google.gms.google.services) apply false
alias(libs.plugins.google.firebase.crashlytics) apply false
alias(libs.plugins.google.devtools.ksp) apply false
}
and the following meta data as I mentioned before in the question:
<meta-data
android:name="push_kit_auto_init_enabled"
android:value="true" />