how to package wear app - android

I have gotten signed my wear app , as per said by developer site . and also I have imported that into my
raw folder with the name of "wear_release.apk"
I have created xml folder in res in the device app and also I have put the necessary with correct package name these are as follows
<wearableApp package="wearable.app.package.name">
<versionCode>1</versionCode>
<versionName>1.0</versionName>
<rawPathResId>wearable_app</rawPathResId>
</wearableApp>
but when i put meta tag into the manifest file of the handheld device and try to build and sign the mobile app I got error
<meta-data android:name="com.google.android.wearable.beta.app"
android:resource="#xml/wearable_app_desc"/>`
i got error
Error:(52, 13) Execution failed for task
':mobile:processReleaseManifest'.
Manifest merger failed : Attribute meta-data#com.google.android.wearable.beta.app#resource
value=(#xml/wear_release_desc) from AndroidManifest.xml:52:13 is also
present at AndroidManifest.xml:5:20
value=(#xml/android_wear_micro_apk) Suggestion: add
'tools:replace="android:resource"' to element at
AndroidManifest.xml:50:9 to override
can any one tell me what is the reason ?

your apk's name is wear_release.apk, but the name you write in the wearable_app_desc is wearable_app, you must write the same name, wear_release

If you use gradle, and it seems to be the case, you don't need to put your apk into the raw folder, from memory it's only for Eclipse and ADT. When using gadle, just put the line wearApp project(':nameOfYourWearProject') as a child element of dependencies in the file "build.gradle" of your handheld project.

Related

How can I change the app display name build with Flutter?

I have created the app using Flutter create testapp.
Now, I want to change the app name from "testapp" to "My Trips Tracker". How can I do that?
I have tried changing from the AndroidManifest.xml, and it got changed, but is there a way that Flutter provides to do that?
Android
Open AndroidManifest.xml (located at android/app/src/main)
<application
android:label="App Name" ...> // Your app name here
iOS
Open info.plist (located at ios/Runner)
<key>CFBundleDisplayName</key>
<string>App Name</string> // Your app name here
and/or
Don't forget to stop and run the app again.
UPDATE: From the comments this answer seems to be out of date
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
It seems you have already found this 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 android:label in 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.
There is a plugin called flutter_launcher_name.
Write file pubspec.yaml:
dev_dependencies:
flutter_launcher_name: "^0.0.1"
flutter_launcher_name:
name: "yourNewAppLauncherName"
And run:
flutter pub get
flutter pub run flutter_launcher_name:main
You can get the same result as editing AndroidManifest.xml and Info.plist.
You can change it in iOS without opening Xcode by editing the project/ios/Runner/info.plist <key>CFBundleDisplayName</key> to the String that you want as your name.
FWIW - I was getting frustrated with making changes in Xcode and Flutter, so I started committing all changes before opening Xcode, so I could see where the changes show up in the Flutter project.
Review the default app manifest file, AndroidManifest.xml, located in <app dir>/android/app/src/main
Edit the android:label to your desired display name
There are several possibilities:
1- The use of a package:
I suggest you to use flutter_launcher_name because of the command-line tool which simplifies the task of updating your Flutter app's launcher name.
Usage:
Add your Flutter Launcher name configuration to your pubspec.yaml file:
dev_dependencies:
flutter_launcher_name: "^0.0.1"
flutter_launcher_name:
name: "yourNewAppLauncherName"
After setting up the configuration, all that is left to do is run the package.
flutter pub get
flutter pub run flutter_launcher_name:main
If you use this package, you don't need modify file AndroidManifest.xml or Info.plist.
2- Edit AndroidManifest.xml for Android and info.plist for iOS
For Android, edit only android:label value in the application tag in file AndroidManifest.xml located in the folder: android/app/src/main
Code:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Your Application Name" //here
android:icon="#mipmap/ic_launcher">
<activity>
<!-- -->
</activity>
</application>
</manifest>
Screenshot:
For iOS, edit only the value inside the String tag in file Info.plist located in the folder ios/Runner .
Code:
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>Your Application Name </string> //here
</dict>
</plist>
Screenshot:
Do a flutter clean and restart your application if you have a problem.
A few of the answers here suggest using the package flutter_launcher_name, but this package is no longer being maintained and will result in dependency issues within new Flutter 2.0 projects.
The plugin flutter_app_name (https://pub.dev/packages/flutter_app_name) is a nearly identical package that has sound null safety and will work with Flutter 2.0.
Set your dev dependencies and your app's name
dev_dependencies:
flutter_app_name: ^0.1.1
flutter_app_name:
name: "My Cool App"
Run flutter_app_name in your project's directory
flutter pub get
flutter pub run flutter_app_name
Your launcher will now have the name of "My Cool App".
You can change it in iOS without opening Xcode by editing file *project/ios/Runner/info.plist. Set <key>CFBundleDisplayName</key> to the string that you want as your name.
For Android, change the app name from the Android folder, in the AndroidManifest.xml file, android/app/src/main. Let the android label refer to the name you prefer, for example,
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<application
android:label="test"
// The rest of the code
</application>
</manifest>
You can change the Application name, by updating the name for both Android and iOS
for Android
just open AndroidManifest.xml file by,
go to inside android>app>src>main>AndroidManifest.xml
like this:-
so my application name is a "demo" so, I will update the label value.
same as for iOS
just open Info.plist file by,
go to inside ios>Runner>Info.plist
like this:-
And change this string value.
One problem is that in iOS Settings (iOS 12.x) if you change the Display Name, it leaves the app name and icon in iOS Settings as the old version.
For Android, change the app name from the Android folder. In the AndroidManifest.xml file, in folder android/app/src/main, let the android label refer to the name you prefer, for example,
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<application
`android:label="myappname"`
// The rest of the code
</application>
</manifest>
You can easily do this with rename package, It helps you to change your Flutter project's AppName and BundleId for different platforms, currently available for IOS, Android, macOS and Web
To install the package run the following command:
pub global activate rename
To rename the App, use the following command:
pub global run rename --appname "Your App Name"
That's It!
You can check the documentation of the package for full details because it has some nice features to choose the target platform and more.
As of 2019-12-21, you need to change the name [NameOfYourApp] in file pubspec.yaml. Then go to menu Edit → Find → Replace in Path, and replace all occurrences of your previous name.
Also, just for good measure, change the folder names in your android directory, e.g. android/app/src/main/java/com/example/yourappname.
Then in the console, in your app's root directory, run
flutter clean
in case you are releasing for multi-localizations (languages).
for Android:
in your app folder at
[appname]\android\app\src\main\res
add locale folders for example:
values-ar
valuse-en
then inside each folder add a new strings.xml that contains the app name in that language.
for ar
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="app_name">ادارة الديون</string>
</resources>
for en
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="app_name">debt management</string>
</resources>
The last thing you can do is go to your AndroidManifest.xml file
and set the android:label to the new files you have created.
android:label="#string/app_name"
I saw indeed the manual solution (to go to IOS and Android). But I found out a plugin which enables changing name from one single location:
https://pub.dev/packages/flutter_launcher_name
Just do the following:
Add to pubspec.yaml
dev_dependencies:
flutter_launcher_name: "^0.0.1"
flutter_launcher_name:
name: "yourNewAppLauncherName"
Run in Terminal:
flutter pub get
flutter pub run flutter_launcher_name:main
Done.
First
Rename your AndroidManifest.xml file
android:label="Your App Name"
Second
Rename Your Application Name in Pubspec.yaml file
name: Your Application Name
Third
Change Your Application logo
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/path/your Application logo.formate"
Fourth
Run
flutter pub pub run flutter_launcher_icons:main
If you like to automate stuff from command line like me, you can use this
appName="TestApp"
declare -a androidAppTypes=(
"main"
"debug"
"profile"
)
# Change app name for Android
for appType in ${androidAppTypes[#]}
do
xmlstarlet ed -L -u '/manifest/application/#android:label' -v "$appName" android/app/src/$appType/AndroidManifest.xml
done
# Change app name for Android
plutil -replace CFBundleDisplayName -string "$appName" ios/Runner/Info.plist
The way of changing the name for iOS and Android is clearly mentioned in the documentation as follows:
Build and release an Android app
Build and release an iOS app
But, the case of iOS after you change the Display Name from Xcode, you are not able to run the application in the Flutter way, like flutter run.
Because the Flutter run expects the app name as Runner. Even if you change the name in Xcode, it doesn't work.
So, I fixed this as follows:
Move to the location on your Flutter project, ios/Runner.xcodeproj/project.pbxproj, and find and replace all instances of your new name with Runner.
Then everything should work in the flutter run way.
But don't forget to change the name display name on your next release time. Otherwise, the App Store rejects your name.

cordova_plugin_file_chooser not working in same device for two different apps

I am using cordova cli for creating android app.
I have user cordova_plugin_file_chooser
Where it given that below
Note that like a ContentProvider, the DocumentProvider authority must be unique. You should change com.ianhanniballake.localstorage.documents in your Manifest, as well as the LocalStorageProvider.AUTHORITY field.
By above I have update in my AndroidManifest by changing android:authorities="com.crypho.localstorage.documents" to com.12345.localstorate.documents but when I build app using cordova build android it added new instance in manifest file with existing name android:authorities="com.crypho.localstorage.documents"
Can anybody know where should I changed in the code exactly?
UPDATE:
Still not resolved the issue of provider name confict.
I resolved issue by replacing provider authorities by ${applicationID}.Provider in <provider> of that specific plugin in android.json file.
Thanks

How to change the name of the apk file?

I build apk file with help of https://build.phonegap.com/apps/ portal evrey time I build debug or release apk file the names are:
______debug.apk or ______release.apk
I want to change the name of the release apk to something more significant, for example MyProject-v2.apk.
Any idea how can I change the name of the the apk file when it build?
No, sadly you cannot control the file name in the config.xml, but the file name doesn't matter. In the config.xml, you specify the name of your app as it will appear to the users on their mobiles, and that's what matters.
If you like to give the file a specific name for your own file management (which is what I do too), you'll have to manually rename the file every time you create a new build.
The thing you should know is that APK names does not matter in its file name, What matters is what you said in the AndroidManifest.xml in the Application label:
android:label="#string/app_name"
This is the only app name and it can even be different from package name so the apk being called ______debug.apk or ______release.apk doesnt matter it is just to differenciate if it is debug or release. You can just rename it just like any file in your computer even Michael.apk. And still all android phones will ignore the file names and go get the label at android:label="#string/app_name" so just copy the file and change it to anything you want and it works.
You can rename it as a file.
The installed apk name is same as what you defined in manifest.
You can configure naming of you builds in gradle configuration
Add this to your android{} close in your module's build.gradle:
// determine the apk file name when produced
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(
output.outputFile.parent,
output.outputFile.name.replace("app", "YourAppNameHere-V${variant.versionName}"))
}
}
the V is for the version number.
Inside modules build.gradle file, add following line to android { defaultConfig { X } }
setProperty('archivesBaseName', "YourAppName-$versionCode")
In my case I just renamed the file app_release.apk to appname.apk
and it works for me.
Same for app_debug.apk to appname_debug.apk
In project directory:
While Installing
You cannot control the file name in the config.xml. But if you have a self signed certificate and want to rename the apk, you can do it with zipalign:
zipalign.exe -v 4 platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk platforms\android\app\build\outputs\apk\release\YouyAppName-v2.apk

Change Spotify apk name

I'm trying to change the name of the apk of spotify, but show me many dependencies to make this...
First I follow this manual: Change Package Names of APKs
On the first step, I found on
in manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.spotify.music" platformBuildVersionCode="24" platformBuildVersionName="7.0">
I modified by com.spotify.jair
On smali I modified the name of the folder smali/com/spotify/music
to Smali/com/spotify/jair
Search Lcom/spotify/music and replace
with Lcom/spotify/jair inside smali folder
After that, when I tried to install and the error:
Failure [INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.spotify.jair attemptin
g to redeclare permission com.spotify.music.permission.SECURED_BROADCAST already
owned by com.spotify.music]
I modified all the com.spotify.music, inside AndroidManifest.xml to com.spotify.jair and the error is:
Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /
data/app/com.spotify.jair-1: Can't install because provider name com.spotify.mob
ile.android.mediaapi (in package com.spotify.jair) is already used by com.spotif
y.music]
So inside: res\values\ I found <string name="media_provider_authority">com.spotify.mobile.android.mediaapi</string> I modified: <string name="media_provider_authority">com.spotify.mobile.android.mediaapis</string>
And the error is:
6280 KB/s (35226422 bytes in 5.477s) Success
But the app does not open, and close inspected. Can anybody help me on the debug why the app is closing, Is there are a tool to debug why the app is closing?
Thanks!
Also to add this project tree:
Project Tree
I can't comment, the app is crashing, you need to take a logcat to see why
adb logcat > l0g.txt
Open Spotify
Unplug phone
And then upload that to paste bin

new blackberry app world error "bar manifest file package version must be greater than ..."

I've started getting a weird error message when trying to upload a playbook app update to BlackBerry world. I think this problem started after installing version 1.6.1 of their eclipse plugin.
The error message:
"The package version in your .bar manifest file for signals_playbook must be greater than the previous version, but lower than any the next release version added to the vendor portal. . Your .bar manifest file package version must be greater than 3.0. Correct your .bar manifest file and try again to continue."
My AndroidManifest.xml contains:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ca.rcp.mobile.cror.signals"
android:versionCode="7"
android:versionName="3.1" >
The Manifest file contained within the BAR shows this info:
Archive-Manifest-Version: 1.1
Archive-Created-By: Apk2Bar version 1.6.1
Package-Author: xxxxxxxx
Package-Author-Id: some hash xxxxxxxxx
Package-Name: xxxxx.cror.signals
Package-Id: some hash xxxxxxxxx
Package-Version: 1.0.7.1
Package-Version-Id: some hash xxxxxxxx
Package-Type: application
Package-Architecture: armle-v7
Package-Author-Certificate-Hash: some hash xxxxx
Application-Name: Railway Signals
Application-Id: some hash xxxxxxxx
Application-Version: 1.0.7.1
Application-Version-Id: some hash xxxxxxxxxxx
Application-Requires-System: Tablet OS/2.0.0.7109
My system:
Windows 7 x64 using Eclipse 3.7.2 with latest ADT and updates.
I can see why BlackBerry world is complaining, it thinks the version number is 1.0.7.1. How do I get it to show 3.1.0.0??
I tried editing the manifest file contained within the bar, saving it and resubmitting. But that didn't work (didn't think it would but was worth a try).
Does anyone know where is the 1.0.7.1 coming from?
Can I override it?
Thanks
Rob
We suddenly started having the same problem with our builds. Evidently something changed in the BlackBerry build tools. Try setting the application's android:versionName attribute to a 4-part value (such as 3.1.0.1). BlackBerry has always used this format (major.minor.micro.build) for native apps. It seems that unless your Android manifest has the same format, the BlackBerry build tools fail to parse the versionName attribute and use a fall-back. From what I can tell, the fall-back is to use the value of android:versionCode as the micro version in a default application version code; that is it sets the app version in the .bar file manifest to
1.0.<android:versionCode value>.1
(I sure wouldn't want to be the engineer that had to defend implementing this behavior.)
An alternative approach is to create a custom manifest file that has the app version you want. Create a file named MANIFEST.MF in the same directory as AndroidManifest.xml. Then add the specific .bar manifest entries you want. For instance, it might be:
Archive-Manifest-Version: 1.1
Package-Version: 3.1.0.0
Application-Version: 3.1.0.0
Then open the project properties in Eclipse, navigate to BlackBerry, and for the "Custom BAR Manifest" drop-down, select "Add custom values (merge)".
Thank you, Ted!
There is another link on this topic;
http://supportforums.blackberry.com/t5/BlackBerry-World-Development/The-package-version-in-your-bar-manifest-file-for-New-Bundle/td-p/2754567
We started to notice problem after move to Gradle:
Before
AndroidManifest.xml:
android:versionCode="1312310309" android:versionName="2.28.4"
MANIFEST.MF:
Application-Version: 14.1231.309.0
After
AndroidManifest.xml:
android:versionCode="134" android:versionName="2.30.31402271059"
MANIFEST.MF
Application-Version: 1.0.134.0
I also had the same problem but I fixed it by adding this line in my Android Manifest file android:versionCode="30" previously I had android:versionCode="29" so upgraded it by one .And the problem got fixed for me.

Categories

Resources