I build an app using flutter. For example name is ForSaudi. I wanted to copy the same app and which name should be ForJordon.
So ForSaudi is already installed in my mobile. Everything is good. Now I changed the name to ForJordon from AndroidManifest.xml file. After changing name and launcher icon, I installed the app into mobile, which is actually replaced with my previous app. It should not be replaced. Can someone guide me how can I do that? I would really appreciate.
Only changing name doesn't create new package. You also need to make changes in build.gradle and in your MainActivity.kt.
If you want a simple solution. Directly use this package
and run this command
flutter pub run change_app_package_name:main com.new.package.name
Related
I need help with flutter and firebase package name
I’m trying to add 3 android apps that are using the same backend server to firebase, I have managed to add 1 app and when I try to add the second one I’m getting this notification “ you already have an app with that package name” that is in firebase.
how do i go about it?
with the solutions I have found, I have to rename the 2nd and 3rd package name, but I don't seem to understand why I should that or the concept behind it.
You need to use a different package name "com...XXX" in every project it's like your app's unique id.
you can change app name by following this steps
Step 1
Go to file android/app/buil.gradle in your flutter project
android{
//make sure every project has different application ID
defaultConfig {
applicationId "com.example.xyz" //change here
}
}
Step 2:
run commands
flutter clean
flutter pub get
flutter run
Step 3
Remove your old project from firebase and reconnect your new name project
I'm new to programming so please be genetle. I'm handy with computers though and I've been sitting on this problem for a few weeks while learning flutter and dart
When I create a new flutter application in android studio, it does not create a main.dart file - the libs foder is empty, and I also see no IOS folder. In fact, what I see looks VERY different from any tutorials I've seen !!
What I do see is a bunh of .xml files, including one called activity main which runs a main activity function which almost seems like it is there instead of the main.dart file I'm looking for.
I have run flutter doctor, apparently everything is good.I have the dart and futter plugins installed. It is not a case of selecting "project" from the drop down menu instead of "Android" which is a common answer online. Not sure what I'm missing !!
Any help would be really really appreciated as I'm learning to code to open my next business and I am struggling to get over the first hurdle.... at leasr I am proficient wit dartpad now though :P
EDIT:
When I click on 'file > new > new flutter project', I don't see an option for "flutter application". This is what I see...
enter image description here
If I create a flutter project at this point, this is what Android Studio looks like for me...
enter image description here
If you have properly created a Flutter project in Android studio, main.dart file should be very easy to locate. It is located in project_name -> lib -> main.dart, as follows:
I am sharing steps to create flutter project in android studio :
Step 1: Open the IDE and select Start a new Flutter project.
Step 2: Select the Flutter Application as the project type. Then click Next.
Step 3: Verify the Flutter SDK path specifies the SDK’s location (select Install SDK… if the text field is blank).
Step 4: Enter a project name (for example, myapp). Then click Next.
Step 5: Click Finish.
Step 6: Wait for Android Studio to install the SDK and create the project.
Note: When creating a new Flutter app, some Flutter IDE plugins ask for a company domain name in reverse order, something like com.example. The company domain name and project name are used together as the package name for Android (the Bundle ID for iOS) when the app is released. If you think that the app might be released, it’s better to specify the package name now. The package name can’t be changed once the app is released, so make the name unique.
The above steps create a Flutter project directory called flutter_app that contains a simple demo app that uses Material Components.
Running the application:
Follow the below steps to run the flutter application that was structured above:
Step 1: Locate the main Android Studio toolbar:
Step 2: In the target selector, select an Android device for running the app. If none are listed as available, select Tools> Android > AVD Manager and create one there. For details, see Managing AVDs.
Step 3: Click the run icon in the toolbar, or invoke the menu item Run > Run.
After the app build completes, you’ll see the starter app on your device.
as per screen shot shared by you click on flutter , hopefully this will create a new flutter project.
I have changed the package name and name of my application. After changing it, the build apk_file was not installing in device. Can any one have solution for this.
Note: I am using VS-Code.
PFA
I have added --no-shrink in command of building apk.
flutter build apk --no-shrink
Hope it will work.
Thank you.
That could be because of the debug and profile manifest files as well as the kotlin file, the package name needs to be changed there too.
Background
I just developed my first flutter desktop app for a windows machine. The app is working fine while developing/debugging it, but I am trying to test it as an application in release mode.
What’s done
I created an msix using pub msix.
For signing, I have tried both my
own certificate and the test certificate that comes with msix
packages by default.
I have tried both stable and beta channels.
Actual Problem
When I install the app on the other system (or even on the actual system where I debugged the app). I can install the msix setup successfully I can see my app listed in the apps, but when I try to open it, it is stuck on a blank/white screen. There is no UI rendered. And if I try to maximize the window, it goes to App not responding state.
Any help will be really appreciated.
Thanks in advance.
Update / New Finding
After going through the links provided by Yehuda Kremer and pulling my hair for a few days, I found the answer in this tweet
https://twitter.com/FilledStacks/status/1436280577439715338?s=20
So the main issue is that app is using some absolute paths that don't work on other machines (after release)
1- My app was using a database, so I have made sure that that database path is relative to the application document directory.
2- Now the build is also referring to some dependencies and their paths are also absolute. I have noticed a flag CMAKE_INSTALL_LOCAL_ONLY in the cmake_install.cmake but that flag is not being set anywhere.
Here is the log of flutter build windows -v
https://pastebin.com/LAeshUMY
-- Now I am looking for a proper way to convert all the paths to relative so that the build is ready for installation on different machines, instead of local installation only.
I have found the solution.
The main problem was that the app was looking for some dependencies and it was unable to find them. As mentioned here.
The reason for not finding that in release mode can be one of the following,
You are using some dll (package that depends on a dll) that is available on a specific path in your system, but when you are release the app that (absolute) path is not valid anymore.
You are adding some asset with absolute path (that is only applicable to your system).
Solution:
If it is a dll, you should be adding that to the release folder. In my case it was sqlite3.dll
If it is some other asset then you should always use the relative path.
You mentioned msix package, let see if the problem is in the app or in the packaging process
run flutter build windows without the flutter pub run msix:create, then run the created .exe file to see if its work.
btw this issue mention here: https://github.com/flutter/flutter/issues/74507
and here (the 'maximizing' problem): Black screen appears on maximizing and minimizing flutter desktop app
flutter application is not created even after the android and flutter plugin installation setup.
I have followed the following steps as given in the link
Flutter Installatioon steps
I dont know where I went wrong,. which installation steps I have missed.
My system is windows 32 bit.
I am encllosing the required screen shotsError screenshot
my system configuration
User Variable. path
Pleasee help me by fixing this issue
Try using Git instead of command line (cmd) and fix the path for flutter you should get the correct address for that for example: C:\flutter\bin