【问题标题】:Unfortunately app has stopped working on Android emulator不幸的是,应用程序已停止在 Android 模拟器上运行
【发布时间】:2015-08-10 17:23:48
【问题描述】:

我已经尝试过 Jack 的指令,但我仍然收到此错误

我在下面发布了新的 logcat

05-28 21:10:08.603: A/GmsApplication(3335): Unable to install secure provider, due to exception:
05-28 21:10:08.603: A/GmsApplication(3335): java.lang.SecurityException: attempting to read gservices without permission: Neither user 10007 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES.
05-28 21:10:08.603: A/GmsApplication(3335):     at android.app.ContextImpl.enforce(ContextImpl.java:1914)
05-28 21:10:08.603: A/GmsApplication(3335):     at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1943)
05-28 21:10:08.603: A/GmsApplication(3335):     at android.content.ContextWrapper.enforceCallingOrSelfPermission(ContextWrapper.java:600)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.google.android.gsf.e.c(SourceFile:107)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.google.android.gms.common.security.ProviderInstallerImpl.insertProviderGated(SourceFile:90)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.google.android.gms.common.app.GmsApplication.onCreate(SourceFile:85)
05-28 21:10:08.603: A/GmsApplication(3335):     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
05-28 21:10:08.603: A/GmsApplication(3335):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4556)
05-28 21:10:08.603: A/GmsApplication(3335):     at android.app.ActivityThread.access$1500(ActivityThread.java:151)
05-28 21:10:08.603: A/GmsApplication(3335):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
05-28 21:10:08.603: A/GmsApplication(3335):     at android.os.Handler.dispatchMessage(Handler.java:102)
05-28 21:10:08.603: A/GmsApplication(3335):     at android.os.Looper.loop(Looper.java:135)
05-28 21:10:08.603: A/GmsApplication(3335):     at android.app.ActivityThread.main(ActivityThread.java:5257)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
05-28 21:10:08.603: A/GmsApplication(3335):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
05-28 21:10:08.940: E/AndroidRuntime(3335): FATAL EXCEPTION: main
05-28 21:10:08.940: E/AndroidRuntime(3335): Process: com.google.android.gms.persistent, PID: 3335
05-28 21:10:08.940: E/AndroidRuntime(3335): java.lang.RuntimeException: Unable to create service com.google.android.location.internal.GoogleLocationManagerService: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10007 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES.
05-28 21:10:08.940: E/AndroidRuntime(3335):     at android.app.ActivityThread.handleCreateService(ActivityThread.java:2774)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at android.app.ActivityThread.access$1800(ActivityThread.java:151)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1386)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at android.os.Handler.dispatchMessage(Handler.java:102)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at android.os.Looper.loop(Looper.java:135)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at android.app.ActivityThread.main(ActivityThread.java:5257)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at java.lang.reflect.Method.invoke(Native Method)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at java.lang.reflect.Method.invoke(Method.java:372)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
05-28 21:10:08.940: E/AndroidRuntime(3335): Caused by: java.lang.SecurityException: attempting to read gservices without permission: Neither user 10007 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES.
05-28 21:10:08.940: E/AndroidRuntime(3335):     at android.app.ContextImpl.enforce(ContextImpl.java:1914)
05-28 21:10:08.940: E/AndroidRuntime(3335):     at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1943)
05-28 21:10:08.940: E/AndroidRuntime(3335):     ... 9 more
05-28 21:10:16.483: E/libEGL(934): called unimplemented OpenGL ES API
05-28 21:10:16.483: E/SurfaceFlinger(934): glCheckFramebufferStatusOES error 1395899833
05-28 21:10:16.483: E/SurfaceFlinger(934): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot

【问题讨论】:

  • 在清单中定义你的 MainActivity
  • 发布您的布局文件。
  • 发布您的 marifest 文件。
  • 您应该尝试发布一些有关错误实际发生方式的信息。有时很难从错误中判断到底发生了什么。

标签: java android android-emulator inflate-exception


【解决方案1】:

异常细节在logcat中都明确提到了

 The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 7327000 but found 0.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

根据上面的细节更改你的清单meta-data标签。

【讨论】:

  • 感谢您的回复,但您能再帮我一次吗?我收到新错误
  • 您必须使用 google api(google play services) 创建模拟器才能运行它...或者您可以使用真实设备...
  • 我的模拟器使用的是android api而不是google api,我会试试你的建议
【解决方案2】:

插入您的清单文件

 <activity
        android:name=".Yourclassname"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>




    <meta-data
        android:name="com.google.android.gms.version"
        android:value="7327000" />

【讨论】:

【解决方案3】:

您必须具备以下条件 AndroidManifest 中的声明。 xml

<application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 

logcat里是这么说的

【讨论】:

猜你喜欢
  • 2014-08-04
  • 2012-07-12
  • 2012-01-08
  • 1970-01-01
  • 2014-02-26
  • 1970-01-01
  • 1970-01-01
  • 2014-09-22
  • 1970-01-01
相关资源
最近更新 更多