BlackBerry - change the application name for an existing project - blackberry

I have a BlackBerry project named "A". This means the build produces artifacts named A.alx, A.cod and all that.
Now I want to change the application name to "B". I tried changing the output file name to "B" and built the project. I get the output B.COD, B.alx etc. But when I try to install B.alx onto the BlackBerry device with the Desktop manager, it does not install, saying "this is not compatible application". This happens even though I can install A.alx successfully.
I made sure I am using 4.7 JDE to install on 4.7 device. I know I am doing something wrong when renaming the application in the project files. What is the problem?

You can't use a dash or space character in an application output filename. Make sure your "B" name does not include one.
edit
If you want to use those characters, edit the application title in the app descriptor. That is what the user sees when your app is installed.

I have encountered the same problem. I think you need to rename your whole project to B so that its output would be B.cod.

Here's some steps for changing project settings within the JDE:
Right click on the project and choose "Properties". A properties dialog will open.
In the "General" tab, you can edit the title of the project (This is what will be displayed on the ribbon), the version and some other stuff.
In the "Build" tab you can change the name of the output files.
Hope this helps.

Related

How to change the "Bundle Identifier" within React Native?

Starting a new react-native project, the xcode-project gots the bundle-identifier "org.reactjs.native.example.XYZApp". XYZ is the placeholder here for my real project name.
Is there any way to change this bundle identifier on react-native side? Sure, I can change it in XCode. But this is not safe because it can be overriden when react-native will recreate the xcode-project, which could happen at any time, as well es when rebuilding the project.
Based on the react-native version you are using there are bunch of files that have to be changed on both platforms (android and ios)
List of files to edit:
IOS
[application_build_scheem].plist (this is a dict/xml file that contains keys that are used by default if no changes added to project (react-native-cli init type of project)
ANDROID
strings.xml (change app_name key value)
manifest.xml (change package attribute)
build.gradle (change applicationId value)
MainActivity.java (change java class package)
MainApplication.java (change java class package)
It's worth mentioning that there is an an npm module (https://www.npmjs.com/package/react-native-ci-tools) that does all of the above; use it and make life easy.
Update (6/Mar/2019)
Update Folder Paths:
We also need to change the folder paths to match new name -- change com.oldName to com.newname.mobile, then change folder paths from app/src/java/com/oldName/ to app/src/java/com/newname/mobile/.
For those who want a simple way to do exactly this I create react-native-app-id, It'll basically edit the files mentioned. react-native-ci-tools actually forked my code to produce a now outdated react-native-app-id-fixed , which won't work with the latest react native. Mine however will..
https://github.com/kyle-ssg/react-native-app-id
usage is as easy as react-native-app-id com.foo.bar
Edit : Deprecated in favour of https://github.com/junedomingo/react-native-rename
To update iOS bundle id -
From terminal or command prompt navigate to react-native project folder and then go inside iOS folder.
enter command Open ProjectName.xcodeproj
This command will open the project in Xcode where you need to update bundle identifier information of the app
To update android package name follow below steps -
Update folder structure inside “android/app/src/main/java/” folder
based on your new package name e.g "com/companyName/appName"
Update package name inside MainActivity.java file
Update package name inside MainApplication.java file
Update package name inside /android/app/src/main/AndroidManifest.xml
file
Update package name inside /android/app/BUCK file
Update package name inside /android/app/build.gradle file
Here's my solution without adding some external packages.
Just run npx react-native-rename <newName> -b <bundleIdentifier> inside your project root directory.
https://github.com/junedomingo/react-native-rename
Edit the PRODUCT_BUNDLE_IDENTIFIER associated with the project in ios/project.pbxproj. It is much safer to use XCode.
I know that the question asked to do it without XCode, for people keen on using Xcode, when inside your react native project:
xed ios Open the ios folder in xcode
Click the top left icon (project navigator)
Click the root item in the left panel ProjectName
In the center view, click General
Under identity, change the Bundle identifier
I have a more lowkey solution that I have been using. This is not a replacement for the above solutions, but simply, one more way to do it. I have only tested this on iOS but I assume it would work for Android as well.
I noticed that in most cases, the project created would have a com.xyz.something which is something like this.
org.reactjs.native.example.abcyourprojectname-extras
I realised, instead of checking each and every folder (and not having to use Xcode), I simply do a search for (in Visual Studio Code, with the project folder open)
org.reactjs.native.example
This would list all the files with the bundle identifier. Just change it your preferred bundle identifier, and thats about it. This way, even if tomorrow, there are any file changes or format changes or whatever, searching will still be consistent way of doing things.
(again, this is a low key solution, but it seems to work for me)
If you want to change bundle identifier in react-native project. You must have to change app identifier separately for both side android and ios.
ios
Select root project in xcode, select General tab, You can see Bundle
identifier into identity section and change your new bundle identifier
for ios application
android
Goto your AndroidManifest.xml.
Just place your cursor in the package name, don't select it just place it.
Then press shift+F6(window)/F6 (mac) you will get a popup window, fill new identifier and select Rename package. It will change
from everywhere in android studio.
Even with react-native-app-id you must move the files to the new folder
I ended using a npm task for upgrading, first upgrade then run the command for rename, move the android files to the correct path and re-link just in case
Unfortunately not. In fact we were just discussing this today in the react Native Facebook group.
https://m.facebook.com/groups/586400221495560?view=permalink&id=738954276240153&comment_id=739065029562411&notif_t=group_comment_reply&ref=m_notif
The best plan right now is to choose the 'd' option when upgrading to verify the files before allowing then to be overridden.

Is there any better way to rename an XCode project than the given one?

The given version is described here: How do I rename a project in Xcode 5?
But, as you can see from the following screenshot^, not everything gets renamed, and if one opens package contents, directory names etc. to try to manually change all the references, the project is broken afterwards, so you have to keep the old project name for sub directories etc., which granted is not a massive problem, but is intensely irritating, and I'm not enjoying being intensely irritated at work.
^ apologies for a screenshot, but there's too much information in it to transcribe to written text. Top two-thirds of screenshot is XCode project, bottom third a Finder window.
Renaming projects in xcode in one of the most annoying things in iOS development. I assume you want to rename your app. I faced this problem once and figured out a simple, clean way to do it.
Go back to the point where everything worked.
Open project in xcode and click on the project icon in the project structure( first file)
Go to the info tab
Search for Bundle Name. Most probably it will automatically be set to $(PRODUCT_NAME) which is a shell variable that will set your app name the same as the project name.
Set it to whatever you want your app name to be
Done
Notes :
If you use custom URL Schemes this might produce an error when redirecting.
ALWAYS git or some other SVN in your projects. This will come in handy in this kind of situations

Getting error after changing project folder name in XCode

When I created my project, I called it "Project1". Then, later I've changed it to "Project2" from the Xcode. I changed all "Project1" to "Project2", but now, when I compile my project, it looks for files in Project2/Project1/myFile.swift and I get the next error:
<unknown>:0: error: no such file or directory: '/Users/myusername/Copy/Projects/Project2/Project1/myFile.swift'
I need to make that it will look at
/Users/myusername/Copy/Projects/Project2/myFile.swift
without Project1 in the path.
How can I solve this problem? Also, I changed from Xcode Identity and Type section Location of my project.
Today I had the same problem when I renamed the folder containing the Xcode project and some parent folders of it.
In my case there where a .swift file shown with it's name in red in the list of files of Xcode (Navigator area). I think that this means that Xcode was not capable to find that file.
I selected that file (actually it's not a real file but a representation of it).
Then, in the File Inspector (Utility area), I clicked on the Folder icon and chose the file on Finder.
This worked for me.
Renaming projects in xcode in one of the most annoying things in iOS development. I assume you want to rename your app. I faced this problem once and figured out a simple, clean way to do it.
Go back to the point where everything worked.
Open project in xcode and click on the project icon in the project structure( first file)
Go to the info tab
Search for Bundle Name. Most probably it will automatically be set to $(PRODUCT_NAME) which is a shell variable that will set your app name the same as the project name.
Set it to whatever you want your app name to be
Done
Note : If you use custom URL Schemes this might produce an error when redirecting.
ALWAYS use git or some other SVN in your projects. This will come in handy in this kind of situations
Change you folder name in you finder "Project1" to "Project2"
Remove "myFile.swift" file from project (copy on Desktop)
Restart Xcode. Copy "myFile.swift" in project select "Copy file to folder" hope this will help.

Xcode looking in the wrong place for product

Okay, here's a little bit of context:
I have just added a Mac OS Core Data Command Line Tool target to my iOS project. It's purpose is to simply use my iOS app's Core Data model and a JSON file (which I am adding default data to as I go) to create an SQLite database which I am going to use as the default database for my iOS app. The idea is to have this command line tool ready in my project so that when I add some default data to my JSON file, I just:
Run the command line tool
Go to products in the file navigator on the left
Control click the command line tool product and hit show in finder
Drag the .sqlite database that has been displayed along with all the other bundled files for my command line tool and drop it into my iOS app's resources
But, I can't do this because the command line tool product is showing red in the navigator window because Xcode is looking for it at this path:
/Users/kylejm/Library/Developer/Xcode/DerivedData/MyiOSApp-ggjlxrqiijmbqkgkucdargamkwld/Build/Products/Debug-iphoneos/
Where as the it is actually in:
/Users/kylejm/Library/Developer/Xcode/DerivedData/MyiOSApp-ggjlxrqiijmbqkgkucdargamkwld/Build/Products/Debug/
I have been inspecting the Build Locations in the Build Settings but all the resolved paths are correct for both my iOS app and the command line tool respectively.
What do I need to do to make Xcode look in the right place?
Thanks so much for any help in advance.
I just clarified my scenario/problem for the answer by bauerMusic like so:
Thanks for your answer but I don't think you quite understand my scenario or problem. The Command Line Tool (CLT) target is a part of my project, and therefore has a executable product in the product folder (shown in red until first build and run). When I run this command line tool, it's product in the products folder remains red because Xcode is looking for the product in the wrong place for it.
I've put it in the description so you all understand my question as clearly as possible.
You usually never add files to a project outside of Xcode, (meaning, simply place it in the folder) unless you want to have these sort of issues.
Try to remove it, restart the project (build and see that it has no broken links warnings), and drag the file to the navigator's folder in your open Xcode project.
Edit: Just to be clear, add through Xcode, not the Finder. Xcode should prompt you to either copy resource or not (check box).
I was going to suggest you Clean the project, but I then noticed how you actually added the file.

After changing project name, cannot find version setting

Using XCode 4 for iOS. I changed the project name of my program to something more user friendly and readable. I can no longer find the version setting.
Is there another setting I need to change to view and edit version/build?
Thanks...Rick
I have tried in XCode and rename the project.
The Xcode will automatically ask you to rename the target etc.
Afterward, I could still find the version and build in Target summary and info.
I rename the project name in the following way :
1. Select Project (the top row with blue icon)
2. Press Enter
3. Rename
4. And continue with xCode suggestion for renaming other related files
I hope this help

Resources