Error: "I/Process (26960): Sending signal. PID: 26960 SIG: 9 Lost connection to device." while using flutter on android studio

6,329

Solution 1

Okay, I'm leaving this here in case anyone else is facing the same problem. I added

android.enableDexingArtifactTransform=false

to gradle.properties and it worked.

check out https://github.com/flutter/flutter/issues/72185 for more details

Solution 2

hi maybe it is because of permission access, please add this line of code to your /android/app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Share:
6,329
The Vortex
Author by

The Vortex

Updated on December 26, 2022

Comments

  • The Vortex
    The Vortex over 1 year

    After I typed in this block of code, Every time I try to run the program, I get this
    "I/Process (26960): Sending signal. PID: 26960 SIG: 9
    Lost connection to device.

    Below is the block of code.I had added all the permission and dependencies necessary to make this work but I'm still stuck on this error. Please assist me (I use windows).

    import 'dart:async';
    import 'package:flutter/material.dart';
    import 'package:geolocator/geolocator.dart';
    import 'package:google_maps_flutter/google_maps_flutter.dart';
    
    class HomeTabPage extends StatelessWidget
    {
      Completer<GoogleMapController> _controllerGoogleMap = Completer();
      GoogleMapController newGoogleMapController;
    
      static final CameraPosition _kGooglePlex = CameraPosition(
        target: LatLng(37.42796133580664, -122.085749655962),
        zoom: 14.4746,
      );
    
      Position currentPosition;
      var geolocator = Geolocator();
    
    
      void locatePosition() async
      {
        Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
        currentPosition = position;
    
        LatLng intLatPosition = LatLng(position.latitude, position.longitude);
    
        CameraPosition cameraPosition = new CameraPosition(target: intLatPosition, zoom: 14);
        newGoogleMapController.animateCamera(CameraUpdate.newCameraPosition(cameraPosition));
    
        //String address = await AssistantMethods.searchCoordinateAddress(position, context);
        //print("This is your Address :: " + address);
    
      }
    
      @override
      Widget build(BuildContext context)
      {
        return Stack(
          children: [
            GoogleMap(
              mapType: MapType.normal,
              myLocationButtonEnabled: true,
              initialCameraPosition: _kGooglePlex,
              myLocationEnabled: true,
              onMapCreated: (GoogleMapController controller)
              {
                _controllerGoogleMap.complete(controller);
                newGoogleMapController = controller;
    
                locatePosition();
              },
            ),
          ],
        );
      }
    }
    
    
  • The Vortex
    The Vortex over 3 years
    Thanks but I did that already. still the same problem.