错误:“I/Process (26960): Sending signal.PID: 26960 SIG: 9 Lost connection to device.”在 android studio
Posted
技术标签:
【中文标题】错误:“I/Process (26960): Sending signal.PID: 26960 SIG: 9 Lost connection to device.”在 android studio 上使用颤振时【英文标题】:Error: "I/Process (26960): Sending signal. PID: 26960 SIG: 9 Lost connection to device." while using flutter on android studio 【发布时间】:2021-04-13 17:08:26 【问题描述】:在我输入这段代码之后,每次我尝试运行程序时,我都会得到这个 “I/Process (26960): 发送信号。PID: 26960 SIG: 9 与设备的连接断开。
下面是代码块。我已经添加了完成这项工作所需的所有权限和依赖项,但我仍然遇到此错误。请帮助我(我使用 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();
,
),
],
);
【问题讨论】:
我在使用 ClusterManager 时遇到了类似的问题。不幸的是,添加 android.enableDexingArtifactTransform=false 没有用。有趣的是,在 preprod 上一切都很好,只有 prod 崩溃 【参考方案1】:好的,我把这个留在这里,以防其他人遇到同样的问题。我加了
android.enableDexingArtifactTransform=false
到 gradle.properties 并且它起作用了。
查看https://github.com/flutter/flutter/issues/72185了解更多详情
【讨论】:
【参考方案2】:您好,可能是因为权限访问,请将此行代码添加到您的/android/app/src/main/AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
【讨论】:
谢谢,但我已经这样做了。还是一样的问题。以上是关于错误:“I/Process (26960): Sending signal.PID: 26960 SIG: 9 Lost connection to device.”在 android studio 的主要内容,如果未能解决你的问题,请参考以下文章