在华为AppGallery Connect控制台创建应用。开发者可以先创建一个项目,然后在项目中添加应用。创建应用的过程中开发者需要填写对应应用的名称、包名、分类、语言等信息,创建完成后开发者可以获得应用的基本配置信息。






开发者通过Android Studio创建一个Flutter项目,创建应用的包名与AppGallery Connect上填写的应用的包名保持一致。
打开 Android Studio 工具,在Android Studio菜单栏,选择File->New->New Flutter Project创建一个Flutter项目。




buildscript {
repositories {
google()
jcenter()
// Check that you have the following line (if not, add it)
maven { url 'https://developer.huawei.com/repo/' } // HUAWEI Maven repository
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
// Add the following line
classpath 'com.huawei.agconnect:agcp:1.5.0.300' // HUAWEI agcp plugin
}
}
allprojects {
repositories {
google()
jcenter()
// Check that you have the following line (if not, add it):
maven { url 'https://developer.huawei.com/repo/' } // HUAWEI Maven repository
}
}
在apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"下一行添加如下配置:
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
// Check that you have the following line (if not, add it)
apply plugin: 'com.huawei.agconnect'