In the past, there has been a known issue with Fastlane which is used to run iOS builds unattended in Appflow. This issue prevented the use of unicode characters in the <name> node of config.xml. Here are examples of a few closed issues in the Fastlane repo that referenced this topic.
Here's a breakdown of the root cause of the problem:
- Fastlane can't manage xcode scheme names that include unicode characters. The workaround proposed by Fastlane requires renaming the scheme using xcode which is not possible during an Ionic Appflow package build.
- Fastlane can recover if there's only one scheme present in the xcode project. If there's only one scheme it will be used by default. The error
Couldn't find specified scheme
will still be present in the build log, but the build will progress normally. - Plugins requiring special entitlements create multiple xcode schemes. A scheme for Release builds, and one for Dev builds. When the additional schemes are added Fastlane fails with the error
Couldn't find specified scheme '{your app name}'. Multiple schemes found but you haven't specified one.
- Without a way to rename the scheme in the xcode project on the fly it's necessary to override the app name explicitly during the build.
As a workaround the following configuration can be used to build with the correct name for both platforms from the same commit.
config.xml
replace this:
<name>{unicode name}</name>
with this:
<name>{working name}</name>
Where {unicode name} is the desired display name of the app including unicode characters, and {working name} is a placeholder name without any whitespace or unicode characters.
Example:
I'd like to name my app BriÃn but the build fails because of the 'Ã' character. I'd use BriÃn as the {unicode name} and BrianApp as the {working name} in the configuration described below.
config.xml
Add the following to the iOS platform:
<platform name="ios">
<edit-config file="*-Info.plist" mode="overwrite" target="CFBundleDisplayName">
<string>{unicode name}</string>
</edit-config>
...
Add the following to the Android platform:
<platform name="android">
<hook src="android_rename_app.sh" type="after_prepare" />
...
Finally, add a script named android_rename_app.sh to the root of your project with the following contents:
#!/bin/bash
# If CI_SERVER is undefined or 'no' then the build is not running in
# Ionic Appflow
if [ "$CI_SERVER" = "yes" ]
then
echo "Ionic Appflow package build detected. Overriding app_name string."
#For cordova-android@6.4.0
# sed -i '''s/{working name}/{unicode name}/' ./platforms/android/res/values/strings.xml
# cat ./platforms/android/res/values/strings.xml
#For cordova-android@7.0.0+
sed -i '''s/{working name}/{unicode name}/' ./platforms/android/app/src/main/res/values/strings.xml
cat ./platforms/android/app/src/main/res/values/strings.xml
fi
Be sure to set execute permissions on android_rename_app.sh using chmod or git.
Comments
0 comments
Article is closed for comments.