Coder Social home page Coder Social logo

Comments (1)

serdar-can avatar serdar-can commented on May 26, 2024

Hi @joeccleung , thank you for reporting the issue.

minifyEnabled true flag enables code shrinking, obfuscation, and optimization for your project's release build type. While obfuscating the project, HMS Core, and HMS Map is also obfuscated and it should be prevented in order to work without issues.

Before building the APK, configure the obfuscation configuration file to prevent the HMS SDKs from being obfuscated. Please add following attributes to your proguard-rules.pro file and then you may use minifyEnabled true flag.

-ignorewarnings 
-keepattributes *Annotation* 
-keepattributes Exceptions 
-keepattributes InnerClasses 
-keepattributes Signature 
-keep class com.hianalytics.android.**{*;} 
-keep class com.huawei.updatesdk.**{*;} 
-keep class com.huawei.hms.**{*;}

After adding proguard-rules.pro file, change your app level build.gradle file described below.

buildTypes {
   release {
      // enables code shrinking, obfuscation, and optimization.
      minifyEnabled true 

      // enables resource shrinking.
      shrinkResources true 

      // the file you added
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
   }
}

For detailed information you may refer to Configuring Obfuscation Scripts

from hms-flutter-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.