huawei_all 0.0.1
huawei_all: ^0.0.1 copied to clipboard
Wolfiz Huawei Pack
Open build.gradle #
##
Note: Make jks file and add to app and do release app settings
repositories {
google()
mavenCentral()
//Add following line
maven{url 'https://developer.huawei.com/repo/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
//Add following line
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
}
repositories {
google()
mavenCentral()
//Add following line
maven{url 'https://developer.huawei.com/repo/'}
}
Open app level build.gradle file #
apply plugin: 'com.android.application'
//Add following line
apply plugin: 'com.huawei.agconnect'
apply plugin: 'kotlin-android'
//Create proguard-rules.pro file in android/app folder and paste following into it
-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keep class com.hianalytics.android.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
## Flutter wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn io.flutter.embedding.**
-keep class com.huawei.hms.flutter.** { *; }
-repackageclasses
defaultConfig {
applicationId "com.wolfiz.xyz"
minSdkVersion 21
targetSdkVersion 33
//Add following line
multiDexEnabled true
buildTypes {
release {
signingConfig signingConfigs.release
//Add following lines
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
## Initialize HuaweiAll
HuaweiAll.instance.init(
map: true,
mapApiKey: "YOUR_MAP_API_KEY",
);
##User as follow
return Scaffold(
body: HMap.map(),
);
##Location
final value = await HLocation.current
print(value.lat);
print(value.lng);