I was trying to use Huawei SDK in flutter so I apply the plugin in the android/app/build.gradle file as shown in the instruction in https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/integrate-plugin-0000001050418527
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
**apply plugin: 'com.huawei.agconnect'**
However, it return with an error :
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app_settings:compileDebugAidl'.
> Failed to find Platform SDK with path: platforms;android-R
I've seen some solution which stated need to add the following code in android/build.gradle file
subprojects {
project.evaluationDependsOn(':app')
}
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
afterEvaluate {project ->
if (project.hasProperty("android") && project.property("android").compileSdkVersion.equals("android-R")) {
android {
compileSdkVersion 30
}
}
}
}
I've added it but it still return the same error. When I removed the apply plugin: 'com.huawei.agconnect', the error did not appeared. But in this case I would like to use the plugin because I am planning to use Huawei push kit.
Kindly tell me if any additional information needed to look through this problem. Thank you.