Error in android genymotion emulator (linux): Httpexception: Connection closed before full header was Received, Uri = http://127.0.0.1

Asked

Viewed 57 times

0

I have the following error while running an android flutter project, I noticed that if I leave my code without letters in the text class, the code will run. An example:

import 'package:flutter/material.dart';
void main(){
  runApp(MaterialApp(
      title: "Count People",
      home: Column(
        children: <Widget>[
          Text(".", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
          ),
          FlatButton(
              child: Text("ButtonTest", style: TextStyle(color: Colors.white),),
              onPressed: (){}
          ),
        ],
      )
  ));
}

I noticed that if I use "." (dot as it is in the code above) , the program runs, but when you put any letter (a, b, c...), the program gets to enter the deployment process, but gives an error in the emulator.

Example of the chunk with characters causing the error:

children: <Widget>[
          Text("a", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
          ),

Console error output:

    Performing hot restart...
    Syncing files to device Flutter...
    Restarted application in 2.687ms.
    F/libc    ( 2131): Fatal signal 4 (SIGILL), code 2, fault addr 0xcee3f908 in tid 2148 (1.gpu)
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build fingerprint: 'Android/vbox86p/vbox86p:7.1.1/NMF26Q/392:userdebug/test-keys'
    Revision: '0'
    ABI: 'x86'
    pid: 2131, tid: 2148, name: 1.gpu  >>> br.com.myname.count_people <<<
    signal 4 (SIGILL), code 2 (ILL_ILLOPN), fault addr 0xcee3f908
        eax cdb8e5a8  ebx cf6fdbbc  ecx cdb8d430  edx 00000000
        esi 0000001b  edi 00000002
        xcs 00000023  xds 0000002b  xes 0000002b  xfs 0000006b  xss 0000002b
        eip cee3f909  ebp cdb8d378  esp cdb8d330  flags 00010246
    backtrace:
    ...
    #61 pc 0111accf  /data/app/br.com.myname.count_people-1/lib/x86/libflutter.so (offset 0x10fb000)
        #62 pc 000752b2  /system/lib/libc.so (_ZL15__pthread_startPv+210)
        #63 pc 000202ae  /system/lib/libc.so (__start_thread+30)
    Lost connection to device.

Terminal error output with flutter run command:

Launching lib/main.dart on Flutter in debug mode...
Initializing gradle...                                              1,2s
Resolving dependencies...                                           2,6s
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        18,0s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...                         6,6s
I/Choreographer( 2267): Skipped 89 frames!  The application may be doing too much work on its main thread.
Syncing files to device Flutter...                                 F/libc    ( 2267): Fatal signal 4 (SIGILL), code 2, fault addr 0xcef18908 in tid 2284 (1.gpu)                      
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***                                                    
Build fingerprint: 'Android/vbox86p/vbox86p:7.1.1/NMF26Q/392:userdebug/test-keys'                                  
Revision: '0'                                                                                                      
ABI: 'x86'                                                                                                         
pid: 2267, tid: 2284, name: 1.gpu  >>> br.com.myname.count_people <<<                                        
signal 4 (SIGILL), code 2 (ILL_ILLOPN), fault addr 0xcef18908                                                      
    eax cdc5c5a8  ebx cf7d6bbc  ecx cdc5b430  edx 00000000                                                         
    esi 0000001b  edi 00000002                                                                                     
    xcs 00000023  xds 0000002b  xes 0000002b  xfs 0000006b  xss 0000002b                                           
    eip cef18909  ebp cdc5b378  esp cdc5b330  flags 00010246                                                       
backtrace:    
...
#61 pc 0111accf  /data/app/br.com.myname.count_people-2/lib/x86/libflutter.so (offset 0x10fb000)         
    #62 pc 000752b2  /system/lib/libc.so (_ZL15__pthread_startPv+210)                                              
    #63 pc 000202ae  /system/lib/libc.so (__start_thread+30)                                                       
Lost connection to device.                                                                                         
Could not update files on device: HttpException: Connection closed before full header was received, uri =          
http://127.0.0.1:44139/D4BNlRCD8IA=/
Syncing files to device Flutter... 

I think it’s weird that you’re making this mistake and not accepting letters by closing the connection. I did a lot of research and saw that some people who use Mac OS seem to have a similar error, I don’t know if it has to do with the Unix kernel base. There they talked about setting up no_proxy. But I really have no idea what it is.

I thank anyone who can contribute.

1 answer

0

Try placing a Scaffold, because Text depends on Theme, you can implement Theme by placing some pre defined for example:

Text(
'Seu texto aqui',
 style: Theme.of(context).primaryTextTheme.headline,
 textAlign: TextAlign.center,
),

or else put a:

Material (
 child: Text(
 'Seu texto aqui',
 style: TextStyle( ...)
 textAlign: TextAlign.center,
),

and the form indicated:

void main(){
 runApp(MaterialApp(
   title: "Count People",
   home: Scaffold(
     body: Column(
    children: <Widget>[
      Text(".", style: TextStyle(color: Colors.white, fontWeight: 
      FontWeight.bold),
      ),
      FlatButton(
          child: Text("ButtonTest", style: TextStyle(color: Colors.white),),
          onPressed: (){}
      ),
    ],
  )
 ));
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.