gpt4 book ai didi

android - Google Play 服务 + Android Studio 模拟器

转载 作者:行者123 更新时间:2023-11-30 02:09:07 41 4
gpt4 key购买 nike

我最近在使用 Android Studio 模拟器时遇到了这个问题,我不明白它是如何出现的以及为什么会出现,因为直到现在我的模拟器和应用程序都运行良好。

现在,当我尝试运行我的应用程序(使用 Google map 和 Google Places 自动完成)时,一条消息显示未安装 Google Play 服务。我设法将它安装在我的模拟器上,但该应用程序仍然无法正常运行。 Google map 出现,但 Google Places 自动完成功能不再起作用。

我注意到这是 Android 开发人员中的一个常见问题,经过一些研究后,我一直在尝试调整一些解决方案,但问题仍然存在。

谁能帮我解决这个问题并向我解释为什么会这样?是因为一些 Android Studio 更新了吗?

(错误信息)

    05-20 21:56:52.528: A/GmsApplication(2108): Unable to install secure provider, due to exception:

05-20 21:56:52.528: A/GmsApplication(2108): java.lang.SecurityException: attempting to read gservices without permission: Neither user 10053 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES.

05-20 21:56:52.528: A/GmsApplication(2108): at android.app.ContextImpl.enforce(ContextImpl.java:1914)

05-20 21:56:52.528: A/GmsApplication(2108): at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1943)

05-20 21:56:52.528: A/GmsApplication(2108): at android.content.ContextWrapper.enforceCallingOrSelfPermission(ContextWrapper.java:600)

05-20 21:56:52.528: A/GmsApplication(2108): at com.google.android.gsf.f.c(SourceFile:107)

05-20 21:56:52.528: A/GmsApplication(2108): at com.google.android.gsf.f.a(SourceFile:121)

05-20 21:56:52.528: A/GmsApplication(2108): at com.google.android.gsf.f.a(SourceFile:227)

05-20 21:56:52.528: A/GmsApplication(2108): at com.google.android.gms.common.a.l.a(SourceFile:301)

05-20 21:56:52.528: A/GmsApplication(2108): at com.google.android.gms.common.a.e.a(SourceFile:219)

05-20 21:56:52.528: A/GmsApplication(2108): at com.google.android.gms.common.a.d.c(SourceFile:197)

05-20 21:56:52.528: A/GmsApplication(2108): at com.google.android.gms.common.a.d.d(SourceFile:208)

05-20 21:56:52.528: A/GmsApplication(2108): at com.google.android.gms.common.security.ProviderInstallerImpl.insertProviderGated(SourceFile:90)

05-20 21:56:52.528: A/GmsApplication(2108): at com.google.android.gms.common.app.GmsApplication.onCreate(SourceFile:84)

05-20 21:56:52.528: A/GmsApplication(2108): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)

05-20 21:56:52.528: A/GmsApplication(2108): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4556)

05-20 21:56:52.528: A/GmsApplication(2108): at android.app.ActivityThread.access$1500(ActivityThread.java:151)

05-20 21:56:52.528: A/GmsApplication(2108): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)

05-20 21:56:52.528: A/GmsApplication(2108): at android.os.Handler.dispatchMessage(Handler.java:102)

05-20 21:56:52.528: A/GmsApplication(2108): at android.os.Looper.loop(Looper.java:135)

05-20 21:56:52.528: A/GmsApplication(2108): at android.app.ActivityThread.main(ActivityThread.java:5257)

05-20 21:56:52.528: A/GmsApplication(2108): at java.lang.reflect.Method.invoke(Native Method)

05-20 21:56:52.528: A/GmsApplication(2108): at java.lang.reflect.Method.invoke(Method.java:372)

05-20 21:56:52.528: A/GmsApplication(2108): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)

05-20 21:56:52.528: A/GmsApplication(2108): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)


05-20 21:56:52.552: D/AndroidRuntime(2108): Shutting down VM


05-20 21:56:52.560: E/AndroidRuntime(2108): FATAL EXCEPTION: main

05-20 21:56:52.560: E/AndroidRuntime(2108): Process: com.google.android.gms, PID: 2108

05-20 21:56:52.560: E/AndroidRuntime(2108): java.lang.RuntimeException: Unable to start receiver com.google.android.gms.subscribedfeeds.ConfigurationReceiver: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10053 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES.

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2619)

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.app.ActivityThread.access$1700(ActivityThread.java:151)

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380)

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.os.Handler.dispatchMessage(Handler.java:102)

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.os.Looper.loop(Looper.java:135)

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.app.ActivityThread.main(ActivityThread.java:5257)

05-20 21:56:52.560: E/AndroidRuntime(2108): at java.lang.reflect.Method.invoke(Native Method)

05-20 21:56:52.560: E/AndroidRuntime(2108): at java.lang.reflect.Method.invoke(Method.java:372)

05-20 21:56:52.560: E/AndroidRuntime(2108): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)

05-20 21:56:52.560: E/AndroidRuntime(2108): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

05-20 21:56:52.560: E/AndroidRuntime(2108): Caused by: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10053 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES.

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.app.ContextImpl.enforce(ContextImpl.java:1914)

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1943)

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.content.ContextWrapper.enforceCallingOrSelfPermission(ContextWrapper.java:600)

05-20 21:56:52.560: E/AndroidRuntime(2108): at com.google.android.gsf.f.c(SourceFile:107)

05-20 21:56:52.560: E/AndroidRuntime(2108): at com.google.android.gsf.f.a(SourceFile:121)

05-20 21:56:52.560: E/AndroidRuntime(2108): at com.google.android.gsf.f.a(SourceFile:182)

05-20 21:56:52.560: E/AndroidRuntime(2108): at com.google.android.gms.subscribedfeeds.ConfigurationReceiver.onReceive(SourceFile:31)

05-20 21:56:52.560: E/AndroidRuntime(2108): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2612)

05-20 21:56:52.560: E/AndroidRuntime(2108): ... 9 more

最佳答案

您必须在具有 Google API 的模拟器上运行该应用程序,这是您创建模拟器时的一个选项。只需使用 Google API 选择目标,请参见下图:

AVD Screenshot

关于android - Google Play 服务 + Android Studio 模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30360476/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com