《Flutter:如何在Gradle 8.9版本中安装com.huawei.agconnect?》

问题描述 投票:0回答:1

在文件 android/app/build.gradle 中

plugins {
    ...
    id "com.huawei.agconnect"
}
...
dependencies {
    coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.2"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.6"
    implementation platform('com.google.firebase:firebase-bom:33.4.0')
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.facebook.android:facebook-android-sdk:6.5.0'
    implementation 'com.huawei.hms:push:6.12.0.300'
}

例外是: org.gradle.api.plugins.UnknownPluginException:在以下任何来源中均未找到插件 [id:'com.huawei.agconnect',版本:'1.6.0.300']:

我的setting.gradle代码

pluginManagement {
    def flutterSdkPath = {
        def properties = new Properties()
        file("local.properties").withInputStream { properties.load(it) }
        def flutterSdkPath = properties.getProperty("flutter.sdk")
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
        return flutterSdkPath
    }()

    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        maven { url 'https://developer.huawei.com/repo/' }
    }
}

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version '8.7.1' apply false
    id "org.jetbrains.kotlin.android" version "2.0.20" apply false
    id "com.google.gms.google-services" version "4.4.2" apply false
    id "com.google.firebase.crashlytics" version "3.0.2" apply false
    id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}

include ":app"

flutter build.gradle gradle-plugin huawei-mobile-services huawei-developers
1个回答
0
投票

有人找到解决这个问题的方法了吗?我也被困在这里了:(

© www.soinside.com 2019 - 2024. All rights reserved.