I have two version of an app that I want to run on the same phone.
I have changed my config.xml widget id and name, I have change package.json and ionic.config.json and I have changed manifest.json all to have a different name for the app, but still I get this error “Package conflicts with an existing package”
Related
Am trying to release my apk and just changed the com.example package name to my own com.[companynamehere].[appname] in the AndroidManifest.xml file and app/build.gradle file, however now my app stops working as soon as I run it.
Any idea what might be the problem? Is there anywhere else I need to change the package name?
I'm also using firebase and I generated a new google-services.json file with the new package name.
Update your package name in android>src>main>kotlin>Mainactivity.kt
Hope it will work. If it doesn't work then another solution is to search your old package name on the entire project and replace them with the new package name. In this case, VSCode will help you to do this just with a few clicks.
Inside the Flutter project directory, I created a package with the following command :
flutter create --template=package emoji_support
After it completes creating the package and completes flutter get.
But..
Files inisde package's /test directory can't find files inside package's /lib directory :
import 'package:flutter_test/flutter_test.dart'; is resolved ✅
But...
import 'package:emoji_support/emoji_support.dart'; is not resolved ❌
File structure
What error am I making here?
I created a package inside my project flutter_example_file_picker with flutter create --template=package emoji_support
Then in the pubspec.yaml of the project (not the one inside the plugin) flutter_example_file_picker > pubspec.yaml I added to the dependenceis the package
dependencies:
flutter:
sdk: flutter
emoji_support:
path: ./emoji_support
and the problem resolved, I could run the test with no problem, also tried with a relative path without adding it to the dependencies and worked too
UPDATE
I think I undestand how to fix it without adding it to the pubspec, when creating a plugin inside a project, the flutter plugin of AndroidStudio (or VS) is still working in the main route (check the terminal dir and it will be C:/.../Workspace_Android\hundreddaysofflutter> so it doesnt detect the inner plugin) and doesn't update to detect the new folder. Even if it's red and says it cannot detect the URI.
You can ignore it and try to run the test and see if it detects the inner dart_tool with package_config.json, then it will run succesfully and the problem will dissapear. The second option is to move to the folder where the plugin is (in the terminal cd my_plugin_name_folder or just file open and open the plugin).
Run flutter get pub (it does it automatically when creting the first time a project but sometimes when you create one inside another it doesnt do it) to run for the first time the package and create the package_config.json inside dart_tool (the dart_tool of the plugin), at the end of the file you can see the name and rootUri of the package, now you can use it in your test nad it should detect it correctly. Sometimes it's generated but it seems it doesn't update correctly and the IDE doesn't know even if it's there.
This is just a problem that occurs , when you are adding new sub_directories in vsCode.
just a simple exist and re-open will fix the issue.
tell me if that fix it.
I have created a new flutter project in AS and for some reason the name in pubspec.yaml for my app is just app even when I named it something else when I created new app
name: app
description: My new application.
When I rename it to whatever I need then all my imports error out in my project.
Example:
import 'package:app/main.dart';
So how do you change the name in pubspec.yaml without crashing all imports
UPDATE
After renaming name, AS doesn't show package option with the new name
For example, if the default app name is
name: defaultappname
description: My new application.
and you want to change it to
name: app
description: My new application.
then you have to just do the search and replace operation:
That's because you need to change the imported packages which now has a different source. The usual form for importing packages is like this:
import 'package:ApplicationNameDefinedInPubspec/FolderInLib/SubFolder/DartFileName.dart';.
so for example in your case it should be something like this:
import 'package:NewAppName/main.dart';.
And also to change the app name showing on the devices, the Flutter documentation points out where you can change the display name of your application for both Android and IOS. This may be what you are looking for:
Preparing an Android App for Release
Preparing an iOS App for Release
For Android
In the AndroidManifest.xml as the application entry.
Review the default App Manifest file AndroidManifest.xml located in
/android/app/src/main/ and verify the values are correct,
especially:
application: Edit the application tag to reflect the final name of the
app.
For iOS
See the Review Xcode project settings section:
Navigate to your target’s settings in Xcode:
In Xcode, open Runner.xcworkspace in your app’s ios folder.
To view your app’s settings, select the Runner project in the Xcode project
navigator. Then, in the main view sidebar, select the Runner target.
Select the General tab. Next, you’ll verify the most important
settings:
Display Name: the name of the app to be displayed on the home screen
and elsewhere.
We have an application that has same code but different apks for different countries.
As of now I am Changing id in config.xml then removing and adding android platform to generate a build.
I want to make such automated system like i can make multiple apks from the existing parent code with different package names and version codes.I want to make such a script that when i run it on command line i will be able to build a new apk from the parent code just by package name.
will be default package name.
1) com.proj.stg.ApplicationName
2) com.proj.ws.stg.ApplicationName.
What approach should I use to change package name dynamically?
I have a Flutter app and a package folder loaded in VS code at the same time within a workspace. What entry do I need to make to my app's pubspec.yaml file to ensure that changes I've made to the package are compiled and included whenever I hot reload or restart the app? What would be an alternate strategy if this is not possible?
If your pubspec.yaml refers to your package with a path then I would expect this to happen automatically. If not, I would consider it a bug. Please file an issue at https://github.com/Dart-Code/Dart-Code and include a log file generated by running the Dart: Capture Logs command and as much info about your project layout as possible (a clonable repo to repro would be perfect).