Android Question Lollipop and Custom Fonts issue/crash

ptp170

Member
Licensed User
Longtime User
I've just spend an age tearing down my Play Store quiz games trying to figure out why they crash on Lollipop. No debug information was sent to the debugger so I ended up tearing the game apart until it worked.

The issue appears to be the use of custom fonts.. The font I used was fine on every platform from Kitkat backwards.

Lollipop seems to have a huge issue with this line..

B4X:
Dim fontMenuButtons As Typeface = Typeface.LoadFromAssets("font.ttf")

If I remove the custom fonts from the game then it works perfectly but obviously only using the default system font.

If I try other custom fonts some crash the game and some don't. The ones that don't crash simply aren't acknowledged and the default font is substituted.

I have found this thread about the issue but it doesn't seem to have a proper solution.

https://code.google.com/p/android-developer-preview/issues/detail?id=608&thanks=608&ts=1404735239

Does anyone have a way around this? There are hints in the above thread but I am struggling to make then work on my end..



Chris


B4a v4.00
Core v4.01
Phone v2.26
 
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
Hmm that's interesting. My Star Trek weather app uses multiple custom fonts and I too have no issues with Lollipop. I've done nothing to upgrade the app, it just worked on Android 5.x first time out.
 
Upvote 0

ptp170

Member
Licensed User
Longtime User
I have apps using custom fonts, no problems on Lollipop.

What's the error? have you checked the logs?

There are no errors reported as it crashes before the debugger has chance to connect.
Even when I picked a custom font that allows the program to run nothing is reported back either on the filtered/unfiltered logs.

Just as a side issue, I always used to get loads of data when logging in unfiltered mode... This doesn't happen anymore anymore for some reason...

I've tried my games in the emulator as well using API21 and they mimic what my phone does also.

Forgot to mention that I'm compiling using the Android.jar API 21. And that I've added the holo theme and minSDK11 to the manifest editor as recommended by Erel for Lollipop.

Chris
 
Upvote 0

ptp170

Member
Licensed User
Longtime User
Can you upload a small project that demonstrates this issue?

Included three fonts with the project file. Uncomment each line accordingly to see behavior in lollipop...
 

Attachments

  • LollipopFontFault1.zip
    119.3 KB · Views: 237
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

ptp170

Member
Licensed User
Longtime User
Upvote 0
Top