So I have just finished making a game (with help from #Fluidity) and when I build it the fonts requested are all ignored. I have selected fonts to be used in main.storyboard but when it gets to the game the default is used. Any help is appreciated.
You'll need to add the file in your project and specify this font in your Info.plist
For example, add the following in your Info.plist
<key>UIAppFonts</key>
<array>
<string>Fluidity.otf</string>
</array>
I'm assuming the filename is Fluidity.otf
I fixed the problem by Checking the box in Target Membership relevant to the necessary application.
Target membership is located on the right after clicking your custom font under your application files.
Related
I am trying to set the launcher icon for xamarin forms ios project from Mac.
I do the following things but still showing the default icon.
1.Double-Click the Info.plist file in the Solution Explorer to open it for editing.
2.Scroll down to the App Icons section.
3.From the Source dropdown list, select AppIcon-1.
4.Open Assets.xcassets and select App icons from the list.
5.Select the image file for the required type(Prerendered option is not checked). Some icons are already filled with the default icon and if I change that will get the file not found error.
XSAppIconAssets path in Info.plist is:
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon-1.appiconset</string>
Is there any additional set up for this task? I refer this blog: https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/app-icons?tabs=vsmac
Thanks in advance.
It is because that Assets file path doesn't match the vaule in info.plist, your application cannot find it so use the default icons.
Right click info.plist and open it with XML(Text)Editor, you can find
<key>XSAppIconAssets</key>
<string>Resources/Images.xcassets/AppIcons.appiconset</string>
Right click Assets.xcassets and open containing folder , select its parent folder, you can find it locates at YourApp.iOS not Resources.
Solution
Change XSAppIconAssets from Resources/Images.xcassets/AppIcons.appiconset to Images.xcassets/AppIcons.appiconset , it should be able to solve the issue.
I had to localize Privacy - Camera Usage Description key located in Info.plist. So what I did, is that I've localized it through the File Inspector. What happened is that Info.plist is moved to the Base.lproj. That is fine. Then, again inside of File Inspector, Localization section, I checked two more languages.
By doing this, additional Info.plist files are added into appropriate .lproj directories. So after I have added desired translations I run the project, but Xcode throw an error which says that path of Info.plist is wrong. That make sense because Info.plist is not at the same location anymore. So I've gone into Project Navigator, Build Settings section, and found a key that says Info.plist File and set its value to something like this:
MyProjectName/Base.lproj/Info.plist
Because the Info.plist file exists at that path, I was able to build/run an app, but still, it loads only the translation for the base language (english).
So, how should I specify the path of a localized Info.plist file ?
You should use an InfoPlist.string file. here is a related issue.
How to localise a string inside the iOS info.plist file?
I've recently migrated my application to support iOS7 and during that process updated my app icons to use an Asset Catalog; which is all working great in the app. However, in Organizer—and TestFlight—my app icon is missing.
The same is also happening in TestFlight—which implies there is something missing from my bundle. Any help would be gratefully received.
So it seems you still need to have the Icon files entry in the app plist that points to an icon that is a resource in the app; even though Xcode removed this when I converted to the catalog; here is the entry that I created manually whilst also keeping the asset catalog:
Note that I have tested this with different icons and this setting does not impact the icons the App actually uses at runtime; this entry appears to only be used by Organizer and TestFlight, thereby solving my problem.
Yeah while using the Asset Catalog, you may need to do the following to get the App's Icon linked and working for Ad-Hoc distributions / production to be seen in Organiser, Test flight and possibly unknown AppStore locations.
After creating the Asset Catalog, take note of the name of the Launch Images and App Icon names listed in the .xassets in Xcode.
By Default this should be
AppIcon
LaunchImage
[To see this click on your .xassets folder/icon in Xcode.]
(this can be changed, so just take note of this variable for later)
What is created now each build is the following data structures in your .app:
For App Icons:
iPhone
AppIcon57x57.png (iPhone non retina) [Notice the Icon name prefix]
AppIcon57x57#2x.png (iPhone retina)
And the same format for each of the other icon resolutions.
iPad
AppIcon72x72~ipad.png (iPad non retina)
AppIcon72x72#2x~ipad.png (iPad retina)
(For iPad it is slightly different postfix)
Main Problem
Now I noticed that in my Info.plist in Xcode 5.0.1 it automatically attempted and failed to create a key for "Icon files (iOS 5)" after completing the creation of the Asset Catalog.
If it did create a reference successfully / this may have been patched by Apple or just worked, then all you have to do is review the image names to validate the format listed above.
Final Solution:
Add the following key to you main .plist
I suggest you open your main .plist with a external text editor such as TextWrangler rather than in Xcode to copy and paste the following key in.
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon57x57.png</string>
<string>AppIcon57x57#2x.png</string>
<string>AppIcon72x72~ipad.png</string>
<string>AppIcon72x72#2x~ipad.png</string>
</array>
</dict>
</dict>
Please Note I have only included my example resolutions, you will need to add them all.
If you want to add this Key in Xcode without an external editor, Use the following:
Icon files (iOS 5) - Dictionary
Primary Icon - Dictionary
Icon files - Array
Item 0 - String = AppIcon57x57.png
And for each other item / app icon.
Now when you finally archive your project the final .xcarchive payload .plist will now include the above stated icon locations to build and use.
Do not add the following to any .plist: Just an example of what Xcode will now generate for your final payload
<key>IconPaths</key>
<array>
<string>Applications/Example.app/AppIcon57x57.png</string>
<string>Applications/Example.app/AppIcon57x57#2x.png</string>
<string>Applications/Example.app/AppIcon72x72~ipad.png</string>
<string>Applications/Example.app/AppIcon72x72#2x~ipad.png</string>
</array>
Yet another possible hiccup with migrating to Asset Catalog.
There is two ways to define icons in project settings: CFBundleIconFiles since iOS3 and CFBundleIcons since iOS5. The older, despite being older, contrary to common sense about backward compatiblity, still takes precedence. I was using CFBundleIcons before migrating directly to Asset Catalog. And after i migrated, i removed the original files pointed to by CFBundleIcons because, you know, now i had the shiny new Asset Catalog, right? And XCode did three things:
it hides the visual editing of former CFBundleIcons from General project settings. Why would you need it when you already opted in for the shiny new Asset Catalog, right?
it does not remove the original CFBundleIcons key of Info.plist, though, by opting in for the Asset Catalog, you are saying clear and loud that you are not going below iOS5
it does not validate the said key either. No little red crossmarks anywhere, because the project settings UI which could display them, is not visible anymore
The result is hidden, visually noneditable, possibly outdated/wrong key in Info.plist which takes precedence over what Asset Catalog created for you.
Go open your Info.plist manually and delete CFBundleIcons, rebuild, reupload, and voilà, icon is back.
I tried to make the localization of the app name using CFBundleDisplayName.
I made the localized InfoPlist.strings according two different language.
In one strings file wrote:
CFBundleDisplayName="x11111"
and in another:
CFBundleDisplayName="y22222"
And in file info.plist, I added "Application requires iPhone environment" property, and set the boolean value to YES.
And in info.plist,the "Bundle display name" I used "x11111".
The localization worked ok on the simulator, but when tested on the device , it did not work.
On device, the name I used for 'Bundle display name' in info.plist can only be showed.
By the way, I use cocos2d for the project.
Anything I missed or did wrong?
If your localisation files were supplied to you, and you need to add them, be sure to add them correctly on per file basis. In Xcode, while you are adding files, pay attention how you add them. This is how they should look in Xcode Project Navigator.
I have added them by selecting all folders which didn't add them correctly to project.
I'm trying to make my app not run in the background using Appcelerator Titanium, and have only come accross the solution which suggests editing the info.plist file after the build has completed.
<key>UIApplicationExitsOnSuspend</key>
<true/>
This works as expected, however this means I would have to put this in each time I do a full rebuild on the app. Does anybody know of anything i can put in the tiapp.xml file in order to acheive this?
Thanks
You can just copy the built info.plist into your Resources folder once. From http://developer.appcelerator.com/blog/2010/04/adding-custom-fonts-to-ipad.html
"As an update for those using 1.3+, we’ve changed the way that custom Info.plist files are handled in Titanium. You’ll want to copy the Info.plist that is generated for your project under build/iphone into your project root folder. You can edit this file to add any custom Info.plist changes. From now on, Titanium compiler will always use this Info.plist."