Issue
I am trying to port my app from GMS to (G+H) using HMS Toolkit.
After using the Toolkit Convertor, the following line throws an unresolved reference error on import org.xms.f.auth.ExtensionAuth
asking to define xms. This obviously means the xmsadapter files (which are generated by the HMS Toolkit Convertor) have not been imported.
How can I fix this error to import the .xms files on import org.xms.f.auth.ExtensionAuth
I feel like there's a dependancy that I'm missing?
Solution
You can also check your configured obfuscation scripts first.
XMS code generated using the Add HMS API policy will increase the size of your app. You can enable the code reduction function by adding or modifying the following configurations in the app/build.gradle file:
android {
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
If an error message such as "Can't find...", "NoClassDefFoundError", "ClassNotFoundException", "NoSuchFieldException", or "NoSuchMethodException" is displayed after minifyEnabled is set to true, configure the following XMS obfuscation rules in app/proguard-rules.pro:
-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
-keep class com.hianalytics.android.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
-keep class com.huawei.agconnect.**{*;}
-keep interface com.huawei.agconnect.**{*;}
-keep class com.huawei.hmf.**{*;}
-keep class com.google.android.gms.**{*;}
-keep interface com.google.android.gms.**{*;}
-keep class com.google.firebase.**{*;}
-keep interface com.google.firebase.**{*;}
-keep class org.xms.**{*;}
-keep interface org.xms.**{*;}
For details,you can refer to this Docs.
Answered By - shirley
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.