You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Huawei, the settings.gradle looks like below. Notice the useModule("com.huawei.agconnect:agcp:1.9.1.303")
pluginManagement {
def flutterSdkPath = {
def properties =newProperties()
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
}
settings.ext.flutterSdkPath = flutterSdkPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
gradlePluginPortal()
}
resolutionStrategy {
eachPlugin {
if (requested.id.id =="com.huawei.agconnect") {
//https://flutter.dev/go/flutter-gradle-plugin-apply//https://forums.developer.huawei.com/forumPortal/en/topic/0201148914110187023//https://stackoverflow.com/questions/78339717/huawei-agcp-plugin-cannot-be-applied
useModule("com.huawei.agconnect:agcp:1.9.1.303")
}
}
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.1" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
id "com.google.firebase.crashlytics" version "2.9.9" apply false
id 'com.google.firebase.firebase-perf' version '1.4.2' apply false
id "com.huawei.agconnect" version "1.9.1.303" apply false
}
include ":app"
App\build.gradle looks like
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services"
id "com.google.firebase.crashlytics"
id "com.huawei.agconnect"
}
def localProperties =newProperties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader->
localProperties.load(reader)
}
}
...
An exception occurred applying plugin request [id: 'com.huawei.agconnect', artifact: 'com.huawei.agconnect:agcp:1.9.1.303']
> Failed to apply plugin 'com.huawei.agconnect'.
> com.android.tools.build:gradle is no set in the build.gradle file
Gradle has deprecated the
apply plugin
method.The transitions is done here: Deprecated imperative apply of Flutter's Gradle plugins https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply
For Huawei, the settings.gradle looks like below. Notice the
useModule("com.huawei.agconnect:agcp:1.9.1.303")
App\build.gradle looks like
It would be great if Huawei would document this.
Related #341
The text was updated successfully, but these errors were encountered: