Textfield black on Android


After testing my App on android Target, I have encounter bug with Textfield. So, I tried “AddingText” sample on my tablet (nexus 7) and same bug appeared. I tried to compile with -dlegacy option but I still have the same bug. However, my app and the “addingtext” sample works on others platforms.

On android device, the field of my textfield is fully black, a big black square instead of my text.
Does anyone have solution?

Openfl 3.1 and lime 2.4.4

Is anyone else seeing this? I believe it works on my devices

Oh, did you have an old version installed? Perhaps you should force remove the app from your device, and try again, just to be sure it’s running the newest version?

Thank you for the answer.

After i noticed the bug on my game, I’ve tested this sample just to be sure : https://github.com/openfl/openfl-samples/tree/master/AddingText .

So i had never tested AddingText Sample on my device, the bug appeared during the first launch and is still there.

I am wondering if my version of Android API is not too old. I am using Android Api 16, can it be the problem?

Just for information, My nexus 7 is running Android 4.4.4.

Hi, Damsminours!
Can you post screenshot? I think I know your bug.

The scrrenshots of AddingText Sample on Android target:

On flash target :

Does this affect anyone else?

Hey Damsminours,

have you tried using a specific font? I believe there was a bug about the standard font not being copied into the Android project.


phil_mexico :
My font is in the “Assets” folder like this ( https://github.com/openfl/openfl-samples/tree/master/AddingText/Assets ). If I understand you, i should try to copy my font manually in the Android folder where the application is built ?

Bump !

I tested my App on a Nexus 4 with android 5.1.1, and textfield works !!!
So, now the question is, why it doesn’t work on my nexus 7 with android 5.1.1 ?

Hey Damsminours,

what you did is exactly what I suggested, so I’m sorry, I can only give you generic ideas. What differences are between the two setups? Did you have a previous build of the app installed on only one of the devices? Did you use the identical APK? Have you tried a different font, a different font size, a different name with no blank?

Sorry for the late reply & for not being much help; I hope this will at least help you with a bump.

Good luck!

Finally, my bug still there on nexus 7 so i’ve decided to use this lib https://github.com/Beeblerox/BitmapFont to draw text.

I have a Nexus 4, things are working here :confused:

I wish I knew what was going on, curious that it happens on -Dlegacy too

yes on my nexus 4 it works for me too. Maybe it’s a tegra 3 problem.

It’s probably an OpenGL error, I wonder how we could get some debug information back about it. Do the logs show anything interesting?

Hey guys,

I also had the same problem, but I just fixed it. It was that I was putting too much width to my textfield

	addChild( googlePlayServices );
	googlePlayServices.width = 1000000;
	googlePlayServices.x = 100;
	googlePlayServices.y = 100;
	googlePlayServices.defaultTextFormat = new TextFormat("Arial", 30, 0xff0000, true);

Commenting the width assignment part avoid breaking the textfield rendering.
Hope this helps,

Oh, oversized GL textures display as black on the GPU, that makes sense! :smile:

(perhaps we should limit these somehow internally)