setting gradle HMs Kit Success in bumble bee
pada kotak warna hijau atau settings.gradle codenya seperti berikut :
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven {url 'https://developer.huawei.com/repo/'}
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {url 'https://developer.huawei.com/repo/'}
}
}
rootProject.name = "AccountKitDemo"
include ':app'
selanjutnya pada Kotak warna Orange atau buildgradle project code sebagai berikut :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven {url 'https://developer.huawei.com/repo/'}
}
dependencies {
// Add the AppGallery Connect plugin configuration. You are advised to use the latest plugin version.
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
}
}
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
selanjutnya pada build gradle yang warna ungu atau build.gradle pada app codenya sebagai berikut :
plugins {
id 'com.android.application'
id 'com.huawei.agconnect'
}
android {
compileSdk 31
defaultConfig {
applicationId "demo.accountkit.agus"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs{
release{
storeFile file('accountkit.jks')
keyAlias 'key'
keyPassword '123456'
storePassword '123456'
v1SigningEnabled true
v2SigningEnabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.huawei.hms:hwid:6.4.0.300'
}
jangan lupa letakan code signingConfigs jks di atas buildtypes
dan kemudian letakkan file jks di folder app sejajar dengan src, untuk konfigurasi berikutnya sama seperti konfigurasi biasanaya
terimakasih semoga bermanfaat