Featured image of post YouMengji Launched on Google Play

YouMengji Launched on Google Play

After a month of hard work, our dream has become a promotable application.

  • A side note: The article description was auto-generated using https://copilot.github.com/. This tool is indeed very useful, everyone should give it a try. (The gray text in the image shows its auto-generated suggestions, press Tab to accept them)

Preface

  • In China, except for Huawei AppGallery, other app stores don’t allow individual developers to upload applications.
  • Therefore, we decided to publish on Google Play. Initially when developing YouMengji, we didn’t consider internationalization and hardcoded all UI text.
  • After continuous efforts in bug fixing, we implemented full internationalization (including server-side), allowing users to select their preferred language.

Publishing Process

  • Requires a computer that can access https://play.google.com/
  • A $25 USD fee is required for Google Play developer account registration. Consider using Taobao agent services for payment.
  • Apps must be uploaded in aab format: https://developer.android.com/guide/app-bundle/faq?hl=zh-cn
  • The Google Play publishing process is quite user-friendly - just follow the step-by-step instructions.
  • First-time submission review may take longer, approximately 3 days in our case.

Building

  • Building aab format with Flutter is straightforward: run flutter build appbundle
  • Created a script to dynamically pass build channels, e.g.: flutter build appbundle --dart-define=channel=google
  • Due to initial unfamiliarity with aab format packaging causing runtime issues, added the following code to build.gradle:
/// For handling channel parameters, set default values here
def dartEnvironmentVariables = [
        // Avoid using default values here to ensure always getting CLI args
        channel: '_channel',
]
if (project.hasProperty('dart-defines')) {
    dartEnvironmentVariables = dartEnvironmentVariables + project.property('dart-defines')
            .split(',')
            .collectEntries { entry ->
                def pair = new String(entry.decodeBase64(), 'UTF-8').split('=')
                [(pair.first()): pair.last()]
            }
}

android {
    if (dartEnvironmentVariables.channel == "google") {
        // Use the bundle block to control configuration APK types
        bundle {
            language {
                // Disable language resource splits
                enableSplit = false
            }
            density {
                // Disabled by default
                enableSplit = false
            }
            abi {
                // Disabled by default
                enableSplit = false
            }
        }
    }
}

Screenshot