Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update organization in already created flutter project

Tags:

flutter

Say I've created a project like flutter create --org com.myproject project.

Is there a command to run to change the organization in the already created project in all the areas it is specified?

Thus perhaps a command with a different org changes all the org name in their respective places when called within the project.

flutter update --org com.yourproject

like image 564
KhoPhi Avatar asked Jul 05 '18 09:07

KhoPhi


People also ask

How do you change your organization name in Flutter?

If you have already created a project you can use change_app_package_name package to change the package name. 'flutter create --org com. yourcompany --project-name new_app_name . ' (add the period if you are inside the existing project -- you should trash the android and ios folders first to have them regenerated).


1 Answers

I don't think there is a way to do this. Instead you can do this manually by editing the following:-

android/app/build.gradle

In android { defaultConfig {} } the property named applicationId

All your AndroidManifest.xml files

Update package property in all your AndroidManifest.xml files, i.e. /android/app/src/main, /android/app/src/debug, /android/app/src/profile.

Change directory name

If you see /android/app/src/main/[kotlin or java], you will find nested directories com then example and then [appName] by default. It resembles the application ID so change the directory names.

Modify /android/app/src/main/[java or kotlin]/[by default com/example/[applicationName]]/[MainActivity.kt || MainActivity.java]

In this file at the first some lines you will find your applicationID. Change it.

Then run flutter clean && flutter run.

like image 115
Shardul Nalegave Avatar answered Sep 28 '22 07:09

Shardul Nalegave