Knowledge Base
KamlatechToolBlogContact Us
  • Kamlatech Documentation
  • Magento
    • Installation
    • Email Configuration
  • Blogger
    • Adding Code Block
  • Linux
    • Managing Logs
    • Prevent Package Update
  • Node
    • Installation
    • Http-Server
  • Github
    • .gitignore
    • Branch to New Repo
  • HTML
    • Common Header & Footer in HTML
  • Linkedin Infographics
    • Flame Retardant Standards
    • Flame Retardant Terms
  • Music
    • Pandit Niladri Kumar - Sitar
  • Applications
    • Konvect Connect
    • Konvect Fetcher
    • Konvect Fetcher WebApp
  • HTTPS SSL Certificate
    • Lets's Encrypt
  • Oracle Cloud Instance
    • Firewall
    • CPU Stressing
    • CPU Stressing Docker
  • SFTP
    • WinSCP SFTP
  • NextCloud
    • Installation
    • Post Install Tweak
    • PHP Version
  • Wordpress
    • NGINX Configuration
    • Image upload / Crop issue
    • Required PHP Modules
    • PHP Configuration
  • Healthcare Wearables (Cardiac)
    • Wearable ECG
    • Arrhythmia
    • Ambulatory ECG Usecase
    • Understanding EKG Leads
  • Flutter
    • Direct URL Access
    • Change Android PackageName
  • Math
    • Online Equation Writing
  • Backend Web Service
    • Flask App Deployment
  • 3D Modeling
    • DWG in Solid Edge
  • MariaDB
    • MariaDB Commands
  • Excel
    • HTML as String in Excel
  • Tools
    • Online Tools
  • PostgreSQL
    • PostgreSQL Installation
  • MEDUSA
    • Medusa Installation
    • Backend Server/Worker Mode
    • Frontend Deployment
  • Jupyter Lab
    • Jupyter Web App
  • WooCommerce
    • Product Filename Renaming
  • Embedded
    • Flash Xiao Sense Bootloader
Powered by GitBook
On this page
Edit on GitHub
  1. Flutter

Change Android PackageName

To change the package name (also known as the applicationId) of a Flutter project for the Android platform, you need to follow these steps:

  1. Update AndroidManifest.xml:

Open the android/app/src/main/AndroidManifest.xml file. Change the package attribute of the element to your new package name (com.yourdomain.yourname in your case).

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.yourdomain.yourname">

To change the App display name below app icon you need to change the field android:label as shown below

    <application
        android:label="YOUR APP NAME"
        
        <activity
            ...
        </activity>
        
    </application>
  1. Update build.gradle:

Open the android/app/build.gradle file. Change the namespace & applicationId to your new package name.

android {
    namespace "com.yourdomain.yourname"
    ...
    defaultConfig {
        ...
        applicationId "com.yourdomain.yourname"
        ...
    }
}
  1. Rename Package Directory:

Rename the existing com/example/test directory to com/yourdomain/yourname in the android/app/src/main/kotlin/ directory.

  1. Change package name in MainActivity.kt:

Change the package name to com.yourdomain.yourname in MainActivity.kt file located in the android/app/src/main/kotlin/com/yourdomain/yourname directory.

package com.yourdomain.yourname

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
  1. Run flutter clean and Rebuild:

Run flutter clean in the terminal to clear any previous build artifacts. Rebuild your project by running flutter build.

PreviousDirect URL AccessNextOnline Equation Writing

Last updated 1 year ago