Однако, даже несмотря на то, что я поместил файл agconnect-services.json в проект, сборка Gradle по-прежнему показывает следующее сообщение:
Код: Выделить всё
! agconnect-services.json not found, compiling without HMS Код: Выделить всё
android/
app/
build.gradle
google-services.json
agconnect-services.json
src/
main/
AndroidManifest.xml
agconnect-services.json (I also copied it here)
Код: Выделить всё
android/app/build.gradle:
plugins {
id 'com.android.application'
id 'com.huawei.agconnect'
id 'com.google.gms.google-services'
}
android {
compileSdk 36
defaultConfig {
applicationId "com.example.myapp"
minSdk 24
targetSdk 36
versionCode 1
versionName "1.0"
}
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:33.5.1')
implementation 'com.google.firebase:firebase-messaging'
}
android/settings.gradle:
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/
' }
}
}
- Скопировал agconnect-services.json как в app/, так и в app/src/main/
- Проверил, что содержимое JSON допустимо и имеет правильное имя пакета
- Добавлен репозиторий Huawei Maven в settings.gradle и root build.gradle.
- Очистил и пересобрал проект с помощью:
Код: Выделить всё
flutter clean
./gradlew --stop
flutter pub get
flutter build apk
- Использование версии плагина: путь к классам 'com.huawei.agconnect:agcp:1.9.1.301'
- Диагностические распечатки подтверждают существование файла:
Код: Выделить всё
AGC variant check \[debug\] -\> true @ .../android/app/src/main/agconnect-services.json
AGC variant check \[release\] -\> true @ .../android/app/src/main/agconnect-services.json
! agconnect-services.json не найден, компилируется без HMS
Вопрос:
Что все еще может вызывать это сообщение, даже если файл существует как в app/, так и в app/src/main/ и плагин применен?
Существует ли несоответствие версии Gradle или плагина AGConnect или определенного каталога, который теперь ожидает плагин?
Будем признательны за любой рабочий пример конфигурации или объяснение.
Подробнее здесь: https://stackoverflow.com/questions/797 ... -hms-issue
Мобильная версия