• Register
0 votes

Problem :

I have the below Activity class it contains the following:

public class TestFirstActivity extends Activity { 
public void onFirstCreate(Bundle savedFirstInstanceState) {

When I try to run this on my mobile device I get the below error:

SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

I have tried above code with and without the TextView but the error still remains, I must be doing something fundamentally very wrong for such a basic layout to cause this error.

Does anyone have any clue on how I can get this to load without the above error?

7.5k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

To try to debug your error, first you should go to your android terminal / console and then execute below command:


After this if the output comes out as your app then certainly it is your app which is causing the error. Try to look for empty Strings that you have passed into the layout.

I had this exact same problem in the past and it was my fault as I was passing the empty String into my then layout. After changing my "" to " " above error went away.


Hope this will help you in resolving your issue.

38.6k points

Related questions

0 votes
1 answer 7 views
Problem : Argument length must be greater or equal to zero.
asked Jul 2 Isac Christiaan 103k points
0 votes
1 answer 24 views
Problem: Trying to figure out this : Attempt to use zero-length variable name.
asked Jun 3 Aurelia Maja 78.4k points
0 votes
1 answer 126 views
Problem: Need help,error in if: argument is of length zero.What can I do?
asked Apr 18 Humaira ahmed 50.7k points
0 votes
1 answer 22 views
Problem: Error in if/while (condition) { : argument is of length zero.What causes this error message, and what does it mean?
asked Apr 18 sumaiya simi 43.9k points
0 votes
1 answer 163 views
Problem: Help! I am getting stucked with the following problem>error: attempt to use zero-length variable name.
asked Apr 3 ashik 14.6k points
0 votes
1 answer 74 views
Problem: I use this python shell to generate a string: >>>':'.join("{:x}\n".format(random.randint(0, 2**16 - 1)) for i in range(4)) When I run this shell in Python2.7.5, everything goes okay. But it occurs ValueError: zero length field name in format when Python version is 2.6.6. What should I run this shell fine when Python version is 2.6.6?
asked Feb 17 Mashhoodch 13k points
0 votes
1 answer 335 views
Problem: I am new, I need help, can anyone help me? The wireless spectrum, as defined by the FCC, spans between which two frequencies? A) 2 KHz B) 9 KHz C) 300 GHz D) 500 GHz
asked Feb 17, 2020 maddi86 5.4k points
0 votes
1 answer 17 views
Problem: Give me an answer please : Test class should have exactly one public zero-argument constructor
asked Jun 19 Sawyer Parviz 168k points
0 votes
1 answer 5 views
Problem: Aapt.exe'' finished with non-zero exit value 1
asked Jul 9 Hridoy 19.2k points