访问被拒绝查找属性"vendor.debug.bq.dump 使用谷歌地图 api 密钥时



我正试图在我的flutter应用程序中使用谷歌地图api,但我在很长一段时间内都遇到了这个错误?

这是错误消息

DisplayEventDispatcher(14114):调度程序0x7ed0ac6320~调度时处理的最后一个事件是697675542D/MapsInitializer(14114):preferredRenderer:nullD/zzca(14114):首选应答器:nullI/Google Maps Android API(14114):Google Play服务包版本:223017029I/Google Maps Android API(14114):Google Play服务地图渲染器版本(旧版):203115000I/PlatformViewsController(14114):对平台视图使用混合组合:0W/System(14114):ClassLoader引用了未知路径:System/framework/mediatek-cta.jarI/System.out(14114):e:java.lang.ClassNotFoundException:com.mediatek.cta.CtaHttpW/System(14114):ClassLoader引用了未知路径:System/framework/mediatek-cta.jarI/System.out(14114):e:java.lang.ClassNotFoundException:com.mediatek.cta.CtaHttpD/Surface(14114):Surface::断开连接(this=0x7ed0efc000,api=1)D/Surface(14114):Surface::连接(this=0x7ed0b68000,api=1)I/BufferQueueProducer(14114):ImageReader-720x1464f1m3-14114-0连接(P):api=1生产者=(14114:com.example.location_viewer)生产者ControlledByApp=trueE/libc(14114):拒绝访问查找属性";vendor.debug.bq.line";I/Choreographer(14114):跳过了2帧!应用程序可能在其主线程上做了太多的工作。D/TextureView(14114):getHardwareLayer,createNewSurface:trueI/BufferQueue(14114):unnamed-14114-3 BufferQueue core=(14114:com.example.location_viewer)E/libc(14114):拒绝访问查找属性";vendor.debug.sf.stc_interval"E/libc(14114):拒绝访问查找属性";vendor.debug.bq.dump";I/BufferQueueConsumer(14114):unnamed-14114-3连接(C):consumer=(14114:com.example.location_viewer)controlledByApp=trueE/libc(14114):拒绝访问查找属性";vendor.debug.bq.dump";I/BufferQueueConsumer(14114):未命名-14114-3 setConsumerName:未命名-14141-3E/libc(14114):拒绝访问查找属性";vendor.debug.bq.line";E/libc(14114):拒绝访问查找属性";vendor.debug.bq.dump";I/BufferQueueConsumer(14114):SurfaceTexture-0-14114-1 setConsumerName:SurfaceTexture-0-14114-1E/libc(14114):拒绝访问查找属性";vendor.debug.bq.line";D/Surface(14114):Surface::连接(this=0x7ec54a1000,api=1)I/BufferQueueProducer(14114):SurfaceTexture-0-14114-1连接(P):api=1生产者=(14114:com.example.location_viewer)生产者ControlledByApp=trueE/libc(14114):拒绝访问查找属性";vendor.debug.bq.line";W/System(14114):ClassLoader引用了未知路径:System/framework/mediatek-cta.jarI/System.out(14114):e:java.lang.ClassNotFoundException:com.mediatek.cta.CtaHttpW/System(14114):ClassLoader引用了未知路径:System/framework/mediatek-cta.jarI/System.out(14114):e:java.lang.ClassNotFoundException:com.mediatek.cta.CtaHttp6.D/OpenSSLLib(14114):OpensslErr:模块:12(177:);文件:external/boringsl/src/crypto/asn1/asn1_lib.c;线路:168;函数:ASN1_get_objectI/location_viewe(14114):后台并发复制GC释放58336(2MB)AllocSpace对象,4(208KB)LOS对象,51%可用,3MB/7MB,暂停461us总计102.679msW/System(14114):ClassLoader引用了未知路径:System/framework/mediatek-cta.jarI/System.out(14114):[OkHttp]sendRequest<lt;W/System(14114):ClassLoader引用了未知路径:System/framework/mediatek-cta.jarI/System.out(14114):[OkHttp]sendRequest<lt;I/BufferQueueProducer(14114):SurfaceTexture-0-14114-1 queueBuffer:插槽2已删除,handle=0x7ed11e7dc0I/BufferQueueProducer(14114):SurfaceTexture-0-14114-1 queueBuffer:插槽0已删除,handle=0x7ed103a980I/BufferQueue(14114):SurfaceTexture-0-14114-0~BufferQueueCoreI/Choreographer(14114):跳过了1帧!应用程序可能在其主线程上做了太多的工作。I/GLConsumer(14114):[SurfaceTexture-0-14114-1]detachFromContextD/Surface(14114):Surface::断开连接(this=0x7ec54a1000,api=1)I/BufferQueueProducer(14114):SurfaceTexture-0-14114-1断开连接(P):api 1I/BufferQueueConsumer(14114):SurfaceTexture-0-14114-1 getReleasedBuffers:返回掩码0xffffffffffW/BufferQueueDump(14114):获取[ImageReader-720x1464f1m3-14114-0][addBuffer]slot(1),似乎异常,只是更新。。。I/Choreographer(14114):跳过了13帧!应用程序可能在其主线程上做了太多的工作。E/SchedPolicy(14114):set_timerslack_ns写入失败:不允许操作

这是我的android.xml文件注意事项,没有显示密钥

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.location_viewer">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
<application
android:label="location_viewer"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="**API_KEY**"/>
</application>
</manifest>

这就是我使用钥匙的代码

class LocationHelper {
static getUsersLocation(
{required double? latitude, required double? longitude}) {
return 'https://maps.googleapis.com/maps/api/staticmap?center=$latitude,$longitude&zoom=16&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C$latitude,$longitude&key=$apiKey1';
}
}

当我显示地图的静态图像时,它可以正常工作在这里输入图像描述但当我想在屏幕上渲染完整的地图时,它只会给我一个蓝色覆盖的空白地图,在这里输入图像描述

我认为您还没有将访问应用程序包名称的权限授予googlemap API键,因此请添加包名称或更改设置以允许任何应用程序访问任何包中的密钥。

最新更新